diff options
author | sfan5 <sfan5@live.de> | 2020-03-05 20:33:47 +0100 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2020-03-05 22:05:18 +0100 |
commit | db95ff22865e8aa5eb512a1ac1f2f8715c18e3c8 (patch) | |
tree | d5753e12f17d1042b5866feba3cd9659a41a10fc /src | |
parent | e774d8ca2fa5ead9f6d739a2031e6655a22a5b4d (diff) | |
download | minetest-db95ff22865e8aa5eb512a1ac1f2f8715c18e3c8.tar.gz minetest-db95ff22865e8aa5eb512a1ac1f2f8715c18e3c8.tar.bz2 minetest-db95ff22865e8aa5eb512a1ac1f2f8715c18e3c8.zip |
Fix linking failures when compiled with Clang 9
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index db8645c64..6afa5b8fe 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -696,7 +696,7 @@ else() set(RELEASE_WARNING_FLAGS "") endif() - if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") set(WARNING_FLAGS "${WARNING_FLAGS} -Wsign-compare") endif() if(APPLE AND USE_LUAJIT) @@ -713,7 +713,14 @@ else() if(CMAKE_SYSTEM_NAME MATCHES "(Darwin|BSD|DragonFly)") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Os") else() - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -ffast-math -fomit-frame-pointer") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -fomit-frame-pointer") + if(CMAKE_SYSTEM_NAME STREQUAL "Linux" + AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang" + AND CMAKE_CXX_COMPILER_VERSION MATCHES "^9\\.") + # Clang 9 has broken -ffast-math on glibc + else() + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffast-math") + endif() endif(CMAKE_SYSTEM_NAME MATCHES "(Darwin|BSD|DragonFly)") set(CMAKE_CXX_FLAGS_SEMIDEBUG "-g -O1 -Wall -Wabi ${WARNING_FLAGS} ${OTHER_FLAGS}") set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -Wabi ${WARNING_FLAGS} ${OTHER_FLAGS}") |