summaryrefslogtreecommitdiffstats
path: root/SetFlags.cmake
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-03-07 18:32:04 +0100
committerMattes D <github@xoft.cz>2014-03-07 18:32:04 +0100
commit51c1849762ef3bbf29311cc59203e73619cac889 (patch)
tree4684b620bedc8d88c7adc45e66132db9c1be574f /SetFlags.cmake
parentMerge pull request #763 from Howaner/BlockEntitys (diff)
parentFixed clang compile (diff)
downloadcuberite-51c1849762ef3bbf29311cc59203e73619cac889.tar
cuberite-51c1849762ef3bbf29311cc59203e73619cac889.tar.gz
cuberite-51c1849762ef3bbf29311cc59203e73619cac889.tar.bz2
cuberite-51c1849762ef3bbf29311cc59203e73619cac889.tar.lz
cuberite-51c1849762ef3bbf29311cc59203e73619cac889.tar.xz
cuberite-51c1849762ef3bbf29311cc59203e73619cac889.tar.zst
cuberite-51c1849762ef3bbf29311cc59203e73619cac889.zip
Diffstat (limited to 'SetFlags.cmake')
-rw-r--r--SetFlags.cmake11
1 files changed, 9 insertions, 2 deletions
diff --git a/SetFlags.cmake b/SetFlags.cmake
index ded57e6d7..6a8211fa2 100644
--- a/SetFlags.cmake
+++ b/SetFlags.cmake
@@ -1,5 +1,3 @@
-
-
macro (add_flags_lnk FLAGS)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${FLAGS}")
@@ -62,6 +60,7 @@ macro(set_flags)
# We use a signed char (fixes #640 on RasPi)
add_flags_cxx("-fsigned-char")
+
endif()
@@ -184,6 +183,14 @@ macro(set_exe_flags)
string(REPLACE "-w" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
string(REPLACE "-w" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
add_flags_cxx("-Wall -Wextra")
+
+ # we support non-IEEE 754 fpus so can make no guarentees about error
+ add_flags_cxx("-ffast-math")
+
+ # clang does not provide the __extern_always_inline macro and a part of libm depends on this when using fast-math
+ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ add_flags_cxx("-D__extern_always_inline=inline")
+ endif()
endif()
endmacro()