Skip to content

Commit

Permalink
Don't force CMAKE_CXX_FLAGS changes when not top-level
Browse files Browse the repository at this point in the history
  • Loading branch information
jagerman committed Sep 9, 2024
1 parent 3cb2eae commit a1f1a82
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,7 @@ if(CPR_BUILD_TESTS)
restore_variable(DESTINATION CMAKE_CXX_CLANG_TIDY BACKUP CMAKE_CXX_CLANG_TIDY_BKP)
endif()

if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
else()
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Werror")
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# Disable C++98 compatibility support in clang: https://github.com/libcpr/cpr/issues/927
Expand Down

0 comments on commit a1f1a82

Please sign in to comment.