Commit Graph

1358 Commits

Author SHA1 Message Date
Kyle Edwards
b01f5eb079 Windows: Add experimental WindowsKernelModeDriver platform 2023-07-17 16:54:10 -04:00
Brad King
ba616fcb6d Merge topic 'android-platform'
bfe4722a61 Android: Restore platform info and search paths shared with Linux

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8626
2023-07-14 08:33:13 -04:00
Brad King
bfe4722a61 Android: Restore platform info and search paths shared with Linux
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
2023-07-13 08:19:15 -04:00
Gregor Jasny
25977e177b apple: add preliminary visionOS support 2023-07-11 20:20:25 +02:00
Brad King
ab66b89a46 Android: Restore platform id vars with legacy toolchain file
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
2023-06-20 10:39:37 -04:00
Brad King
1373373823 enable_language: Establish target platform identification variables earlier
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
2023-06-07 07:02:20 -04:00
Brad King
1d916bf3d2 kFreeBSD,GNU: Provide multiarch library directory regex earlier
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).
2023-06-06 15:35:20 -04:00
Gregor Jasny
8c789bee83 AppleClang: Fix ASM compiler identification
Recent AppleClang compilers identify themselves as
`Apple clang version 14.0.3 (clang-1403.0.22.14.1)`.
2023-06-05 17:31:35 -04:00
Brad King
cc737ae829 Linux: Provide multiarch library directory regex earlier
Make `CMAKE_LIBRARY_ARCHITECTURE_REGEX` available while determining
compilers before `Platform/Linux` is loaded.
2023-05-31 16:52:54 -04:00
William R. Dieter
9875b11969 IntelLLVM: Use compiler driver as linker for MODULE libraries too
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>
2023-05-25 13:17:41 -04:00
Michael Karcher
ca6e81a31f VS/Android: Deduce processor type from CMAKE_GENERATOR_PLATFORM
Closes: #24839
2023-04-26 18:11:23 +02:00
Michael Karcher
16d8b65bc0 VS/Android: Use safe API level when detecting the NDK directory 2023-04-25 13:49:03 -04:00
Michael Karcher
f7af10100c VS/Android: Detect full NDK root instead of sysroot
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.
2023-04-25 13:48:33 -04:00
Michael Karcher
e78abf94e3 VS/Android: Use ApplicationTypeRevision 3.0 in VS2022
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.
2023-04-25 13:45:37 -04:00
Marc Chevrier
ede33f30cf Apple: Handle generation and comsuption of text-based stubs (.tbd files)
Fixes: #24123
2023-03-01 12:23:28 +01:00
Brad King
0089a32c2c Merge topic 'swift-debug-info'
9693191582 Swift: Emit debug information on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8090
2023-02-17 08:54:03 -05:00
Saleem Abdulrasool
9693191582 Swift: Emit debug information on Windows
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
2023-02-16 16:10:05 -05:00
makise-homura
9f9d121ddb LCC: Disable Fortran preprocessor testing if unsupported
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.
2023-02-16 03:55:31 +03:00
makise-homura
5434547678 LCC: Don't require liblfortran on lcc versions that don't have it
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.
2023-02-16 00:05:16 +03:00
Brad King
60911f4ebc Merge topic 'android-ndk-legacy-toolchain'
cb0b9452e8 Android: Provide CMAKE_ANDROID_NDK_VERSION with NDK legacy toolchain file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8170
2023-02-07 09:32:20 -05:00
Brad King
cb0b9452e8 Android: Provide CMAKE_ANDROID_NDK_VERSION with NDK legacy toolchain file
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
2023-02-06 17:17:25 -05:00
Jiri Malak
e194caa5a3 OpenWatcom: Add correct support for 16-bit Windows
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.
2023-01-25 17:53:03 +01:00
Jiri Malak
10623a51a0 OpenWatcom: Refactor population of standard include directories
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).
2023-01-24 20:44:11 +01:00
Brad King
a429e4b9b1 CYGWIN: Drop pre-2.8.4 compatibility mode CMAKE_LEGACY_CYGWIN_WIN32
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.
2023-01-19 14:29:35 -05:00
Brad King
f6ed2585e5 Modules: Record system inspection steps in the configure log
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
2023-01-18 17:59:10 -05:00
jbs
ef9ce3aadb OpenWatcom: Add support for 16-bit Windows
Add support for NE Win16 binaries.  We already support 16-bit DOS and OS/2.
2022-11-30 18:22:48 -05:00
Brad King
44f2c8f1a4 Merge topic 'android-no-LINUX'
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
2022-11-29 10:24:22 -05:00
Brad King
7eb3cb19bc Merge topic 'android-no-LINUX' into release-3.25
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
2022-11-29 10:24:21 -05:00
Brad King
4751c9399e Merge topic 'revert-find_library-msvc-libfoo.a'
955d6245c1 MSVC: Revert "Teach find_library to consider the 'libfoo.a' naming convention"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7962
2022-11-29 10:15:57 -05:00
Brad King
4c2952c5cb Merge topic 'revert-find_library-msvc-libfoo.a' into release-3.25
955d6245c1 MSVC: Revert "Teach find_library to consider the 'libfoo.a' naming convention"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7962
2022-11-29 10:15:55 -05:00
Brad King
1efae6d4a7 Merge topic 'mingw-windres'
b47092fddb MinGW: Fix regression when windres is not found

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7964
2022-11-29 10:06:53 -05:00
Brad King
25f6f98eb1 Merge topic 'mingw-windres' into release-3.25
b47092fddb MinGW: Fix regression when windres is not found

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7964
2022-11-29 10:06:52 -05:00
Brad King
b47092fddb MinGW: Fix regression when windres is not found
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
2022-11-28 19:09:04 -05:00
Brad King
19509249a5 Android: Revert setting LINUX variable on Android target systems
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
2022-11-28 16:58:54 -05:00
Brad King
955d6245c1 MSVC: Revert "Teach find_library to consider the 'libfoo.a' naming convention"
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
2022-11-28 15:42:27 -05:00
Joerg Bornemann
d538cb0e18 Only initialize CMAKE_CXX_COMPILER_PREDEFINES_COMMAND
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
2022-11-16 13:08:31 +01:00
Letu Ren
988b9928e4 Linux: Avoid finding libraries using lib64 on ArchLinux
ArchLinux uses `/lib` for 64-bit libraries and there is no `/lib64`.
However, unlike Debian, 32-bit libraries are in `/lib32`.
2022-10-30 08:52:59 -04:00
Brad King
0a34bde140 Merge topic 'flang-windows' into release-3.25
166bc00399 LLVMFlang: Add a required line to define linking rules on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7818
2022-10-25 10:33:19 -04:00
مهدي شينون (Mehdi Chinoune)
166bc00399 LLVMFlang: Add a required line to define linking rules on Windows
This was missed in commit d34e5a98b8 (LLVMFlang: Add support for
Windows, 2022-09-18, v3.25.0-rc1~102^2).
2022-10-24 12:53:07 -04:00
Brad King
077e42fe76 Merge topic 'android-path-suffixes' into release-3.25
7e5b48a7b1 Android: Avoid searching API level directories matching architecture bitness

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7805
2022-10-19 09:55:59 -04:00
Sergiu Deitsch
7e5b48a7b1 Android: Avoid searching API level directories matching architecture bitness
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
2022-10-18 14:21:51 -04:00
Andrew Kaster
4fa0d157bc SerenityOS: Unset CMAKE_DL_LIBS because LibDl no longer exists
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
2022-10-17 10:13:47 -04:00
Gergely Meszaros
5b87ae6e2d HIP, Windows: Add Windows-Clang-HIP platform module
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.
2022-10-09 20:03:28 +02:00
Brad King
d563bfa2df Merge topic 'flang-windows'
d34e5a98b8 LLVMFlang: Add support for Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7692
2022-09-23 08:42:21 -04:00
مهدي شينون (Mehdi Chinoune)
d34e5a98b8 LLVMFlang: Add support for Windows 2022-09-21 12:57:16 +01:00
Yonggang Luo
be848a71b0 MSVC: Teach find_library to consider the 'libfoo.a' naming convention
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>
2022-09-19 11:02:44 -04:00
Brad King
c3e68020d6 Merge topic 'MsvcDebugInformationFormatAbstraction'
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
2022-09-14 09:21:27 -04:00
Glen Chung
0e96a20478 MSVC: Add abstraction for debug information format
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
2022-09-14 09:12:47 -04:00
Marc Chevrier
90874a542e Intel classic compilers on Windows: use msvc style dependencies
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
2022-09-13 17:47:01 +02:00
Brad King
d4c8111da4 Clang/Windows: Clarify name of internal runtime library flags variables
Also avoid extra spaces in resulting flag strings.
2022-09-13 11:19:07 -04:00