aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt11
1 files changed, 5 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5fea2f6..b1103db 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -94,13 +94,12 @@ target_link_libraries(${LIBNAME}-log hidapi-libusb)
OPTION(ERROR_ON_WARNING "Stop compilation on warning found (not supported for MSVC)" ON)
if (NOT MSVC)
set(COMPILE_FLAGS "-Wall -Wno-unused-function -Wcast-qual -Woverloaded-virtual")
- if (ERROR_ON_WARNING)
- set(COMPILE_FLAGS "${COMPILE_FLAGS} -Werror")
- endif()
- SET_TARGET_PROPERTIES(${LIBNAME} ${LIBNAME}-log PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS} )
- IF(APPLE)
- SET_TARGET_PROPERTIES(hidapi-libusb PROPERTIES COMPILE_FLAGS "" )
+ IF(NOT APPLE)
+ if (ERROR_ON_WARNING)
+ set(COMPILE_FLAGS "${COMPILE_FLAGS} -Werror")
+ endif()
ENDIF()
+ SET_TARGET_PROPERTIES(${LIBNAME} ${LIBNAME}-log PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS} )
endif()
SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES COMPILE_DEFINITIONS "NO_LOG")