diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index d9054d11..96fae077 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,11 +1,10 @@ if(ENABLE_EXAMPLES) - # XXX replace this by lists (WARNCFLAGS_list) - string(REPLACE " " ";" c_flags "${WARNCFLAGS}") - string(REPLACE " " ";" cxx_flags "${WARNCXXFLAGS} ${CXX1XCXXFLAGS}") - add_compile_options( - "$<$:${c_flags}>" - "$<$:${cxx_flags}>" - ) + file(GLOB c_sources *.c) + set_source_files_properties(${c_sources} PROPERTIES + COMPILE_FLAGS "${WARNCFLAGS}") + file(GLOB cxx_sources *.cc) + set_source_files_properties(${cxx_sources} PROPERTIES + COMPILE_FLAGS "${WARNCXXFLAGS} ${CXX1XCXXFLAGS}") include_directories( ${CMAKE_SOURCE_DIR} diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index a6adc04d..ff512a45 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -26,7 +26,6 @@ set(NGHTTP2_SOURCES # Public shared library add_library(nghttp2 SHARED ${NGHTTP2_SOURCES}) -# Needed because the object files are linked into a shared library. set_target_properties(nghttp2 PROPERTIES COMPILE_FLAGS "${WARNCFLAGS}" VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION} diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 83903dda..5bf8f972 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,12 +1,11 @@ add_subdirectory(includes) -# XXX replace this by lists (WARNCFLAGS_list) -string(REPLACE " " ";" c_flags "${WARNCFLAGS}") -string(REPLACE " " ";" cxx_flags "${WARNCXXFLAGS} ${CXX1XCXXFLAGS}") -add_compile_options( - "$<$:${c_flags}>" - "$<$:${cxx_flags}>" -) +file(GLOB c_sources *.c) +set_source_files_properties(${c_sources} PROPERTIES + COMPILE_FLAGS "${WARNCFLAGS}") +file(GLOB cxx_sources *.cc) +set_source_files_properties(${cxx_sources} PROPERTIES + COMPILE_FLAGS "${WARNCXXFLAGS} ${CXX1XCXXFLAGS}") include_directories( "${CMAKE_SOURCE_DIR}/lib/includes" @@ -246,7 +245,6 @@ if(ENABLE_ASIO_LIB) ${OPENSSL_LIBRARIES} ${Boost_LIBRARIES} ) - # XXX use add_compile_options with a list instead of COMPILE_FLAGS set_target_properties(nghttp2_asio PROPERTIES VERSION 1.0.0 SOVERSION 1) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 8ce64154..4250ac3a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,6 +1,5 @@ # XXX testdata/: EXTRA_DIST = cacert.pem index.html privkey.pem if(HAVE_CUNIT) - # XXX replace this by lists (WARNCFLAGS_list) string(REPLACE " " ";" c_flags "${WARNCFLAGS}") add_compile_options(${c_flags})