Skip to content

Commit 0fa60bb

Browse files
authored
fixing CFLAGS for AppleClang (#932)
1 parent 59e524f commit 0fa60bb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
108108
set(REL_FLAGS "-s -Wl,--gc-sections -Os ${WARN_FLAGS} -ffunction-sections -fdata-sections -fmerge-all-constants -ffast-math")
109109
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
110110
set(REL_FLAGS "${WARN_FLAGS}")
111+
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
112+
# AppleClang does not support -ffunction-sections and -fdata-sections with the -fembed-bitcode and -fembed-bitcode-marker
113+
set(REL_FLAGS "-Os ${WARN_FLAGS} -fmerge-all-constants -ffast-math")
111114
else()
112115
# Using clang - strip unsupported GCC options
113116
set(REL_FLAGS "-Os ${WARN_FLAGS} -ffunction-sections -fmerge-all-constants -ffast-math")

0 commit comments

Comments
 (0)