Only pass C++ flags to C++ files. (#5115)

This commit is contained in:
arcum42 2021-12-08 21:10:21 -08:00 committed by GitHub
parent 6eee4cb38a
commit 017c37f212
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -215,7 +215,10 @@ option(USE_PGO_OPTIMIZE "Enable PGO optimization (use profile)")
if(MSVC)
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:/Zc:externConstexpr>")
else()
add_compile_options(-pipe -fvisibility=hidden -pthread -fno-builtin-strcmp -fno-builtin-memcmp -mfpmath=sse -fno-operator-names)
add_compile_options(-pipe -fvisibility=hidden -pthread -fno-builtin-strcmp -fno-builtin-memcmp -mfpmath=sse)
# -fno-operator-names should only be for C++ files, not C files.
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fno-operator-names>)
endif()
if(WIN32)