Skip to content

Commit dafda54

Browse files
committed
Fix compiler detection and flags
- Use CMAKE_<LANG>_COMPILER_ID to detect compiler as CMake docs suggest - Support clang properly - Don't set -Werror
1 parent d04d618 commit dafda54

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -843,10 +843,10 @@ endif()
843843

844844
# Stratagus needs to have char by default signed
845845
# No idea how to tell this to other compilers
846-
if(CMAKE_COMPILER_IS_GNUCXX)
847-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsigned-char -Werror")
846+
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
847+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsigned-char")
848848
endif()
849-
if(CMAKE_COMPILER_IS_GNUC)
849+
if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
850850
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsigned-char")
851851
endif()
852852
if(WIN32 AND MSVC)

0 commit comments

Comments
 (0)