From dd41e1dfbf05fcc800d4dc9a4d1d3a70925b7607 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Fri, 31 Mar 2017 14:17:30 +0200 Subject: Do not check for warnings on 3rd-party code - hidapi Signed-off-by: Szczepan Zalega --- CMakeLists.txt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'CMakeLists.txt') 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) -- cgit v1.2.1