summaryrefslogtreecommitdiffstats
path: root/Modules/Platform
Commit message (Collapse)AuthorAgeFilesLines
* IBMClang: Do not use -fvisibility on AIXBrad King2022-01-282-0/+2
| | | | | | | | | | | Use of `-fvisibility=hidden` fails: unsupported option '-fvisibility=hidden' for target 'powerpc-ibm-aix7.2.0.0' Apply the change from commit 4feba34d02 (GNU: Do not use -fvisibility on AIX or HP-UX, 2016-09-03, v3.7.0-rc1~173^2~2) to IBMClang also. Issue: #23157
* IBMClang: Add support for IBM Open XL C/C++Aaron Liu2022-01-273-0/+19
| | | | Fixes: #22929
* IntelLLVM: Set linker to compiler driver for WindowsWilliam R. Dieter2022-01-141-0/+13
| | | | | | | | | | | | | | For IntelLLVM, linking with the compiler driver is preferred over using the linker directly. This is especially true when doing offload to a target accelerator, which can produce object files that the regular linker will not handle properly. Windows-IntelLLVM relies on Windows-MSVC.cmake for many definitions. This commit does not change that, but does override the MSVC defaults for linking executables, shared libraries, and static libraries so that CMake will use the compiler driver instead of the linker. Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
* Merge topic 'cmcldeps-cross'Brad King2022-01-071-1/+1
|\ | | | | | | | | | | | | | | d49e168e1b Ninja: Do not use cmcldeps for RC on non-Windows hosts Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Dmitry Mikushin <dmitry@kernelgen.org> Merge-request: !6843
| * Ninja: Do not use cmcldeps for RC on non-Windows hostsMartin Storsjö2022-01-061-1/+1
| | | | | | | | | | | | | | | | The `cmcldeps` executable is only built on Windows. If running MSVC on a different OS (with various compatibility wrapping), don't try to use `cmcldeps`, as the executable doesn't exist. Fixes: #21760
* | MSVC: update arm64ec default flags and libmoyo19972022-01-061-1/+5
|/ | | | | | | | | | | | Update the support added by commit 4ea3a88625 (MSVC: Add support for targeting ARM64EC, 2020-12-30, v3.20.0-rc1~121^2). Add `softintrin.lib` to `CMAKE_C_STANDARD_LIBRARIES_INIT`. Remove `/D_ARM64EC_WORKAROUND` from the flags as it was only ever needed in preview versions of VS. Issue: #21724
* Merge topic 'android-system-stl'Brad King2021-12-141-1/+1
|\ | | | | | | | | | | | | 38b00f8801 Android: Fix linking android_support for pre-21 system STL Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6799
| * Android: Fix linking android_support for pre-21 system STLRyan Prichard2021-12-131-1/+1
| | | | | | | | | | | | | | This typo was introduced in commit 4dca078829 (Android: Link c++abi and android_support when necessary, 2020-10-29, v3.20.0-rc1~541^2). Fixes: #23004
| * Merge topic 'GNUtoMS-vs2022' into release-3.22Brad King2021-11-041-1/+1
| |\ | | | | | | | | | | | | | | | | | | 571a795d2f GNUtoMS: Add search path for VS 2022 environment scripts Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6695
* | \ Merge topic 'ghs_initial_setup'Brad King2021-11-191-27/+100
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | aa59eaac4f GHS: Allow setting GHS variables from toolchain file ab6f0b51b1 GHS: Add note about -T and path style a55b5c4e18 GHS: Update BSP selection logic 0427f22539 GHS: Update RTOS selection logic e006b87cc6 GHS: GHSMULTI - Update documentation to match implementation 83eb5695e9 GHS: Update toolset selection logic 8114ddcad1 GHS: Continue splitting variables used by generator 831607889f GHS: Update selection of primaryTarget in MULTI project file ... Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !6715
| * | | GHS: Allow setting GHS variables from toolchain fileFred Baksik2021-11-151-32/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Update generator to use the current variable definition, not the CACHE definition. * Avoid overwriting toolchain variables and avoid developer warnings when setting up the GHS variables. -- A cache entry is only required when: a) The toolchain uses set( CACHE ) to set the variable b) A -D or preset value was used to set the variable The cache entry is required so that the TYPE gets set properly. -- Avoid the Policy CMP0126 warnings: setting cache variable when normal variable exists * Move GHS_PRIMARY_TARGET back into area so non-GHS generator toolchain file can trigger the OS search.
| * | | GHS: Update BSP selection logicFred Baksik2021-11-151-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Selection of a BSP only needs to be performed if not set by user. Remove all the logic for printing error and status messages about BSP selection. These messages also breaks CMake tests. NOTE: If BSP selection fails then the compiler checks will result in a build error. The build error will report that the BSP does not exist.
| * | | GHS: Update RTOS selection logicFred Baksik2021-11-151-19/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Selection of an RTOS only needs to be performed if not set by user. Avoid CMake developer warnings for setting GHS_OS_DIR multiple times. Instead only set it once after searching has been performed. Remove all the logic for printing error and status messages about RTOS selection. This was broken and reporting incorrect messages. These messages also breaks CMake tests. NOTE: If RTOS selection fails then the compiler checks will result in a build error. The build error will report that the RTOS "GHS_OS_DIR-NOT-SPECIFIED" does not exist.
| * | | GHS: Update toolset selection logicFred Baksik2021-11-151-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- Ensure that GHS_TOOLSET_ROOT is used as a path * Converts directory path slashes to CMake style -- Use ComparePath() to properly check for path changes of build tool * Accounts for Windows file-system case insensitivity. -- Don't print message "defaulting" messages (this causes CMake test failures) -- Don't force update CMAKE_GENERATOR_TOOLSET back into cache when `-T` is not used on initial configure. This change avoids an unnessary error message when accidentally using `-T` in subsequent runs but the same tools are always used. -- Use IssueMessage() for error messages.
| * | | GHS: Continue splitting variables used by generatorFred Baksik2021-11-151-6/+6
| | | | | | | | | | | | | | | | | | | | This makes it easier to use GHS-MULTI platform in other generators that want to use the GHS-MULTI platform and compilers.
| * | | GHS: Update selection of primaryTarget in MULTI project fileFred Baksik2021-11-151-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes to ``-A`` handling: * Don't force CMAKE_GENERATOR_PLATFORM into cache when using default value (breaks using CMake presets). * Don't print message when using default value (breaks CMake tests). Changes to ``GHS_PRIMARY_TARGET`` handling: * Add as a cache variable so its known to GUI * Don't always include``GHS_TARGET_PLATFORM``, it's only needed if ``GHS_PRIMARY_TARGET`` wasn't set by the user. * Set ``GHS_PRIMARY_TARGET`` during platform selection instead of when a language is enabled. By performing this sooner ``GHS_TARGET_PLATFORM`` is not always required to be set into cache.
* | | | Clang/Windows: Use ThinLTO if possible to match other platformsRaul Tambre2021-11-141-1/+6
|/ / / | | | | | | | | | Fixes #22905.
* | | Merge topic 'GNUtoMS-vs2022'Brad King2021-11-041-1/+1
|\ \ \ | | |/ | |/| | | | | | | | | | | | | 571a795d2f GNUtoMS: Add search path for VS 2022 environment scripts Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6695
| * | GNUtoMS: Add search path for VS 2022 environment scriptsBrad King2021-11-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Extend the logic from commit 08c5b3eff0 (GNUtoMS: Add search path for VS 2019 environment scripts, 2020-01-09, v3.16.3~15^2) to consider VS 2022 paths too. Fixes: #22847
| * | Merge topic 'android-PATH' into release-3.21Brad King2021-09-171-5/+0
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | 94f3776774 Android: Restore searching PATH for executables Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6528
* | \ \ Merge topic 'vs-instance'Brad King2021-10-211-1/+3
|\ \ \ \ | | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 46e9ff5729 Restore honoring CMAKE_GENERATOR_INSTANCE in toolchain file 42418b02f7 Android: Refactor sysroot detection under Visual Studio 44a86d0b38 cmake_host_system_information: Add undocumented VS_MSBUILD_COMMAND key 6999b87133 cmGlobalVisualStudio10Generator: Add method to find MSBuild early 7f730464be cmGlobalGenerator: Add method to check if generator is at least VS 10 8917b8512f cmGlobalVisualStudioVersionedGenerator: Allow repeating SetGeneratorInstance 6511654164 cmGlobalVisualStudio10Generator: Allow subclasses to reset MSBuild search Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !6646
| * | | Android: Refactor sysroot detection under Visual StudioBrad King2021-10-201-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 6051a49c78 (Visual Studio: Add Android support, 2020-06-12, v3.19.0-rc1~619^2) we run MSBuild to build a sample project to detect the sysroot. Previously we relied on `CMAKE_VS_MSBUILD_COMMAND` being available. That required commit d5b5c19278 (cmGlobalGenerator: FindMakeProgram() before CMakeDetermineSystem, 2020-06-15, v3.19.0-rc1~619^2~3) to make it available early enough. However, that ordering broke `CMAKE_GENERATOR_INSTANCE` so we need to prepare to revert it. Use `cmake_host_system_information` to get the location of MSBuild under a VS generator instead.
* | | | CUDA: Allow both CUDA_SEPARABLE_COMPILATION and CUDA_PTX_COMPILATIONRobert Maynard2021-10-201-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | The target properties `CUDA_SEPARABLE_COMPILATION` and `CUDA_PTX_COMPILATION` now aren't mutually exclusive and can now be used together on the same target.
* | | | Merge topic 'platform-generic-elf'Brad King2021-10-201-0/+7
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3f9b40dab7 Generic-ELF: Add platform module to configure the .elf file extension Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6630
| * | | | Generic-ELF: Add platform module to configure the .elf file extensionJordan Williams2021-10-191-0/+7
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `.elf` extension is a common convention used for embedded binaries. Both Arm and RISC-V use the ELF file format for executables. Configuring the `.elf` file extension is typically done incorrectly. Most embedded developers set this in toolchain files, which is not the correct place. This is typically accomplished through a hack by setting the individual language file extensions for C, CXX, and ASM. Multiple CMake issues in the past have been opened related to this. * #16538 * #20163 * #17880 A platform module makes it simpler and less error prone for developers targeting these ubiquitous bare-metal platforms. This PR attempts to solve this globally with a generic platform. This could also be solved by using more specific platform modules, such as one for each of bare-metal Arm and RISC-V.
* | | | LCC: Add dedicated support for MCST LCC compilermakise-homura2021-10-154-0/+22
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Divert LCC compiler as a new one, instead of treating it as GNU. Since old times, Elbrus C/C++/Fortran Compiler (LCC) by MCST has been passing checks for GNU compilers, so it has been identified as GNU. Now, with intent of seriously upstreaming its support, it has been added as a separate LCC compiler, and its version displays not a supported GCC version, but LCC version itself (e.g. LCC 1.25.19 instead of GNU 7.3.0). This commit adds its support for detection, and also converts basically every check like 'is this compiler GNU?' to 'is this compiler GNU or LCC?'. The only places where this check is untouched, is where it regards other platforms where LCC is unavailable (primarily non-Linux), and where it REALLY differs from GNU compiler. Note: this transition may break software that are already ported to Elbrus, but hardly relies that LCC will be detected as GNU; still such software is not known.
* | | Merge topic 'clang-manifest'Brad King2021-09-211-2/+4
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | b73857561f Clang: embed windows manifests with GNU interface Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6534
| * | | Clang: embed windows manifests with GNU interfaceThomas Bernard2021-09-161-2/+4
| |/ / | | | | | | | | | Solves: #22611
* | | Merge topic 'platform-vars'Brad King2021-09-211-24/+20
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a136b6ec98 MINGW: Define variable only when targeting Windows platforms 39c5dad0cb Ninja: Remove redundant check for GNU-like compiler on Windows 0b7ae84a96 Cygwin: Remove redundant definitions of CYGWIN and UNIX variables Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !6538
| * | | MINGW: Define variable only when targeting Windows platformsBrad King2021-09-171-24/+20
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `MINGW` variable indicates that the compiler targets MinGW, a GNU ABI on Windows. Since commit aff3147917 (Modernize GNU compiler info on Windows, 2009-12-02, v2.8.2~636), we load the `Platform/Windows-GNU` module for compilers targetin MinGW, so set the variable there instead. This is equivalent to `Platform/Windows-MSVC` setting the `MSVC` variable. Also remove `if(MINGW)` checks from the module, which have not been necessary since the enclosed logic was moved to that module. The undocumented `CMAKE_COMPILER_IS_MINGW` internal variable is now unused, so remove it too. Fixes: #22647
* | | Merge topic 'android-PATH'Brad King2021-09-171-5/+0
|\ \ \ | |/ / |/| / | |/ | | | | | | 94f3776774 Android: Restore searching PATH for executables Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6528
| * Android: Restore searching PATH for executableshhb2021-09-161-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Since commit a7f41a7ee4 (Android: Fix find_* search order within NDK for unified toolchains, 2020-10-13, v3.20.0-rc1~610^2), we turn off `CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`. This breaks `find_program` searching `PATH` for host executables. Fortunately, the setting turns out not to be necessary, perhaps since commit cbc51a8be3 (Android: restructure android search paths, 2020-11-06, v3.20.0-rc1~509^2). Without it, none of NDK tests fail, so remove it to restore pre-3.20 behavior. Fixes: #22634
* | MSVC: Fix MSVC_TOOLSET_VERSION for VS 2022 v143 toolsetBrad King2021-09-021-1/+4
| | | | | | | | | | | | | | | | This was forgotten in commit 0c7f918fb1 (VS: Update Visual Studio 17 2022 generator for Preview 2, 2021-07-14, v3.21.1~29^2) when the toolset was first renumbered to `v143`. Fixes: #22585
* | Android: Fix NDK toolchain dir on arm64 macWangBin2021-08-181-1/+1
| |
* | Merge topic 'macos-10.4' into release-3.21Brad King2021-08-061-1/+3
|\ \ | |/ | | | | | | | | | | 1af23c4de2 macOS: Restore support for Mac OS X 10.4 (Tiger) Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6426
| * macOS: Restore support for Mac OS X 10.4 (Tiger)Evan Miller2021-08-021-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 4aed96e230 (Apple: Set CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG on non-macOS too, 2021-04-06, v3.20.1~5^2) we always enable support for linking with `-rpath`. The intention of the change was to enable using the flag on iOS, tvOS and watchOS by avoiding a Darwin-specific version check. However, removing the check broke support for OS X 10.4 because the flag is not supported on that version. Restore a form of the check that disables the flag on OS X < 10.5 while still allowing it for the other Apple platforms. Since no one is doing iOS/tvOS/etc development on 10.4, this change should have no unintended side effects. Fixes: #22490
| * 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
| * \ 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
* | | | Platform/Haiku: Remove the include-once behaviorJessica Hamilton2021-07-291-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The behavior was added by commit 7ebc1cb2ff (Haiku: Several fixes to platform module, 2013-10-05, v3.0.0-rc1~541^2~3), but was not explained in its commit message. No other platform modules do this. The include-once behavior results in incorrect variables set in some larger projects, e.g. .NET Core, particularly when cross-compiling, `CMAKE_DL_LIBS` being one of these. Remove it.
* | | | BinUtils: Find linker and librarian for Intel compilers on WindowsBrad King2021-05-271-4/+0
| | | | | | | | | | | | | | | | | | | | Update our Intel linker and archiver rules to use the `<CMAKE_LINKER>` and `<CMAKE_AR>` placeholders instead of hard-coding the tool names.
* | | | Modules: Fix typos and spelling in commentsJosef Angstenberger2021-05-071-1/+1
| | | |
* | | | Merge topic 'clang-ipo-support'Brad King2021-05-051-2/+2
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3dd776ccfd Windows-Clang: Support duplicate object names in LTO archives Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6082
| * | | | Windows-Clang: Support duplicate object names in LTO archivesBrad King2021-05-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the archive rules added by commit 6e3655db2c (Clang: add LTO support for GNU-command line clang on windows, 2019-07-08, v3.16.0-rc1~161^2~3) to match the `ar` convention we use for normal archives. Issue: #21988
* | | | | Windows-GNU: Support duplicate object names when linking shared librariesBrad King2021-05-031-1/+1
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend the change from commit 39d0ade07e (Windows-GNU: Support duplicate object names in large archives (#14874), 2014-04-14, v3.1.0-rc1~629^2~1) to apply to the temporary archive we create for linking shared libraries with MinGW tools. Issue: #21988
* | | | MSYS: Add support for running under MSYS runtime environmentOrgad Shaneh2021-04-2610-2/+14
| | | | | | | | | | | | | | | | Detect MSYS as CYGWIN, with the required adaptations.
* | | | Merge topic 'ios-rpath-linker-flag'Brad 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'Brad 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
* | | Merge topic 'fujitsu-compiler-4.0-support'Brad King2021-04-013-0/+19
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8ef55dec29 Help: Add release notes for Fujitsu compiler support 4c74c86f40 FindBLAS/LAPACK: Add support for the Fujitsu SSL2 library 376c300b25 FindOpenMP: Add support for Fujitsu compilers 9e0a1cf03e FindMPI: Add support for the Fujitsu compiler wrappers a237450948 Tests: Update for the FujitsuClang compiler 27579e9cf1 FujitsuClang: Add support for the Fujitsu compiler in Clang mode a55feff69c Tests: Update for the Fujitsu compiler 3c867cff4a Fujitsu: Add support for the Fujitsu compiler in Trad mode Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Axel Huebl <axel.huebl@plasma.ninja> Acked-by: Gilles Gouaillardet <gilles@rist.or.jp> Merge-request: !5954