aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-10-10 18:25:32 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2017-10-10 18:25:32 +0200
commit343e4b1e6d53f042df84e951209b5a33b9a617c3 (patch)
treeba771942520fe6649d6e47a223814a260b9c5f31 /CMakeLists.txt
parentfa871ecba4333ffe9a96b0a662b9d77089cf69b7 (diff)
parentbe675e293fe94a4a6926125a61e67e92e8788d8a (diff)
downloadlibnitrokey-343e4b1e6d53f042df84e951209b5a33b9a617c3.tar.gz
libnitrokey-343e4b1e6d53f042df84e951209b5a33b9a617c3.tar.bz2
Merge branch 'test_organize'
Improve test organization Disable CRC check Improve log
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt21
1 files changed, 11 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c868fae..8cb0fdc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -95,13 +95,11 @@ IF (NOT LIBNITROKEY_STATIC)
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)
set_target_properties(${LIBNAME} PROPERTIES VERSION ${LIBNK_VERSION}
SOVERSION ${LIBNK_VERSION_MAJOR} )
@@ -116,10 +114,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/*.h")
@@ -140,22 +141,22 @@ IF (COMPILE_TESTS)
#needs connected PRO device for success
#warning: it may delete data on the device
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)
ENDIF()