Skip to content

Commit

Permalink
Codefix: Silence clang-cl warnings (OpenTTD#13066)
Browse files Browse the repository at this point in the history
* Codefix ad5da0c: clang-cl doesn't need /Zc:preprocessor

* Codefix: use -Wno-multichar with clang-cl
  • Loading branch information
glx22 authored Nov 8, 2024
1 parent 80f6280 commit e5edfba
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cmake/CompileFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ macro(compile_flags)
# C++11 standard". We need C++11 for the way we use threads.
add_compile_options(/Zc:rvalueCast)

# Needed for __VA_OPT__() in macros.
add_compile_options(/Zc:preprocessor)

if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options(
/Zc:preprocessor # Needed for __VA_OPT__() in macros.
/MP # Enable multi-threaded compilation.
/FC # Display the full path of source code files passed to the compiler in diagnostics.
)
Expand Down Expand Up @@ -58,6 +56,11 @@ macro(compile_flags)
# This flag disables the broken optimisation to work around the bug
add_compile_options(/d2ssa-rse-)
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options(
-Wno-multichar
)
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
add_compile_options(
-W
Expand Down

0 comments on commit e5edfba

Please sign in to comment.