summaryrefslogtreecommitdiffstats
path: root/Modules/Platform
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'ios-rpath-linker-flag' into release-3.20Brad King2021-04-071-5/+1
|\ | | | | | | | | | | | | 4aed96e230 Apple: Set CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG on non-macOS too Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5980
| * Apple: Set CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG on non-macOS tooCraig Scott2021-04-061-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since CMake 3.19, we no longer support macOS SDKs older than 10.5, which corresponds to Xcode 3. Supporting older Xcode versions for device platforms is also not realistic. We therefore expect the -rpath linker option should always be supported now. When targeting iOS, tvOS or watchOS, the previous disabling of -rpath support meant that the install_name_dir of shared libraries and frameworks was unable to use @rpath. This resulted in embedding absolute paths for their install_name. When they were embedded in an app bundle, this would cause the app to fail at runtime. By enabling the -rpath linker option, the default install_name_dir is now @rpath for these platforms, which results in binaries that do work at runtime. Fixes: #20036
* | Merge topic 'nvhpc-lib-arch' into release-3.20Brad King2021-04-061-1/+0
|\ \ | |/ |/| | | | | | | | | | | 764606e256 CMakeDetermineCompilerABI: Extract lib arch from implicit object file paths 5d44d73bbe CMakeDetermineCompilerABI: Revert "Parse library arch from versioned paths" Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5984
| * CMakeDetermineCompilerABI: Revert "Parse library arch from versioned paths"Robert Maynard2021-04-051-1/+0
| | | | | | | | | | | | | | | | | | | | The change in commit 657fc3a9a7 (CMakeDetermineCompilerABI: Parse library arch from versioned paths, 2021-02-03, v3.20.0-rc1~40^2) caused `CMAKE_LIBRARY_ARCHITECTURE` to be populated on non-multiarch platforms if their compilers happen to use `$arch/$version` library directories. Revert the use of versioned library paths. Fixes: #22024
* | Android: Fix search for binutilsHaibo Huang2021-03-302-50/+50
|/ | | | | | | | Set `CMAKE_SYSTEM_PROGRAM_PATH` in `Platform/Android-Initialize` instead of `Platform/Android` so it can be used in `CMakeFindBinUtils`. Also add the names `llvm-strip` and `llvm-ranlib` for the corresponding tools.
* Android: Detect NDK version numberHaibo Huang2021-03-031-0/+39
| | | | Report it in `CMAKE_ANDROID_NDK_VERSION`.
* Merge topic 'clang-imsvc'Brad King2021-02-101-0/+1
|\ | | | | | | | | | | | | | | 2fc5e5dba9 Clang: Use -imsvc for system include only with MSVC-like front-end Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Thomas Bernard <thomas@famillebernardgouriou.fr> Merge-request: !5792
| * Clang: Use -imsvc for system include only with MSVC-like front-endBrad King2021-02-091-0/+1
| | | | | | | | | | | | | | | | | | | | In commit bb61c2d024 (Clang: use -imsvc for system include dirs when running on Windows, 2020-09-16, v3.19.0-rc1~162^2) we added `-imsvc` for all Clang compilers targeting the MSVC ABI. However, the option only exists for the MSVC-like front-end. The GNU-like front-ends use `-isystem`. Fixes: #21789
* | CMakeDetermineCompilerABI: Parse library arch from versioned pathsRobert Maynard2021-02-041-0/+1
| | | | | | | | | | | | Teach CMake how to extract `CMAKE_<LANG>_LIBRARY_ARCHITECTURE` from versioned paths such as `/usr/lib/gcc/x86_64-linux-gnu/9`. These kind of paths are generated by NVHPC compilers.
* | IntelLLVM: Add support for Intel LLVM-based compilersWilliam R. Dieter2021-01-2813-0/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using a single ID 'IntelLLVM' for the suite of Intel compilers based on the LLVM backend. The 'IntelLLVM' ID are used for C, C++, and Fortran. Data Parallel C++ will be handled in a separate commit. The C and C++ definitions are based on the Clang definitions. The Intel LLVM-based C and C++ compilers are based on the Clang front end, so existing Clang options are more likely to be a good match than options for the older Intel compilers. Fortran is based on the older Fortran front end with the LLVM backend. It has a similar interface to the older versions, though many options are shared with the C and C++ compilers. Fixes: #21561 Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
* | NVHPC: Add support for NVIDIA HPC SDK compilers based on PGITin Huynh2021-01-274-0/+21
| | | | | | | | | | | | | | Identify the compilers as `NVHPC` to distinguish it from the older PGI compilers from which they evolved, and from other `NVIDIA` compilers. Fixes: #20887
* | Merge topic 'intel-fortran-nofor-main'Brad King2021-01-251-1/+1
|\ \ | |/ | | | | | | | | | | 2a5955ac09 Intel: Replace deprecated Fortran flag -nofor_main with -nofor-main Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5729
| * Intel: Replace deprecated Fortran flag -nofor_main with -nofor-mainBrad King2021-01-221-1/+1
| | | | | | | | | | | | | | | | | | | | The `-nofor_main` flag was originally added by commit ccdd3e943d (Fix Intel Fortran SHARED libraries on Linux, 2009-10-27, v2.8.2~915). Since then, Intel Fortran renamed the option to `-nofor-main` and deprecated the old name. The new name has been available for a long time, so we can just switch to it. Fixes: #21735
* | Merge topic 'msvc-arm64ec-platform-support'Brad King2021-01-221-3/+15
|\ \ | | | | | | | | | | | | | | | | | | 4ea3a88625 MSVC: Add support for targeting ARM64EC Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5708
| * | MSVC: Add support for targeting ARM64ECMoyo Okeremi 😊2021-01-211-3/+15
| | |
* | | Clang: Support WIN32_EXECUTABLERaul Tambre2020-12-231-0/+3
|/ / | | | | | | Fixes #21613.
* | Merge topic 'macos-homebrew-apple-silicon'Brad King2020-12-141-0/+7
|\ \ | |/ | | | | | | | | | | | | 1a5c1a68b6 macOS: Add /opt/homebrew to CMAKE_SYSTEM_PREFIX_PATH on Apple Silicon Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Fons Rademakers <fons.rademakers@cern.ch> Merge-request: !5602
| * macOS: Add /opt/homebrew to CMAKE_SYSTEM_PREFIX_PATH on Apple SiliconBrad King2020-12-111-0/+7
| | | | | | | | | | | | | | According to https://brew.sh/2020/12/01/homebrew-2.6.0/ the `/opt/homebrew` directory is recommended for installing ARM architecture brew packages. Fixes: #21585
* | Merge topic 'apple-silicon-host-arch'Brad King2020-12-111-4/+13
|\ \ | |/ | | | | | | | | | | | | b7f0327dcd Tests: Cover macOS host architecture selection on Apple Silicon hosts 5f882f6ce5 macOS: Offer control over host architecture on Apple Silicon hosts Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5589
| * macOS: Offer control over host architecture on Apple Silicon hostsBrad King2020-12-101-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit b6c60f14b6 (macOS: Default to arm64 architecture on Apple Silicon hosts, 2020-09-28, v3.19.0-rc1~63^2) we use `sysctl` to detect that we are running on Apple Silicon in a way that pierces Rosetta. This always sets `CMAKE_HOST_SYSTEM_PROCESSOR` to be `arm64` on such hosts. However, macOS offers strong support for running processes under an emulated `x86_64` architecture. Teach CMake to select either `arm64` or `x86_64` as the host architecture on Apple Silicon based on the architecture of its own process. When CMake is built as a universal binary, macOS will select whichever slice (architecture) is appropriate under the user's shell, and `CMAKE_HOST_SYSTEM_PROCESSOR` will match. Also offer a `CMAKE_APPLE_SILICON_PROCESSOR` variable and environment variable to provide users with explicit control over the host architecture selection regardless of CMake's own architecture. Finally, if `CMAKE_OSX_ARCHITECTURES` is not set, pass explicit flags to the toolchain to use selected host architecture instead of letting the toolchain pick. Fixes: #21554
* | Merge topic 'explicit-LANGUAGE-flag'Brad King2020-12-041-4/+4
|\ \ | | | | | | | | | | | | | | | | | | | | | 48aac247e9 Compile with explicit language flag when source LANGUAGE property is set 2e67a75acd Embarcadero: Simplify addition of -P flag for C++ Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5522
| * | Embarcadero: Simplify addition of -P flag for C++Brad King2020-12-021-4/+4
| | |
* | | Merge topic 'llvm-rc-preprocess-as-c'Brad King2020-12-031-5/+5
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | bdfa5ac7f6 Merge branch 'master' into llvm-rc-preprocess-as-c f7ff0d34f0 llvm-rc: Force C language for the clang gnu frontend Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5564
| * \ \ Merge branch 'master' into llvm-rc-preprocess-as-cBrad King2020-12-0222-94/+323
| |\ \ \ | | |_|/ | |/| |
| * | | llvm-rc: Force C language for the clang gnu frontendThomas Bernard2020-12-021-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When preprocessing the rc file using the clang gnu front end we need to force the source file type to a c file for the preprocessing to take place. Fixes: #21472
* | | | Merge topic 'ninja-deps-updates'Brad King2020-12-024-7/+52
|\ \ \ \ | |_|/ / |/| | | | | | | | | | | | | | | | | | | f8d8faff8d Ninja Generators: Homogenize configuration with Makefiles Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5557
| * | | Ninja Generators: Homogenize configuration with MakefilesMarc Chevrier2020-12-014-7/+52
| | |/ | |/| | | | | | | | | | * Use same configuration variables to configure dependencies * Abstract Ninja deps format from compiler one
* | | Merge topic 'windows-clang-LINKER-prefix'Brad King2020-12-011-0/+3
|\ \ \ | |/ / |/| / | |/ | | | | | | 9ac9876757 Clang on Windows: 'LINKER:' prefix must be honored Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5551
| * Clang on Windows: 'LINKER:' prefix must be honoredMarc Chevrier2020-11-301-0/+3
| | | | | | | | Fixes: #21094
* | Makefiles Generators: use compiler for dependencies generationMarc Chevrier2020-11-297-0/+67
| | | | | | | | | | | | | | | | | | | | | | Each source compilation generates a dependencies file. These dependencies files are consolidated in one file per target. This consolidation is done as part of command 'cmake -E cmake_depends` launched before evaluation of makefile dependency graph. The consolidation uses the same approach as `CMake` dependencies management. Fixes: #21321
* | Refactoring: Introduce place-holder for dependency target.Marc Chevrier2020-11-283-4/+4
| | | | | | | | | | | | | | | | These changes are in preparation of compiler generated dependencies support for Makefiles generators * compiler output and dependency target can be different for Makefiles generators * resolve inconsistency naming for dependency file place-holder
* | MSVC: Do not add /GR to CMAKE_CXX_FLAGS by defaultBrad King2020-11-131-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | The `/GR` flag has been on by default since MSVC cl 14.0 from VS 2005. Remove it from the default flags to make it easier for projects to pass `/GR-` themselves to turn it off. Projects may be using string processing to replace `/GR` with another flag, so we cannot simply drop it. Add a policy to drop it in a compatible way. Fixes: #21428
* | MSVC: Factor out initialization of /GR flagBrad King2020-11-131-4/+8
| |
* | Android: load ABI information from abis.cmakeHaibo Huang2020-11-121-61/+76
| | | | | | | | | | They are added to NDK and planned to release in r23: https://android-review.googlesource.com/c/platform/ndk/+/1493421
* | Merge topic 'android-abi'Brad King2020-11-111-4/+13
|\ \ | |/ | | | | | | | | | | a585b75df9 Android: Use NDK_KNOWN_DEVICE_ABI{32,64}S instead of NDK_DEFAULT_ABIS Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5488
| * Android: Use NDK_KNOWN_DEVICE_ABI{32,64}S instead of NDK_DEFAULT_ABISHaibo Huang2020-11-101-4/+13
| | | | | | | | | | | | | | | | | | | | Revise logic from commit 1ab574a0f4 (Android: Add support for NDK r22, 2020-10-07, v3.19.0-rc1~18^2) that loads ABI tables from the NDK. `NDK_DEFAULT_ABIS` means the abis to build by default. Use `NDK_KNOWN_DEVICE_ABI{32,64}S` instead. In practise they have never been different. Fix to make it more precise.
* | Merge topic 'android-root'Brad King2020-11-101-32/+14
|\ \ | | | | | | | | | | | | | | | | | | | | | cbc51a8be3 Android: restructure android search paths Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: huangqinjin <huangqinjin@gmail.com> Merge-request: !5479
| * | Android: restructure android search pathsHaibo Huang2020-11-091-32/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Set CMAKE_FIND_ROOT_PATH unconditionally. Revise the implementation from commit a7f41a7ee4 (Android: Fix find_* search order within NDK for unified toolchains, 2020-10-13). In the old implementation, if people set CMAKE_FIND_ROOT_PATH, CMAKE_ANDROID_NDK won't be added to find root. And all paths added to CMAKE_SYSTEM_*_PATH below will be rerooted to the user specified root. 2. Add api level specific library path to CMAKE_SYSTEM_PREFIX_PATH. As the discussion in [1], some people want the paths added by UnixPaths.cmake. They install their libraries according to GNUInstallDirs [2]. As a result, we cannot clear CMAKE_SYSTEM_PREFIX_PATH. It includes /usr so no matter what we specify in CMAKE_SYSTEM_LIBRARY_PATH, /usr/lib/<arch> will be searched first. The author also pointed out a way to solve this issue [3]. In addition to other paths, CMake also searches <root>/<prefix> [4]. So we can add the API specific lib path to the beginning of CMAKE_SYSTEM_PREFIX_PATH, to have it searched first. [1] https://android-review.googlesource.com/c/platform/ndk/+/1486800 [2] https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html [3] https://github.com/android/ndk/issues/1179#issuecomment-613435081 [4] https://gitlab.kitware.com/cmake/cmake/-/blob/11425041f04fd0945480b8f9e9933d1549b93981/Source/cmSearchPath.cxx#L202
* | | Merge topic 'android-flags'Brad King2020-11-0910-56/+63
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | 94d87afece Android: allow NDK to control cflags / ldflags 85e5139aba Android: Move *_LLVM_TRIPLE to the centralized table Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5461
| * | Android: allow NDK to control cflags / ldflagsHaibo Huang2020-11-061-7/+27
| | |
| * | Android: Move *_LLVM_TRIPLE to the centralized tableHaibo Huang2020-11-0610-49/+36
| | | | | | | | | | | | | | | This allows us to skip `abi-*.cmake` in the next change. In the future we may move all this information to the NDK.
* | | Merge topic 'android-build-type'Brad King2020-11-061-1/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 3dae826e43 Android: default to RelWithDebInfo Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5465
| * | | Android: default to RelWithDebInfoHaibo Huang2020-11-041-1/+1
| |/ /
* | | Merge topic 'apple-v4-tbd-file-arch-lookup'Brad King2020-11-061-3/+9
|\ \ \ | | |/ | |/| | | | | | | | | | | | | 4c6797e03e Apple: Update SDK architecture detection for tbd file version 4 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5470
| * | Apple: Update SDK architecture detection for tbd file version 4Tor Arne Vestbø2020-11-051-3/+9
| | | | | | | | | | | | | | | | | | Extend the `.tbd` parsing from commit 170e598add (iOS: Fix detection of supported SDK architectures, 2020-04-16, v3.17.2~11^2) to support `.tbd` file version 4.
* | | Android: Link c++abi and android_support when necessaryHaibo Huang2020-11-041-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | For older NDKs we used `__android_stl_lib` to link these libraries, but the `CMAKE_ANDROID_NDK_TOOLCHAIN_UNIFIED` code path does not use that. Link the libraries the way the NDK toolchain file does: https://android.googlesource.com/platform/ndk/+/43b2de34ef9e3a70573fe51a9e069f985a4be5b9/build/cmake/android.toolchain.cmake#368
* | | Android: Add options to control exceptions/rttiHaibo Huang2020-11-041-0/+6
| |/ |/| | | | | | | | | | | | | | | With the NDK's `android.toolchain.cmake`, the user can control whether exceptions/rtti is enabled using `ANDROID_CPP_FEATURES`: https://android.googlesource.com/platform/ndk/+/43b2de34ef9e3a70573fe51a9e069f985a4be5b9/build/cmake/android.toolchain.cmake#548 Add `CMAKE_ANDROID_RTTI` and `CMAKE_ANDROID_EXCEPTIONS` to support that.
* | Android: add NDK hooksHaibo Huang2020-10-305-0/+60
| | | | | | | | | | This change adds hooks to key Android support files, so that NDK can inject information or change cmake behaviors.
* | llvm_rc: add llvm_rc option filter to correctly pick up all optionsThomas Bernard2020-10-281-1/+3
| | | | | | | | Fixes: #21315
* | Android: Fix find_* search order within NDK for unified toolchainsHaibo Huang2020-10-231-0/+36
| |