diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2017-10-03 19:23:49 +0200 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2017-10-04 19:19:57 +0200 |
commit | 2ea2883145b2ad06d437d3fcf06026583109791a (patch) | |
tree | 88287fc5bd2ddd52abcd7aedb2680ba81c317871 /CMakeLists.txt | |
parent | 1184f21319d6bfda2aa81e4170f9559a86a8fc6e (diff) | |
download | libnitrokey-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>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 22 |
1 files changed, 11 insertions, 11 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 |