diff options
author | Stefano Cristiano <pagghiu@gmail.com> | 2020-07-08 23:57:51 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-13 08:46:44 +0200 |
commit | a1e1aa96fbd404b440838dda179ec5c4e14f1013 (patch) | |
tree | 609ad097b4427c914b587f53453999b799d43a15 /CMakeLists.txt | |
parent | 617655db0d27254e57f7cbdfbb0b2e3328f06da7 (diff) | |
download | serenity-a1e1aa96fbd404b440838dda179ec5c4e14f1013.zip |
Toolchain: Allow building using CMake on macOS
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2238ca6e41..8301d495d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -126,6 +126,22 @@ set(CMAKE_RANLIB ${TOOLCHAIN_PREFIX}ranlib) set(CMAKE_STRIP ${TOOLCHAIN_PREFIX}strip) set(CMAKE_AR ${TOOLCHAIN_PREFIX}ar) +foreach(lang ASM C CXX OBJC OBJCXX) + unset(CMAKE_${lang}_OSX_COMPATIBILITY_VERSION_FLAG) + unset(CMAKE_${lang}_OSX_CURRENT_VERSION_FLAG) + unset(CMAKE_${lang}_LINK_FLAGS) + unset(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS) + unset(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS) + unset(CMAKE_SHARED_MODULE_LOADER_${lang}_FLAG ) + unset(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG) + unset(CMAKE_${lang}_SYSROOT_FLAG) + unset(CMAKE_SHARED_LIBRARY_SONAME_${lang}_FLAG) +endforeach() + +set(CMAKE_INSTALL_NAME_TOOL "true") +set(CMAKE_SHARED_LIBRARY_SUFFIX ".so") +set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-shared") + #FIXME: -fstack-protector set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Os -Wno-sized-deallocation -fno-sized-deallocation -fno-exceptions -fno-rtti -Wno-address-of-packed-member -Wundef -Wcast-qual -Wwrite-strings -Wimplicit-fallthrough -Wno-nonnull-compare -Wno-deprecated-copy -Wno-expansion-to-defined") |