aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-10-03 19:23:49 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2017-10-04 19:19:57 +0200
commit2ea2883145b2ad06d437d3fcf06026583109791a (patch)
tree88287fc5bd2ddd52abcd7aedb2680ba81c317871
parent1184f21319d6bfda2aa81e4170f9559a86a8fc6e (diff)
downloadlibnitrokey-2ea2883145b2ad06d437d3fcf06026583109791a.tar.gz
libnitrokey-2ea2883145b2ad06d437d3fcf06026583109791a.tar.bz2
Remove libnitrokey-log and add a switch to choose version instead
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
-rw-r--r--CMakeLists.txt22
-rw-r--r--unittest/conftest.py4
2 files changed, 12 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 11882f9..6e5ed53 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -83,18 +83,15 @@ ENDIF()
IF (NOT LIBNITROKEY_STATIC)
add_library(nitrokey SHARED ${SOURCE_FILES})
- add_library(nitrokey-log SHARED ${SOURCE_FILES})
install (TARGETS nitrokey DESTINATION "lib")
SET(LIBNAME nitrokey)
ELSE()
add_library(nitrokey-static STATIC ${SOURCE_FILES})
- add_library(nitrokey-static-log STATIC ${SOURCE_FILES})
SET(LIBNAME nitrokey-static)
ENDIF()
target_link_libraries(${LIBNAME} hidapi-libusb)
-target_link_libraries(${LIBNAME}-log hidapi-libusb)
OPTION(ERROR_ON_WARNING "Stop compilation on warning found (not supported for MSVC)" ON)
if (NOT MSVC)
@@ -104,10 +101,13 @@ if (NOT MSVC)
set(COMPILE_FLAGS "${COMPILE_FLAGS} -Werror")
endif()
ENDIF()
- SET_TARGET_PROPERTIES(${LIBNAME} ${LIBNAME}-log PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS} )
+ SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS} )
endif()
-SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES COMPILE_DEFINITIONS "NO_LOG")
+OPTION(NO_LOG "Compile without logging functionality and its strings (decreases size)" OFF)
+IF (NO_LOG)
+ SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES COMPILE_DEFINITIONS "NO_LOG")
+ENDIF()
file(GLOB LIB_INCLUDES "include/libnitrokey/*.h")
@@ -119,22 +119,22 @@ IF (COMPILE_TESTS)
add_library(catch STATIC unittest/catch_main.cpp )
add_executable (test_C_API unittest/test_C_API.cpp)
- target_link_libraries (test_C_API ${EXTRA_LIBS} ${LIBNAME}-log catch)
+ target_link_libraries (test_C_API ${EXTRA_LIBS} ${LIBNAME} catch)
add_executable (test2 unittest/test2.cc)
- target_link_libraries (test2 ${EXTRA_LIBS} ${LIBNAME}-log catch)
+ target_link_libraries (test2 ${EXTRA_LIBS} ${LIBNAME} catch)
add_executable (test3 unittest/test3.cc)
- target_link_libraries (test3 ${EXTRA_LIBS} ${LIBNAME}-log catch)
+ target_link_libraries (test3 ${EXTRA_LIBS} ${LIBNAME} catch)
add_executable (test_HOTP unittest/test_HOTP.cc)
- target_link_libraries (test_HOTP ${EXTRA_LIBS} ${LIBNAME}-log catch)
+ target_link_libraries (test_HOTP ${EXTRA_LIBS} ${LIBNAME} catch)
add_executable (test1 unittest/test.cc)
- target_link_libraries (test1 ${EXTRA_LIBS} ${LIBNAME}-log catch)
+ target_link_libraries (test1 ${EXTRA_LIBS} ${LIBNAME} catch)
add_executable (test_issues unittest/test_issues.cc)
- target_link_libraries (test_issues ${EXTRA_LIBS} ${LIBNAME}-log catch)
+ target_link_libraries (test_issues ${EXTRA_LIBS} ${LIBNAME} catch)
#run with 'make test' or 'ctest'
#needs connected PRO device for success
diff --git a/unittest/conftest.py b/unittest/conftest.py
index 04e85ff..8c9899c 100644
--- a/unittest/conftest.py
+++ b/unittest/conftest.py
@@ -33,11 +33,9 @@ def C(request):
import os, sys
path_build = os.path.join("..", "build")
paths = [
- os.path.join(path_build,"libnitrokey-log.so"),
os.path.join(path_build,"libnitrokey.so"),
- os.path.join(path_build,"libnitrokey-log.dll"),
+ os.path.join(path_build,"libnitrokey.dylib"),
os.path.join(path_build,"libnitrokey.dll"),
- os.path.join(path_build,"nitrokey-log.dll"),
os.path.join(path_build,"nitrokey.dll"),
]
for p in paths: