Skip to content

Commit

Permalink
Use -W* only for GNU and Clang compilers.
Browse files Browse the repository at this point in the history
Fixes #17.
  • Loading branch information
marxin committed Apr 29, 2020
1 parent 99a7004 commit 44cd630
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
endif()
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELEASE} -O3")
endif()

set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Werror")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Werror")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Werror")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Werror")
endif()

###############################################################################

Expand Down
3 changes: 3 additions & 0 deletions clex/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,11 @@ add_executable(strlex
driver.c
)

if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set_source_files_properties(clex.c PROPERTIES COMPILE_FLAGS -Wno-unused-function)
set_source_files_properties(strlex.c PROPERTIES COMPILE_FLAGS -Wno-unused-function)
endif()

###############################################################################

Expand Down

0 comments on commit 44cd630

Please sign in to comment.