summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-03-31 14:17:30 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2017-03-31 14:20:58 +0200
commitdd41e1dfbf05fcc800d4dc9a4d1d3a70925b7607 (patch)
tree8ef6aead6b9d6039177c6b959218950f2061ebf8 /CMakeLists.txt
parentbf289b885768ae5db4e15e18f66390595a2b20f3 (diff)
downloadlibnitrokey-dd41e1dfbf05fcc800d4dc9a4d1d3a70925b7607.tar.gz
libnitrokey-dd41e1dfbf05fcc800d4dc9a4d1d3a70925b7607.tar.bz2
Do not check for warnings on 3rd-party code - hidapi
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt16
1 files changed, 9 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a1f582a..e07a5fd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,13 +28,6 @@ set(CMAKE_CXX_STANDARD 14)
OPTION(LIBNITROKEY_STATIC "Build libnitrokey statically" TRUE)
-OPTION(ERROR_ON_WARNING "Stop compilation on warning found (not supported for MSVC)" ON)
-if (NOT MSVC)
- add_compile_options(-Wall -Wno-unused-function -Wcast-qual -Woverloaded-virtual)
- if (ERROR_ON_WARNING)
- add_compile_options(-Werror)
- endif()
-endif()
OPTION(COMPILE_TESTS "Compile tests" FALSE)
IF (NOT CMAKE_BUILD_TYPE)
@@ -82,6 +75,14 @@ ELSEIF(WIN32)
target_link_libraries(hidapi-libusb setupapi)
ENDIF()
+OPTION(ERROR_ON_WARNING "Stop compilation on warning found (not supported for MSVC)" ON)
+if (NOT MSVC)
+ add_compile_options(-Wall -Wno-unused-function -Wcast-qual -Woverloaded-virtual)
+ if (ERROR_ON_WARNING)
+ add_compile_options(-Werror)
+ endif()
+endif()
+
IF (NOT LIBNITROKEY_STATIC)
add_library(nitrokey SHARED ${SOURCE_FILES})
add_library(nitrokey-log SHARED ${SOURCE_FILES})
@@ -93,6 +94,7 @@ ELSE()
SET(LIBNAME nitrokey-static)
ENDIF()
+
target_link_libraries(${LIBNAME} hidapi-libusb)
target_link_libraries(${LIBNAME}-log hidapi-libusb)