Skip to content

Commit 6f4c423

Browse files
committed
[C++] Use idiomatic methods to set compile options.
1 parent 9ff7cf9 commit 6f4c423

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@ endif()
8181
find_package(Threads)
8282

8383
if(UNIX)
84-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wpedantic -Wextra -Wno-unused-parameter")
84+
add_compile_options(-g -Wall -Wpedantic -Wextra -Wno-unused-parameter)
8585
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0")
8686
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Ofast")
8787
endif()
8888

8989
if(APPLE)
9090
# -Wall doesn't enable everything we want to see
91-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsign-compare")
91+
add_compile_options(-Wsign-compare)
9292
add_definitions(-DDarwin)
9393
elseif(MSVC)
9494
add_definitions(-DWIN32)

0 commit comments

Comments
 (0)