summaryrefslogtreecommitdiffstats
path: root/Modules/Platform
Commit message (Collapse)AuthorAgeFilesLines
* LLVMFlang: Fix MSVC ABI debug information format optionsBrad King2023-12-051-5/+7
| | | | | | | | | | | | | In commit 26bf32cdc6 (LLVMFlang: Add support for targeting MSVC ABI on Windows, 2023-09-28, v3.28.0-rc1~10^2) we incorrectly recorded `-g` as supporting the `ProgramDatabase` format, but it is actually `Embedded`, matching Clang. In order to support easy integration with C and C++ projects that use the `.pdb` debug formats, pretend LLVMFlang supports them and just don't actually emit any debug information. Issue: #24840
* LLVMFlang: Add support for targeting MSVC ABI on WindowsBrad King2023-10-031-3/+58
| | | | | | | | | | The compiler does not yet support everything needed to integrate well with the MSVC ABI, in particular for runtime library selection and debug format selection. Document them in FIXME comments and leave this support undocumented by CMake for now. Fixes: #24840 Inspired-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
* OrangeC: Add support for OrangeC compilerDavid Lindauer2023-09-253-0/+14
| | | | | | | Add compiler information modules. Update the test suite. Fixes: #25032 Co-authored-by: Brad King <brad.king@kitware.com>
* macOS: Framework: simplify link flagMarc Chevrier2023-09-212-0/+7
| | | | Use the compiler option rather than the linker one.
* MinGW: Search for packages in standard MSYSTEM environment prefixesBrad King2023-09-131-0/+19
| | | | | | | | | | | | | | | | MSYS2 and similar MinGW/MSYS distributions define development environments with a `MSYSTEM` environment variable. Each such environment has a documented installation prefix for its packages, often provided by a `MSYSTEM_PREFIX` environment variable. Since commit 84a25fc263 (cmake_host_system_information: Add MSYSTEM_PREFIX query, 2023-09-08) we can look up this prefix. Add `$MSYSTEM_PREFIX/local` and `$MSYSTEM_PREFIX` to our system search prefixes when targeting MinGW under `MSYSTEM` environments. This is their equivalent to `/usr/local` and `/usr`, which we search by default on UNIX systems. Issue: #24216
* Windows: Add experimental WindowsKernelModeDriver platformKyle Edwards2023-07-176-3/+41
|
* Merge topic 'android-platform'Brad King2023-07-141-0/+2
|\ | | | | | | | | | | | | bfe4722a61 Android: Restore platform info and search paths shared with Linux Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8626
| * Android: Restore platform info and search paths shared with LinuxBrad King2023-07-131-0/+2
| | | | | | | | | | | | | | | | These were accidentally dropped by commit 1373373823 (enable_language: Establish target platform identification variables earlier, 2023-06-06, v3.27.0-rc1~3^2~1). Fixes: #25077
* | apple: add preliminary visionOS supportGregor Jasny2023-07-116-2/+17
|/
* Android: Restore platform id vars with legacy toolchain fileBrad King2023-06-201-5/+5
| | | | | | | | | Restore definition of `ANDROID` and `UNIX` when `CMAKE_SYSTEM_VERSION` is `1`. This was broken by commit 1373373823 (enable_language: Establish target platform identification variables earlier, 2023-06-06, v3.27.0-rc1~3^2~1). Fixes: #25004
* enable_language: Establish target platform identification variables earlierBrad King2023-06-0765-51/+72
| | | | | | | | Set target platform identification variables like `APPLE` and `LINUX` as soon as the target system is identified. This makes them available during toolchain and binutils selection. Fixes: #23333
* kFreeBSD,GNU: Provide multiarch library directory regex earlierBrad King2023-06-066-7/+9
| | | | | | | | Make `CMAKE_LIBRARY_ARCHITECTURE_REGEX` available while determining compilers before `Platform/{kFreeBSD,GNU}` is loaded. Follow up commit cc737ae829 (Linux: Provide multiarch library directory regex earlier, 2023-05-31).
* AppleClang: Fix ASM compiler identificationGregor Jasny2023-06-051-0/+1
| | | | | Recent AppleClang compilers identify themselves as `Apple clang version 14.0.3 (clang-1403.0.22.14.1)`.
* Linux: Provide multiarch library directory regex earlierBrad King2023-05-312-3/+2
| | | | | Make `CMAKE_LIBRARY_ARCHITECTURE_REGEX` available while determining compilers before `Platform/Linux` is loaded.
* IntelLLVM: Use compiler driver as linker for MODULE libraries tooWilliam R. Dieter2023-05-251-0/+1
| | | | | | | | | | | | | | | | | Since commit 79921fb00c (IntelLLVM: Set linker to compiler driver for Windows, 2021-10-19, v3.23.0-rc1~127^2) we default to the compiler driver as linker for executables, shared libraries, and static libraries. Not doing so for shared modules was an oversight. Copying the shared library command line for shared modules fixes the problem (and also is what we do for MSVC). The MSVC linker is fine for many cases, however it does not support GPU offload code generated by the IntelLLVM compilers. Using the compiler driver as linker, or at least a linker that understands the object format, is required for linking shared modules that use GPU offload (e.g., with SYCL or OpenMP). Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
* VS/Android: Deduce processor type from CMAKE_GENERATOR_PLATFORMMichael Karcher2023-04-261-1/+14
| | | | Closes: #24839
* VS/Android: Use safe API level when detecting the NDK directoryMichael Karcher2023-04-251-0/+1
|
* VS/Android: Detect full NDK root instead of sysrootMichael Karcher2023-04-252-14/+9
| | | | | | | Visual Studio always uses a complete NDK and not a standalone toolchain. Let CMake handle the NDK and related logic correctly, avoid trying to find the standalone toolchain version from the unified clang toolchain in newer NDKs.
* VS/Android: Use ApplicationTypeRevision 3.0 in VS2022Michael Karcher2023-04-251-1/+1
| | | | | | Visual Studio 17 (Marketing name: Visual Studio 2022) still ships with "3.0" as most recent Variant of the Android application type. Use this revision.
* Apple: Handle generation and comsuption of text-based stubs (.tbd files)Marc Chevrier2023-03-011-0/+5
| | | | Fixes: #24123
* Merge topic 'swift-debug-info'Brad King2023-02-171-0/+2
|\ | | | | | | | | | | | | 9693191582 Swift: Emit debug information on Windows Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8090
| * Swift: Emit debug information on WindowsSaleem Abdulrasool2023-02-161-0/+2
| | | | | | | | | | | | | | | | | | When building on Windows, pass `-debug` to the linker to emit the PDB (or `-debug:dwarf` when building with lld and using DWARF). We would previously not do this which meant that we never emitted the debug information making debugging more difficult. Fixes: #24423
* | LCC: Disable Fortran preprocessor testing if unsupportedmakise-homura2023-02-161-0/+2
| | | | | | | | | | | | LCC < 1.24 has no way to disable integrated Fortran preprocessor, and it can't produce preprocessed files explicitly. So we disable all functionality (and therefore tests) related to it.
* | LCC: Don't require liblfortran on lcc versions that don't have itmakise-homura2023-02-151-3/+3
|/ | | | | There wasn't a liblfortran library before 1.24 (actually 1.24.01), and it is replaced by libgfortran in 1.26.03 and later.
* Merge topic 'android-ndk-legacy-toolchain'Brad King2023-02-071-0/+2
|\ | | | | | | | | | | | | cb0b9452e8 Android: Provide CMAKE_ANDROID_NDK_VERSION with NDK legacy toolchain file Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8170
| * Android: Provide CMAKE_ANDROID_NDK_VERSION with NDK legacy toolchain fileBrad King2023-02-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This variable has been provided since commit 746906242d (Android: Detect NDK version number, 2021-02-26, v3.20.0-rc3~1^2~3) when using CMake's NDK support or the modern NDK toolchain file. Since commit 005e2cdfb0 (Android: Do not use gold for ndk >= r22, 2021-02-26, v3.20.0-rc3~1^2) we need the value in our compiler/platform information files, so provide it when using the NDK legacy toolchain file too. Revert commit 1c86e397fe (Android/Clang: Tolerate undefined CMAKE_ANDROID_NDK_VERSION, 2022-09-16, v3.25.0-rc1~118^2) since the variable should now always be defined. Issue: #21772 Fixes: #24386
| * Merge topic 'android-no-LINUX' into release-3.25Brad King2022-11-291-0/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | 19509249a5 Android: Revert setting LINUX variable on Android target systems Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Robert Nevala <robert.nevala@king.com> Acked-by: n00b42 <github.com@mail.msdigital.de> Merge-request: !7963
| * \ Merge topic 'revert-find_library-msvc-libfoo.a' into release-3.25Brad King2022-11-291-2/+2
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | 955d6245c1 MSVC: Revert "Teach find_library to consider the 'libfoo.a' naming convention" Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7962
| * \ \ Merge topic 'mingw-windres' into release-3.25Brad King2022-11-291-1/+2
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | b47092fddb MinGW: Fix regression when windres is not found Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7964
* | | | | OpenWatcom: Add correct support for 16-bit WindowsJiri Malak2023-01-255-33/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This add correct Open Watcom support for 16-bit Windows 3.x. It replace existing strange mixture with WIN32 stuff which implement 16-bit Windows target partially as part of WIN32 stuff. Now pre-defined OS ID Windows3x is used instead of confusing WIN32. It support properly 16-bit and 32-bit application for 16-bit Windows host. 32-bit applications are build with OW WIN386 extender. It is used similar as for other platforms by set CMAKE_SYSTEM_NAME=Windows3x and CMAKE_SYSTEM_PROCESSOR=I86 for 16-bit application or CMAKE_SYSTEM_PROCESSOR=x86 for 32-bit WIN386 extender application running on 16-bit Windows 3.x. CMAKE_SYSTEM_NAME=Windows is used only for WIN32 applications.
* | | | | OpenWatcom: Refactor population of standard include directoriesJiri Malak2023-01-246-61/+38
| | | | | | | | | | | | | | | | | | | | | | | | | Add setup of system include directories to language related macro to remove extra lines for C and CXX. System include directories are always same for both languages (they are defined per platform).
* | | | | CYGWIN: Drop pre-2.8.4 compatibility mode CMAKE_LEGACY_CYGWIN_WIN32Brad King2023-01-191-45/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to CMake 2.8.4 (released in 2011), we defined `WIN32` on CYGWIN. That was removed, but an undocumented `CMAKE_LEGACY_CYGWIN_WIN32` compatibility mode was left to help projects transition. Only projects that do not require at least 2.8.4 as their minimum CMake version need the compatibility mode. We've also long warned about projects that do not require at least 2.8.12, so it is now reasonable to remove the legacy compatibility mode.
* | | | | Modules: Record system inspection steps in the configure logBrad King2023-01-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace old-style `file(APPEND .../CMake{Output,Error}.log)` logging with calls to `message(CONFIGURE_LOG)` to record the steps in the `CMakeConfigureLog.yaml` configure log instead. Issue: #23200
* | | | | OpenWatcom: Add support for 16-bit Windowsjbs2022-11-301-9/+38
| | | | | | | | | | | | | | | | | | | | Add support for NE Win16 binaries. We already support 16-bit DOS and OS/2.
* | | | | Merge topic 'android-no-LINUX'Brad King2022-11-291-0/+1
|\ \ \ \ \ | | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 19509249a5 Android: Revert setting LINUX variable on Android target systems Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Robert Nevala <robert.nevala@king.com> Acked-by: n00b42 <github.com@mail.msdigital.de> Merge-request: !7963
| * | | | Android: Revert setting LINUX variable on Android target systemsBrad King2022-11-281-0/+1
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 62cd3904bf (variable: Set LINUX variable on Linux target systems, 2022-08-10, v3.25.0-rc1~320^2), the `Platform/Android` module inherits the `LINUX` variable setting from `Platform/Linux`. While Android may use a Linux kernel, `CMAKE_SYSTEM_NAME` is not `Linux`, and the platform does not follow conventions of most Linux distributions. Fixes: #24196
* | | | Merge topic 'revert-find_library-msvc-libfoo.a'Brad King2022-11-291-2/+2
|\ \ \ \ | | |_|/ | |/| | | | | | | | | | | | | | | | | | 955d6245c1 MSVC: Revert "Teach find_library to consider the 'libfoo.a' naming convention" Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7962
| * | | MSVC: Revert "Teach find_library to consider the 'libfoo.a' naming convention"Brad King2022-11-281-2/+2
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert commit be848a71b0 (MSVC: Teach find_library to consider the 'libfoo.a' naming convention, 2022-09-19, v3.25.0-rc1~111^2). When targeting the MSVC ABI, this causes GNU-ABI libraries to be found in cases they were not previously, and broke existing builds. Revert the change pending further discussion on how to handle the motivating use case. Issue: #23975 Fixes: #24168
* | | Merge topic 'mingw-windres'Brad King2022-11-291-1/+2
|\ \ \ | | |/ | |/| | | | | | | | | | | | | b47092fddb MinGW: Fix regression when windres is not found Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7964
| * | MinGW: Fix regression when windres is not foundBrad King2022-11-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fix in commit e9755bc7c1 (MinGW: Restore using windres when toolchain-prefixed name is not available, 2022-08-15, v3.24.1~4^2) incorrectly listed two entries in `CMAKE_RC_COMPILER_INIT`, which is only meant to have one value. Revise the logic to support multiple platform-specific names for the Windows Resource Compiler while still only using one name as the fallback when it is not found. Fixes: #24190 Issue: #23841
* | | Only initialize CMAKE_CXX_COMPILER_PREDEFINES_COMMANDJoerg Bornemann2022-11-161-1/+3
| |/ |/| | | | | | | | | | | | | | | | | | | Don't initialize the other CMAKE_<LANG>_COMPILER_PREDEFINES_COMMAND variables. The only language variant that is used is CMAKE_CXX_COMPILER_PREDEFINES_COMMAND, and the other language variants contained invalid, namely C++-specific commands. Fixes: #23968
* | Linux: Avoid finding libraries using lib64 on ArchLinuxLetu Ren2022-10-301-3/+8
| | | | | | | | | | ArchLinux uses `/lib` for 64-bit libraries and there is no `/lib64`. However, unlike Debian, 32-bit libraries are in `/lib32`.
* | Merge topic 'flang-windows' into release-3.25Brad King2022-10-251-0/+1
|\ \ | |/ | | | | | | | | | | 166bc00399 LLVMFlang: Add a required line to define linking rules on Windows Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7818
| * LLVMFlang: Add a required line to define linking rules on Windowsمهدي شينون (Mehdi Chinoune)2022-10-241-0/+1
| | | | | | | | | | This was missed in commit d34e5a98b8 (LLVMFlang: Add support for Windows, 2022-09-18, v3.25.0-rc1~102^2).
* | Merge topic 'android-path-suffixes' into release-3.25Brad King2022-10-191-0/+6
|\ \ | |/ | | | | | | | | | | 7e5b48a7b1 Android: Avoid searching API level directories matching architecture bitness Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7805
| * Android: Avoid searching API level directories matching architecture bitnessSergiu Deitsch2022-10-181-0/+6
| | | | | | | | | | | | | | | | | | When cross-compiling for Android, the library path suffixes `/<number>/` refer to API level specific platform libraries instead of architecture bitness. Disable path suffix use under NDK to avoid incorrect inclusion of API level specific libraries below the targeted API level. Fixes: #23830
* | SerenityOS: Unset CMAKE_DL_LIBS because LibDl no longer existsAndrew Kaster2022-10-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Serenity's LibDl was merged into LibC to simplify the build and port infrastructure [1]. Set `CMAKE_DL_LIBS` to the empty string to match what other platforms do. Update the platform module added by commit 45ca894164 (SerenityOS: Add Platform module, 2022-01-02, v3.25.0-rc1~635^2). [1] https://github.com/SerenityOS/serenity/pull/14854 Issue: #23589
* | HIP, Windows: Add Windows-Clang-HIP platform moduleGergely Meszaros2022-10-092-15/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | Add a platform module for using clang for HIP on windows, based on the CXX module. HIP language on windows works without this, but mixing with MSVC produces catastrofical results. Add the same restriction with HIP as C and C++ had prior: Either none are compiled with MSVC or all are. clang-cl support for HIP does not work yet: it needs more work in both hip-lang-config.cmake and cmake itself.
* | Merge topic 'flang-windows'Brad King2022-09-231-0/+2
|\ \ | |/ | | | | | | | | | | d34e5a98b8 LLVMFlang: Add support for Windows Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7692
| * LLVMFlang: Add support for Windowsمهدي شينون (Mehdi Chinoune)2022-09-211-0/+2
| |