diff options
author | Sebastian Pipping <sebastian@pipping.org> | 2021-03-23 21:46:31 +0100 |
---|---|---|
committer | Sebastian Pipping <sebastian@pipping.org> | 2021-03-23 22:22:01 +0100 |
commit | 03cea1cbfad9c15b4fbeccf1ed0adf0ddc2cc8a2 (patch) | |
tree | 355d3917a4e4ed3c0eb8d50907cd0ffb0a67ccfb | |
parent | 5f0df0ac7bcd6b2302327c2d665dde63468c63e8 (diff) | |
download | uriparser-03cea1cbfad9c15b4fbeccf1ed0adf0ddc2cc8a2.tar.gz |
CMake: Move call to add_definitions(/WX) after all C/C++ targets
.. to prepare for upcoming change.
-rw-r--r-- | CMakeLists.txt | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c2db2d..fce0cf9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -109,17 +109,6 @@ if(URIPARSER_COMPILER_SUPPORTS_VISIBILITY) set(URIPARSER_EXTRA_COMPILE_FLAGS "${URIPARSER_EXTRA_COMPILE_FLAGS} -fvisibility=hidden") endif() -if(URIPARSER_WARNINGS_AS_ERRORS) - if(MSVC) - add_definitions(/WX) - else() - set(URIPARSER_EXTRA_COMPILE_FLAGS "${URIPARSER_EXTRA_COMPILE_FLAGS} -Werror") - endif() -endif() - -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${URIPARSER_EXTRA_COMPILE_FLAGS}") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${URIPARSER_EXTRA_COMPILE_FLAGS}") - # # config.h # @@ -326,6 +315,20 @@ if(URIPARSER_BUILD_TESTS) endif() # +# Compiler flags +# +if(URIPARSER_WARNINGS_AS_ERRORS) + if(MSVC) + add_definitions(/WX) + else() + set(URIPARSER_EXTRA_COMPILE_FLAGS "${URIPARSER_EXTRA_COMPILE_FLAGS} -Werror") + endif() +endif() + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${URIPARSER_EXTRA_COMPILE_FLAGS}") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${URIPARSER_EXTRA_COMPILE_FLAGS}") + +# # Doxygen API documentation # if(URIPARSER_BUILD_DOCS) |