From c60f790793d42398f94634d0f1a11ddef7609b05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= Date: Mon, 10 Jun 2019 10:54:49 +0200 Subject: Do not impose -Wextra -Wconversion etc on library users I had to nuke the flags targetting spdlog_header_only because in CMake, an interface target apparently really only supports the INTERFACE option. As I am only targeting Linux, the MSVC changes rely on spdlog's CI and manual code review. That said, it makes sense to also stop forcing these options on third party code, assuming that the CMake installations work the same on Windows. Fixes #1104 --- CMakeLists.txt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index f99bfc83..dcc54309 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,12 +80,10 @@ target_link_libraries(spdlog_header_only INTERFACE Threads::Threads) #--------------------------------------------------------------------------------------- if(SPDLOG_MASTER_PROJECT) if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang") - target_compile_options( spdlog PUBLIC -Wall -Wextra -Wconversion -pedantic -Wfatal-errors) - target_compile_options( spdlog_header_only INTERFACE -Wall -Wextra -Wconversion -pedantic -Wfatal-errors) + target_compile_options( spdlog PRIVATE -Wall -Wextra -Wconversion -pedantic -Wfatal-errors) endif() if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - target_compile_options( spdlog PUBLIC /W3 /WX ) - target_compile_options( spdlog_header_only INTERFACE /W3 /WX) + target_compile_options( spdlog PRIVATE /W3 /WX ) endif() include(cmake/sanitizers.cmake) @@ -162,4 +160,4 @@ if (SPDLOG_INSTALL) #--------------------------------------------------------------------------------------- include(cmake/spdlogCPack.cmake) -endif () \ No newline at end of file +endif () -- cgit v1.2.3