summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSkyler Saleh <skylersaleh@gmail.com>2021-04-10 21:28:10 -0700
committerSkyler Saleh <skylersaleh@gmail.com>2021-04-10 21:28:10 -0700
commitb2d5eea20c60ea43bc37de3bfd3af0caa2ec14f3 (patch)
treec127e8cb536e22d0aa0e78e007442bef6378aa46
parent53222560650e4a99eceafcd537d4e04d1c50b3a6 (diff)
Build: Fix -fno-strict-aliasing on Xcode builds
Xcode is configured by default to turn on the strict aliasing optimization through a separate project setting. This would cause the compiler to be called with both -fno-strict-aliasing and -fstrict-aliasing. This change turns off that project setting causing only the -fno-strict-aliasing flag to be provided to the compiler.
-rw-r--r--CMakeLists.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index df97554d3e..dfccece1d5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -291,6 +291,9 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
list(APPEND CMAKE_PREFIX_PATH "/usr")
endif()
+ # Prevents Xcode from overriding the -fno-strict-aliasing flag
+ set(CMAKE_XCODE_ATTRIBUTE_GCC_STRICT_ALIASING NO)
+
# Specify target CPUs.
check_and_add_flag(HAVE_MSSSE3 -mssse3)
check_and_add_flag(HAVE_ARCH_CORE2 -march=core2)