Changeset View
Standalone View
build_files/cmake/platform/platform_apple.cmake
| Show First 20 Lines • Show All 422 Lines • ▼ Show 20 Lines | if(EXISTS ${LIBDIR}) | ||||
| without_system_libs_end() | without_system_libs_end() | ||||
| endif() | endif() | ||||
| # --------------------------------------------------------------------- | # --------------------------------------------------------------------- | ||||
| # Set compiler and linker flags. | # Set compiler and linker flags. | ||||
| set(EXETYPE MACOSX_BUNDLE) | set(EXETYPE MACOSX_BUNDLE) | ||||
| string(APPEND PLATFORM_CFLAGS " -ffile-prefix-map=\"${CMAKE_SOURCE_DIR}/\"=\"\"") | |||||
campbellbarton: Should add `if(CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_COMPILER_IS_GNUCC)` here too. | |||||
ankitmAuthorUnsubmitted Done Inline ActionsWe don't really expect any other compiler on macOS. The GCC shipped with Xcode is just an alias to. clang. ankitm: We don't really expect any other compiler on macOS. The GCC shipped with Xcode is just an alias… | |||||
| string(APPEND PLATFORM_CFLAGS " -ffile-prefix-map=\"${CMAKE_BINARY_DIR}/\"=\"\"") | |||||
| if(XCODE AND ${XCODE_VERSION} VERSION_LESS 11.0) | |||||
| message_first_run(WARNING "Some actions under Product menu like assembling or preprocessing" | |||||
| " individual files may not work due to -ffile-prefix-map.") | |||||
| endif() | |||||
campbellbartonUnsubmitted Done Inline ActionsWhile I don't use macOS, this seems like the kind of thing that could trip developers up, wasting time only to find they missed this message. Maybe this shouldn't be used at all for older versions since it doesn't work properly. campbellbarton: While I don't use macOS, this seems like the kind of thing that could trip developers up… | |||||
ankitmAuthorUnsubmitted Done Inline ActionsI am being a bit selfish here. I have Xcode 10.2 which is shipped with AppleClang 10.1 which doesn't support this flag. But I compiled LLVM toolchain with clang 12 and made some changes to have Xcode use clang 12. I'll make changes to not add those flags on (< Xcode 11) and make some changes locally to my initial cache file to add those complier flags. ankitm: I am being a bit selfish here. I have Xcode 10.2 which is shipped with AppleClang 10.1 which… | |||||
| set(CMAKE_C_FLAGS_DEBUG "-g") | set(CMAKE_C_FLAGS_DEBUG "-g") | ||||
| set(CMAKE_CXX_FLAGS_DEBUG "-g") | set(CMAKE_CXX_FLAGS_DEBUG "-g") | ||||
| if(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES "i386") | if(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES "i386") | ||||
| set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic -msse -msse2 -msse3 -mssse3") | set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic -msse -msse2 -msse3 -mssse3") | ||||
| set(CMAKE_C_FLAGS_RELEASE "-O2 -mdynamic-no-pic -msse -msse2 -msse3 -mssse3") | set(CMAKE_C_FLAGS_RELEASE "-O2 -mdynamic-no-pic -msse -msse2 -msse3 -mssse3") | ||||
| if(NOT CMAKE_C_COMPILER_ID MATCHES "Clang") | if(NOT CMAKE_C_COMPILER_ID MATCHES "Clang") | ||||
| set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ftree-vectorize -fvariable-expansion-in-unroller") | set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ftree-vectorize -fvariable-expansion-in-unroller") | ||||
| set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ftree-vectorize -fvariable-expansion-in-unroller") | set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ftree-vectorize -fvariable-expansion-in-unroller") | ||||
| Show All 25 Lines | |||||
Should add if(CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_COMPILER_IS_GNUCC) here too.