Skip to content

Commit

Permalink
Fix compiler detection and flags
Browse files Browse the repository at this point in the history
- Use CMAKE_<LANG>_COMPILER_ID to detect compiler as CMake docs suggest
- Support clang properly
- Don't set -Werror
  • Loading branch information
AMDmi3 committed Dec 20, 2021
1 parent d04d618 commit dafda54
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Expand Up @@ -843,10 +843,10 @@ endif()

# Stratagus needs to have char by default signed
# No idea how to tell this to other compilers
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsigned-char -Werror")
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsigned-char")
endif()
if(CMAKE_COMPILER_IS_GNUC)
if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsigned-char")
endif()
if(WIN32 AND MSVC)
Expand Down

0 comments on commit dafda54

Please sign in to comment.