summaryrefslogtreecommitdiffstats
path: root/Modules/Platform
Commit message (Collapse)AuthorAgeFilesLines
* 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
| |
* | MSVC: Teach find_library to consider the 'libfoo.a' naming conventionYonggang Luo2022-09-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When targeting the GNU ABI, we consider `.a` libraries first but also accept `.lib`. For symmetry, when targeting the MSVC ABI, we now consider `.lib` first but also accept `.a`. This adds support for meson-generated static libraries, which are named with the pattern `lib${foo}.a`: * https://mesonbuild.com/FAQ.html#why-does-building-my-project-with-msvc-output-static-libraries-called-libfooa Fixes: #23975 Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
* | Merge topic 'MsvcDebugInformationFormatAbstraction'Brad King2022-09-145-14/+65
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | a858466aac MSVC: Add test for debug information format 0e96a20478 MSVC: Add abstraction for debug information format d4c8111da4 Clang/Windows: Clarify name of internal runtime library flags variables Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7606
| * | MSVC: Add abstraction for debug information formatGlen Chung2022-09-145-6/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace our hard-coded default for `/Zi` with a first-class abstraction to select the debug information format an enumeration of logical names. We've long hesitated to do this because the idea of "debug information format" touches on related concepts on several platforms. Avoid that scope creep by simply defining an abstraction that applies only when targeting the MSVC ABI on Windows. Removing the old default flag requires a policy because existing projects may rely on string processing to edit them and choose a runtime library under the old behavior. Add policy CMP0141 to provide compatibility. Fixes: #10189
| * | Clang/Windows: Clarify name of internal runtime library flags variablesBrad King2022-09-131-10/+10
| | | | | | | | | | | | Also avoid extra spaces in resulting flag strings.
* | | Intel classic compilers on Windows: use msvc style dependenciesMarc Chevrier2022-09-132-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | Intel classic compilers generate erroneous dependencies when gcc style is used with paths containing spaces. So, fall back to the old way to generate dependencies by using option /showIncludes. Fixes: #23948
* | | BSD: Only use BSD as variable for target BSD systemCristian Adam2022-09-054-8/+4
|/ / | | | | | | | | | | | | Instead of having multiple boolean variables, we only have one string variable: BSD with the name of the target BSD system. Relates: #23853
* | Merge topic 'bsd-variables'Craig Scott2022-08-225-2/+10
|\ \ | | | | | | | | | | | | | | | | | | | | | a20d7a9707 BSD: Set *BSD variables when targeting a *BSD system 2ae42d0aa3 kFreeBSD: Do not unset LINUX variable Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7573
| * | BSD: Set *BSD variables when targeting a *BSD systemCristian Adam2022-08-204-0/+8
| | | | | | | | | | | | Fixes: #23853
| * | kFreeBSD: Do not unset LINUX variableCristian Adam2022-08-201-2/+2
| | | | | | | | | | | | | | | kFreeBSD is a Debian GNU distribution with a kernel from FreeBSD, and should be marked as LINUX.
* | | Merge topic 'nvhpc_fpie_support'Brad King2022-08-161-7/+9
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 52dc49deb9 NVHPC: Enable PIE support on linux Acked-by: Kitware Robot <kwrobot@kitware.com> Reviewed-by: Raul Tambre <raul@tambre.ee> Merge-request: !7564
| * | | NVHPC: Enable PIE support on linuxRobert Maynard2022-08-151-7/+9
| | | |
* | | | Merge topic 'mingw-windres'Brad King2022-08-161-1/+1
|\ \ \ \ | |_|/ / |/| | / | | |/ | |/| | | | | | | e9755bc7c1 MinGW: Restore using windres when toolchain-prefixed name is not available Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7574
| * | MinGW: Restore using windres when toolchain-prefixed name is not availableBrad King2022-08-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 55ba10dcfd (MSYS/MinGW Makefiles: Simplify selection of windres as Resource Compiler, 2022-05-26, v3.24.0-rc1~82^2) the `MinGW Makefiles` and `MSYS Makefiles` generators no longer specify the plain `windres` name for the MinGW resource compiler. Instead, the name is specified in our MinGW platform information module. After the change in commit af4adf6aa9 (MinGW: Fix default windres selection when cross-compiling, 2020-03-25, v3.18.0-rc1~492^2), when cross-compiling, we only specify the toolchain-prefixed name of the tool, which may not be available in all environments. If the toolchain-prefixed name is not available, fall back to the plain `windres` name. We already use this approach for other binutils. Fixes: #23841
* | | variable: Set LINUX variable on Linux target systemsCristian Adam2022-08-112-0/+2
| |/ |/| | | Fixes: #23840
* | Enable IPO for IntelLLVM compilers on Linux and WindowsWilliam R. Dieter2022-08-011-26/+0
| | | | | | | | | | | | | | Replicate and adapt Linux IPO options for Intel for IntelLLVM compilers on Linux and Windows. Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
* | IntelLLVM: Pass linker flags to the compiler when used as linkerWilliam R. Dieter2022-08-011-8/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When linking an executable, DLL, or static library, the compiler sometimes needs to see the linking options. Typically `<FLAGS>` is not passed for linking, because some of the options are only used for compilation. Previously, `<LINK_FLAGS>` was passed after the `/link` flag because the compiler did not understand some of the linking options. This change wraps the initial linker options borrowed from Windows-MSVC individually, so that they are passed directly to the linker. This change is helpful both for interprocedural optimization, which needs to pass `-Qipo` to the compiler at link time, and for SYCL which needs to pass `-fsycl` and possibly other options to the compiler at link time. Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
* | AIX: Export symbols from IBMClang IPA objectsWilliam Marlow2022-07-123-16/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When interprocedural analysis is enabled on the IBMClang family of compilers (via the `-flto` option) then the resulting object files contain LLVM IR rather than XCOFF objects[1]. ExportImportList needs to detect LLVM IR objects and use the `ibm-llvm-nm` tool that ships with the compiler to create the extract the defined symbols. Without this change, such objects result in an error message from `dump` and no symbols being exported from the object file. [1]: https://www.ibm.com/docs/en/openxl-c-and-cpp-aix/17.1.0?topic=compatibility-link-time-optimization-lto
* | Merge topic 'LINK_LIBRARY-Darwin-LIBRARY-features-enhancements'Craig Scott2022-07-051-6/+6
|\ \ | |/ | | | | | | | | | | | | 537861664a Genex LINK_LIBRARY: MacOS: enhance *_LIBRARY features c55d42eb42 Darwin.cmake: Fix indenting Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7433
| * Genex LINK_LIBRARY: MacOS: enhance *_LIBRARY featuresMarc Chevrier2022-07-031-3/+3
| |
| * Darwin.cmake: Fix indentingCraig Scott2022-07-031-3/+3
| |
| * Merge topic 'lcc-liblfortran-renamed' into release-3.24Brad King2022-06-281-1/+5
| |\ | | | | | | | | | | | | | | | | | | 57da7a4925 LCC: link with -lgfortran instead of -llfortran since 1.26.03 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7407
* | \ Merge topic 'lcc-liblfortran-renamed'Brad King2022-06-281-1/+5
|\ \ \ | | |/ | |/| | | | | | | | | | | | | 57da7a4925 LCC: link with -lgfortran instead of -llfortran since 1.26.03 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7407
| * | LCC: link with -lgfortran instead of -llfortran since 1.26.03Igor Molchanov2022-06-271-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since LCC 1.26.03, compiler developers decided to rename liblfortran to libgfortran (internal reference: mcstbug#131633), and despite it's stated that "-llfortran will be automatically treated as -lgfortran", it actually does not work (and there's even no symlinks like liblfortran.* -> libgfortran.*); so we have to explicitly choose which library we have to link in. Fixes: #23646
* | | SerenityOS: Add Platform moduleAndrew Kaster2022-06-148-0/+48
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an initial Platform module for SerenityOS [1]. This module is a mix of the platform module currently used to build the Serenity Kernel and Userspace applications and libraries, and the platform module included in the CMake Port [2] which still has some work to do on the system before its other patches could be considered for upstream. As such, the platform module is currently only useful when used with a suitably patched GCC or LLVM cross-compiler toolchain. [1] https://github.com/SerenityOS/serenity [2] https://github.com/SerenityOS/serenity/tree/master/Ports/cmake/patches Issue: #23589
* | MSVC: Revert "Default to -ZI instead of /Zi for x86 and x64"Brad King2022-06-093-25/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert commit 5fcadc481e (MSVC: Default to -ZI instead of /Zi for x86 and x64, 2022-05-24). The `-ZI` flag is incompatible with the `-GL` flag used for IPO, and so is not an unconditionally better default. Revert the change pending future design of a first-class setting for MSVC debug info format that can be automatically reconciled with IPO settings. That commit introduced policy CMP0138, but we already have later policy numbers used too. Leave placeholder text to avoid policy renumbering. Issue: #23607, #10189
* | MSVC: Default to -ZI instead of /Zi for x86 and x64Glen Chung2022-05-263-2/+25
| | | | | | | | | | | | | | | | | | | | Add a policy for compatibility. For more information, see [1]. [1] https://docs.microsoft.com/en-us/cpp/build/reference/z7-zi-zi-debug-information-format?view=msvc-170 Fixes: #10189
* | Merge branch 'backport-3.23-clang-imsvc' into clang-imsvcBrad King2022-05-171-1/+1
|\ \ | |/
| * Clang: Use -imsvc flag without space to support Clang toolsBrad King2022-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Since commit bb61c2d024 (Clang: use -imsvc for system include dirs when running on Windows, 2020-09-16, v3.19.0-rc1~162^2) we use the `-imsvc` flag followed by the include directory as a separate argument. Some versions of `clang-tidy` do not support the flag unless the include directory is attached to it, so use that form instead. A similar fix was made by commit 3a8b6653dc (MSVC: Use -external:I flag without space to support Clang tools, 2022-01-11, v3.22.2~8^2). Fixes: #23517
* | Merge topic 'werror-property'Brad King2022-05-101-0/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | 76a08cd253 COMPILE_WARNING_AS_ERROR: Add options to treat warnings as errors Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Acked-by: Michael Hirsch <michael@scivision.dev> Merge-request: !7187