From 5297136bc0fb37bba3bba6128511e3252936359b Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Fri, 12 Feb 2016 14:27:38 +0100 Subject: [PATCH] cmake: use PRIVATE instead of PUBLIC Avoids leaking compile flags to dependents. --- CMakeLists.txt | 1 + src/CMakeLists.txt | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 05c8c07c..d1857f1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,7 @@ HexVersion(PACKAGE_VERSION_NUM ${PROJECT_VERSION_MAJOR} ${PROJECT_VERSION_MINOR} include(GNUInstallDirs) +# XXX "check" is treated as "OFF" now, consider detecting it first option(ENABLE_WERROR "Turn on compile time warnings") option(ENABLE_DEBUG "Turn on debug output") option(ENABLE_THREADS "Turn on threading in apps" ON) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a762b4e3..1c22321e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -130,7 +130,7 @@ if(ENABLE_APP) ) if(HAVE_MRUBY) - target_include_directories(nghttpx PUBLIC + target_include_directories(nghttpx PRIVATE "${CMAKE_SOURCE_DIR}/third-party/mruby/include" # ${LIBMRUBY_CFLAGS} ) @@ -142,7 +142,7 @@ if(ENABLE_APP) endif() if(HAVE_NEVERBLEED) - target_include_directories(nghttpx PUBLIC + target_include_directories(nghttpx PRIVATE "${CMAKE_SOURCE_DIR}/third-party/neverbleed" ) target_link_libraries(nghttpx @@ -189,7 +189,7 @@ if(ENABLE_APP) add_executable(nghttp ${NGHTTP_SOURCES} $) add_executable(nghttpd ${NGHTTPD_SOURCES} $) add_executable(nghttpx-bin ${NGHTTPX-bin_SOURCES} $) - target_compile_definitions(nghttpx-bin PUBLIC "-DPKGDATADIR=\"${PKGDATADIR}\"") + target_compile_definitions(nghttpx-bin PRIVATE "-DPKGDATADIR=\"${PKGDATADIR}\"") set_target_properties(nghttpx-bin PROPERTIES OUTPUT_NAME nghttpx) target_link_libraries(nghttpx-bin nghttpx) add_executable(h2load ${H2LOAD_SOURCES} $) @@ -248,7 +248,7 @@ if(ENABLE_ASIO_LIB) ${NGHTTP2_ASIO_SOURCES} $ ) - target_include_directories(nghttp2_asio PUBLIC + target_include_directories(nghttp2_asio PRIVATE ${OPENSSL_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} )