summaryrefslogtreecommitdiffstats
path: root/Modules/Platform
Commit message (Collapse)AuthorAgeFilesLines
* 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
| |
* | Android: Root searches within the NDK for unified toolchainsHaibo Huang2020-10-231-0/+38
|/ | | | Set `CMAKE_FIND_ROOT_PATH_MODE_*` appropriately.
* Android: show supported API level in error messageHaibo Huang2020-10-131-1/+2
|
* Android: Fatal if ABI is not supported by NDKHaibo Huang2020-10-091-0/+6
|
* Android: Add support for NDK r22Haibo Huang2020-10-071-24/+64
| | | | | NDK r22 removed platforms and sysroot directory. NDK r18+ provides `.cmake` files with tables of platforms and abis.
* Android: Drop redundant setting of CMP0057 in Android-DetermineHaibo Huang2020-10-071-3/+0
| | | | | | A module-wide setting was added by commit 8ede35523e (IN_LIST: Ensure policy allows if(IN_LIST) if used by a module, 2018-09-12, v3.13.0-rc1~95^2), so our local setting is no longer needed.
* Android: Select Android API after ABI is determinedHaibo Huang2020-10-071-60/+60
| | | | API level depends on ABI. E.g. for LP64 the minimum API level should be 21 instead of 16 for others.
* macOS: Default to arm64 architecture on Apple Silicon hostsBrad King2020-09-301-0/+11
| | | | | | | | Detect `arm64` hardware using a method that pierces Rosetta. If `CMAKE_OSX_ARCHITECTURES` is not set, pass explicit flags to the toolchain to use `arm64` instead of letting the toolchain pick. Fixes: #20989
* Clang: Implement CMAKE_${LANG}_COMPILER_TARGET for all variants on windowsThomas Bernard2020-09-112-8/+12
| | | | Fixes: #21097
* Merge topic 'ios-pch-x-lang-header'Brad King2020-09-092-2/+12
|\ | | | | | | | | | | | | 8d61294c3e PCH: Mark CMake PCH source files as -x <lang>-header Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5188
| * PCH: Mark CMake PCH source files as -x <lang>-headerCristian Adam2020-09-042-2/+12
| | | | | | | | Fixes: #21163
* | Merge topic 'ispc_lang_support'Brad King2020-09-011-0/+8
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5ece12b7e4 gitlab-ci: add ISPC to the Fedora CI image 8976817d6d ISPC: Update help documentation to include ISPC 2368f46ba4 ISPC: Support building with the MSVC toolchain e783bf8aa6 ISPC: Support ISPC header generation byproducts and parallel builds 34cc6acc81 Add ISPC compiler support to CMake 419d70d490 Refactor some swift only logic to be re-used by other languages Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5065
| * | ISPC: Support building with the MSVC toolchainRobert Maynard2020-08-281-0/+8
| | |
* | | llvm-rc: Enable preprocessing for all Windows usage variantsThomas Bernard2020-08-271-0/+2
| | | | | | | | | | | | Fixes: #21096
* | | llvm-rc: Refactor the preprocessing logicThomas Bernard2020-08-271-20/+27
| | |
* | | Merge topic 'clang-cl-restore-preprocess'Brad King2020-08-211-2/+2
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 7b083d59c2 clang-cl: Restore rules to create preprocessed and assembly output Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5142
| * | | clang-cl: Restore rules to create preprocessed and assembly outputBrad King2020-08-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | In commit d993ebd4ca (clang-cl: Add '--' before source file, 2020-07-28) we accidentally replaced these rules with those to compile an object file.
* | | | Merge branch 'backport-3.18-llvm-rc-quote-cmake' into llvm-rc-quote-cmakeBrad King2020-08-181-1/+1
|\ \ \ \ | |/ / / |/| | / | | |/ | |/|
| * | llvm-rc: Fix quoting of path to cmake in CMAKE_RC_COMPILE_OBJECTThomas Bernard2020-08-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | When the installation path to cmake includes spaces, the `<CMAKE_COMMAND>` is required to have proper quotation of the cmake call. Fixes: #21095
* | | clang-cl: Add '--' before source fileThomas Bernard2020-08-072-1/+9
| | | | | | | | | | | | | | | | | | | | | On Linux and macOS, absolute paths start with `/` which may be interpreted by clang-cl as an option. To avoid this, we separate the source file path from preceding options with `--` to tell `clang-cl` it is not an option.
* | | cmake: Change cmake_llvm_rc separator from -- to ++ to avoid conflictThomas Bernard2020-08-071-1/+1
| |/ |/|
* | Detect the correct target architecture for clang compilers.Thomas Bernard2020-07-281-0/+5
| | | | | | | | | | | | During compiler identification, if CMAKE_{C,CXX}_COMPILER_TARGET is defined, the corresponding clang target flag is used to guaranty proper target architecture detection.
* | Fix typos identified using codespellJean-Christophe Fillion-Robin2020-07-222-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See https://github.com/codespell-project/codespell#readme The following command was used: ``` codespell -q6 --skip="\ .git,\ *.json,\ ./Copyright.txt,\ ./Help/command/foreach.rst,\ ./Help/prop_test/REQUIRED_FILES.rst,\ ./Help/variable/CTEST_COVERAGE_COMMAND.rst,\ ./Modules/CMakeCheckCompilerFlagCommonPatterns.cmake,\ ./Modules/CMakeRCInformation.cmake,\ ./Modules/Internal/CPack/NSIS.template.in,\ ./Modules/FindMatlab.cmake,\ ./Modules/MatlabTestsRedirect.cmake,\ ./Modules/Platform/Windows-Clang.cmake,\ ./Modules/Platform/Windows-Intel-Fortran.cmake,\ ./Modules/Platform/Windows-MSVC.cmake,\ ./Source/CMakeVersion.cmake,\ ./Source/cmConvertMSBuildXMLToJSON.py,\ ./Source/cmCreateTestSourceList.cxx,\ ./Source/cmGlobalVisualStudio10Generator.cxx,\ ./Source/cmExportBuildFileGenerator.cxx,\ ./Source/cmExportInstallAndroidMKGenerator.cxx,\ ./Source/cmExportInstallFileGenerator.cxx,\ ./Source/cmExportSet.cxx,\ ./Source/cmExportTryCompileFileGenerator.cxx,\ ./Source/cmFindPackageCommand.cxx,\ ./Source/cmInstallCommand.cxx,\ ./Source/cmGeneratorExpressionLexer.cxx,\ ./Source/cmLocalVisualStudio7Generator.cxx,\ ./Source/cmOrderDirectories.cxx,\ ./Source/cmTarget.cxx,\ ./Source/kwsys/*,\ ./Source/QtDialog/CMakeSetupDialog.ui,\ ./Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx,\ ./Source/CTest/cmParseCoberturaCoverage.h,\ ./Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in,\ ./Tests/RunCMake/CPack/tests/DMG_SLA/English.license.rtf,\ ./Tests/RunCMake/CPack/tests/DMG_SLA/German.license.txt,\ ./Tests/RunCMake/CPack/tests/DMG_SLA/German.menu.txt,\ ./Tests/RunCMake/GoogleTest/xml_output.cpp,\ ./Tests/RunCMake/Make/TargetMessages*,\ ./Utilities/*,\ " \ -L "\ dependees,\ endwhile,\ fo,\ filetest,\ helpfull,\ nd,\ objext,\ stoll,\ supercedes,\ superceded,\ vas,\ varn,\ " ```
* | macOS: Always pick latest SDK if user has not set one explicitlyTor Arne Vestbø2020-07-141-21/+12
| | | | | | | | | | | | | | Apple tech note QA1806 recommends always building against the latest SDK. Fixes: #20949
* | Darwin: prefix internal osx variables with "_" to hide them from usersChuck Cranor2020-07-031-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | A simple CMakeLists.txt on osx shows that variable "d" is set (but empty) by the system modules. this pollutes the user's variable namespace. I noticed this when I created a library target "d" and got unexpected policy CMP0054 warnings when trying to find_package(d CONFIG REQUIRED) (triggered from the generated "d-targets.cmake" ...). Note that non-"_" prefixed internal variables are ok within functions due to scoping rules. Fixes: #20898
* | Visual Studio: Add Android supportKyle Edwards2020-06-244-3/+101
|/
* Darwin: honour `CMAKE_OSX_SYSROOT` more faithfullySaleem Abdulrasool2020-05-311-5/+21
| | | | | | | The libraries in the SDK should be given precedence over the system libraries. Check for the default library search path (in default order) of `/usr/lib` and `/usr/local/lib` and use these as system prefix paths for libraries when performing the link step against a specified SDK.
* Merge topic 'support_conda_env'Brad King2020-05-221-0/+4
|\ | | | | | | | | | | | | | | | | 50879ce412 Conda: Add CONDA_PREFIX as an acceptable system prefix path cd9c3c000f Tests: Update QtAutogen codeeditor test only include headers needed d806bd2e8c Tests: Update test suite to run in an Anaconda environment Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4773
| * Conda: Add CONDA_PREFIX as an acceptable system prefix pathRobert Maynard2020-05-211-0/+4
| |
* | Merge branch 'backport-cuda-default-runtime' into cuda-default-runtimeBrad King2020-05-221-1/+0
|\ \ | |/ |/|
| * CUDA: Compute CMAKE_CUDA_RUNTIME_LIBRARY default from toolchainRobert Maynard2020-05-211-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 0d0145138f (CUDA: Add abstraction for cuda runtime selection, 2019-11-29, v3.17.0-rc1~83^2) we add CUDA runtime library selection flags by default. To maintain backwards compatibility the default CUDA runtime library needs to be computed based on what libraries are found on the initial compiler invocation. For example a toolchain could establish initial flags that have all CUDA compilations using the runtime version, and if we don't detect this we will try to link to both the static and shared runtime. Co-Author: Brad King <brad.king@kitware.com> Fixes: #20708