Commit Graph

1095 Commits

Author SHA1 Message Date
Raul Tambre
f75bea1071 CUDA: Abstract language flag to compiler modules
Separate this detail out into compiler-specific modules.
Required for Clang support, as it uses slightly different language flags.
2020-03-11 21:30:09 +02:00
Brad King
022a935f3a Merge topic 'msvc-librarian'
55196a1440 MSVC: Use 'lib' instead of 'link /lib' to create static libraries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4409
2020-03-04 08:28:01 -05:00
Francisco Facioni
55196a1440 MSVC: Use 'lib' instead of 'link /lib' to create static libraries
`link.exe /lib` is an undocumented flag and it just calls `lib.exe`.
Also `link.exe` doesn't parse the `/lib` option correctly when in a
response file.
2020-03-03 08:31:13 -05:00
Thomas Bernard
ee70c5de4d llvm-rc: Forward DEFINES instead of FLAGS
Since commit 1c2d031cbd (Add -E cmake_llvm_rc to preprocess files for
llvm-rc, 2020-01-14, v3.17.0-rc1~24^2) we pass the full target `<FLAGS>`
to the llvm-rc resource compiler, but we should pass only `<DEFINES>`.

Fixes: #20414
2020-03-03 08:12:25 -05:00
Sergey Larin
5c6d6ec27c PCH: Clang: Update PCH usage flags to include original header
Add an additional include flag to PCH usage command line to fix programs
that rely on `compile_commands.json` file. Pass it to the preprocessor
directly to avoid compiler driver to change it to '-include-pch'.

When preprocessor is requested to preprocess a file, it tries to get
the original filename from '.pch' and uses that file for preprocessing.
CMake generates a '.pch' file from the '.hxx' file by passing an empty
'.cxx' source file to the compiler as a compilation unit and the header
file with the '-include' flag. After that, compiler puts compilation
unit filename in the '.pch' as the original filename.

However, CMake build system uses empty file as the source file and
passes the header file using '-include-pch' flag. As a result, Clang
uses the wrong file for preprocessing and produces the corrupted
preprocessed file.

Fixes: #20355
Signed-off-by: Sergey Larin <cerg2010cerg2010@mail.ru>
2020-02-24 10:53:39 -05:00
Yauheni Khnykin
5c2a92f44f Swift: Exclude SDK include paths
Populate `CMAKE_Swift_IMPLICIT_INCLUDE_DIRECTORIES` with the macOS SDK's
include directory so that we filter such implicit directories out of
Swift targets.

Fixes: #19845
2020-02-10 10:32:37 -05:00
Brad King
94be195a54 Merge topic 'llvm-rc-preprocess'
1c2d031cbd Add -E cmake_llvm_rc to preprocess files for llvm-rc

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4219
2020-02-05 09:10:16 -05:00
Brad King
b27004231d Merge topic 'sdcc-no-default-target'
18d2e6fc8f SDCC: Remove default flags for a specific target

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4321
2020-02-05 09:08:13 -05:00
Brad King
a8bcfddb2b Merge topic 'android-ndk-r19-binutils'
e3d3b7ddeb Android: Fix binutils selection with NDK r19+ unified toolchain

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4318
2020-02-04 08:26:40 -05:00
Thomas Bernard
1c2d031cbd Add -E cmake_llvm_rc to preprocess files for llvm-rc
llvm-rc requires preprocessed rc files. The CMake command line tool
cmake_llvm_rc enables channing the preprocessor call and the resource
compiler and make this appear as single compilation step.

When llvm-rc is detected as resource compiler, the RC compilation step
is set to use this command.
2020-02-04 08:19:12 -05:00
fruit
18d2e6fc8f SDCC: Remove default flags for a specific target
Remove defaults for a specific target (8051) because they are incorrect
for other targets.

Fixes: #20308
2020-02-04 07:25:24 -05:00
Brad King
e3d3b7ddeb Android: Fix binutils selection with NDK r19+ unified toolchain
In commit 97bca2f9fa (Android: Use unified toolchain in NDK r19+,
2019-07-26, v3.16.0-rc1~342^2) we hard-coded use of the unified
toolchain for NDK r19+ and skipped most of the old detection logic.
However, in that fast path we left out setting `_CMAKE_TOOLCHAIN_PREFIX`
for `CMakeFindBinutils` to select the matching binutils.  Add it.

Fixes: #20038
2020-02-03 14:35:12 -05:00
Brad King
b81aef19de Merge topic 'windows-gnu-asm'
97de48b528 Tests: Update Assembler code generation to select MSVC runtime library
6348ffb9e5 ASM: Hook up Windows-specific GNU/Clang compiler information modules

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4287
2020-02-03 11:51:34 -05:00
Martin Storsjö
6348ffb9e5 ASM: Hook up Windows-specific GNU/Clang compiler information modules
This allows building .s/.S assembly code, and makes sure that the
`-fPIC` option isn't passed to the compiler (as it errors out on
Clang and causes a loud warning on GCC).
2020-01-31 14:37:34 -05:00
Brad King
afcd9fe669 AIX: Add an option to disable automatic exports from shared libraries
Since commit 0f150b69d3 (AIX: Explicitly compute shared object exports
for both XL and GNU, 2019-07-11, v3.16.0-rc1~418^2~2) we always export
all symbols from shared libraries by default.  Add a new target property
called `AIX_EXPORT_ALL_SYMBOLS` that can be explicitly set to OFF to
suppress this behavior and export no symbols by default.

Fixes: #20290
2020-01-31 09:34:06 -05:00
Brad King
67f30811ce AIX: Improve name of internal symbol export list file 2020-01-31 09:28:07 -05:00
Brad King
0ffd54f094 AIX: Add ExportImportList option to skip the object files 2020-01-31 09:28:07 -05:00
Brad King
0dcfb63cb9 AIX: Revise ExportImportList to build output more incrementally
This will allow more steps to be added.
2020-01-31 09:28:07 -05:00
Brad King
692527d3b7 Merge topic 'aix-skip-exports'
a17f6eff43 AIX: Restore pre-3.16 undocumented method to suppress exports with XL

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4303
2020-01-31 09:14:00 -05:00
Brad King
a17f6eff43 AIX: Restore pre-3.16 undocumented method to suppress exports with XL
In commit 0f150b69d3 (AIX: Explicitly compute shared object exports for
both XL and GNU, 2019-07-11, v3.16.0-rc1~418^2~2) we dropped use of the
old `CMAKE_XL_CreateExportList` cache entry for XL exports.  However,
some people were setting the value to an empty string as a way to
disable automatic export of symbols.  Restore this behavior when the
option is explicitly set to an empty string.

Issue: #20290
2020-01-30 11:38:17 -05:00
Robert Maynard
0d0145138f CUDA: Add abstraction for cuda runtime selection
Fixes #17559
Replace our hard-coded default of cudart=static with a first-class abstraction to select the runtime library from an enumeration of logical names.
2020-01-27 16:02:26 -05:00
Brad King
afbbfe5109 MinGW: Update find_library to not find plain .dll files
Modern distributions of packages built with MinGW tools provide `.dll.a`
import libraries.  Prefer those instead of finding plain `.dll` files.
This avoids accidentally finding unrelated Windows `.dll` files.

Fixes: #20019
2020-01-20 13:31:45 -05:00
Dan Johnston
97c124e30f Ninja: Add a separate job pool for PCH creation
Add a `JOB_POOL_PRECOMPILE_HEADER` target property to specify the pool
name, and its associated `CMAKE_JOB_POOL_PRECOMPILE_HEADER` variable.

Fixes: #20217
2020-01-16 10:32:25 -05:00
Brad King
df1fad32ad Merge topic 'macOS-Xcode-11-frameworks'
fcde42751a FindPython: ensure new Xcode framework for Python3 is detected
dd7b741b81 macOS: Add support for new Xcode 11 frameworks directory

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4198
2020-01-13 10:20:59 -05:00
Brad King
01b43e85cf Merge topic 'macOS-Xcode-11-frameworks' into release-3.16
fcde42751a FindPython: ensure new Xcode framework for Python3 is detected
dd7b741b81 macOS: Add support for new Xcode 11 frameworks directory

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4198
2020-01-13 10:20:58 -05:00
Brad King
ba3552dce5 Merge topic 'GNUtoMS-vs2019'
08c5b3eff0 GNUtoMS: Add search path for VS 2019 environment scripts

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4197
2020-01-10 13:20:03 -05:00
Marc Chevrier
dd7b741b81 macOS: Add support for new Xcode 11 frameworks directory
Update CMAKE_SYSTEM_FRAMEWORK_PATH with new Xcode 11 frameworks directory
2020-01-10 13:48:39 +01:00
Brad King
08c5b3eff0 GNUtoMS: Add search path for VS 2019 environment scripts
Extend the logic from commit abe8a623d9 (GNUtoMS: Add search path for VS
2017 environment scripts, 2017-05-19, v3.8.2~1^2) to consider VS 2019
paths too.

Fixes: #20162
2020-01-09 16:56:30 -05:00
Saleem Abdulrasool
576c2e7a2d Swift: move windows handling into platform file (NFC)
This moves the definition of the import library flags for Windows into a
platform specific file (much like the Darwin `-sdk` flag).  This is in
preparation for re-use of the flag to make the flags handling for
executables more precise.
2019-12-21 18:25:54 -08:00
Brad King
671ed5b123 Merge topic 'fat-ios'
a9b41195d2 Handle multi-arch sysroots on Apple platforms
372c89ea38 Refactor -arch and -isysroot code usage
7a44e16d7f Refactor SDK name to path into a function
777d364913 Use xcrun instead of xcodebuild for resolving SDK path

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4125
2019-12-17 11:07:09 -05:00
Tor Arne Vestbø
a9b41195d2 Handle multi-arch sysroots on Apple platforms 2019-12-13 16:35:38 +01:00
Cristian Adam
7a44e16d7f Refactor SDK name to path into a function 2019-12-11 11:55:46 +01:00
shibayan
ea882b4aa9 MSVC: Fixed missing import library for Windows 10 ARM64 (Desktop)
Add the same import library as x86/x64 by default for Windows 10 ARM64 (Desktop, not UWP).

Fixes: #20077
2019-12-11 02:40:46 +09:00
Tor Arne Vestbø
777d364913 Use xcrun instead of xcodebuild for resolving SDK path
It's much cheaper to run.
2019-12-09 14:55:48 +01:00
Robert Maynard
7f15c99851 CUDA: forward unknown flags to host compiler when possible.
Starting with CUDA 10.2 the nvcc compiler has gained support
to automatically forward unknown flags to the host compiler.

This behavior is highly desired as projcts that mix CUDA, C, C++
run into situation where flags such as `-pthread` which aren't
supported by nvcc, are being applied to all source files and
therefore break CUDA compilation.
2019-11-29 14:21:35 -05:00
Johnny Jazeix
5cf404d36f SDCC compiler: use sdar instead of sdcclib as librarian for recent versions
Fixes: #19988
2019-11-18 20:12:49 +01:00
Kyle Edwards
5695b0464b Merge topic 'cmake-e-rm'
2d0100fac7 replace remove and remove_directory with rm in tests
5239fc5c75 cmake -E: Add rm with improved semantics over remove and remove_directory

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3949
2019-11-15 09:57:56 -05:00
Johnny Jazeix
2d0100fac7 replace remove and remove_directory with rm in tests 2019-11-13 18:02:18 -05:00
Brad King
b75882c2f7 Merge topic 'objc-link-main'
db91c5f776 ObjC: Set same settings for all languages supported on Darwin

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4012
2019-11-11 10:24:02 -05:00
Cristian Adam
db91c5f776 ObjC: Set same settings for all languages supported on Darwin
Fixes: #19928
2019-11-08 00:50:55 +01:00
Brad King
13ea5f06fa Merge topic 'objc-pch'
e331367a89 PCH: Add support for OBJC/OBJCXX languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3983
2019-11-05 11:24:55 -05:00
Craig Scott
9667996923 Merge topic 'message-check-types'
7b2dd9dedc Refactor: Use added message types in various modules
949a1e120a message: New message types to mark checks performed by CMake

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3689
2019-11-04 14:11:45 -05:00
Cristian Adam
e331367a89 PCH: Add support for OBJC/OBJCXX languages 2019-11-03 21:34:39 +01:00
Alex Turbov
7b2dd9dedc Refactor: Use added message types in various modules
Co-Authored-By: Craig Scott <craig.scott@crascit.com>
2019-11-02 14:10:09 +02:00
Brad King
c5e22dfaea Merge topic 'swift-sdk-on-mac'
c10c9f839a Swift: Honor CMAKE_OSX_SYSROOT on Apple platforms

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3957
2019-10-29 11:15:09 -04:00
Brad King
c10c9f839a Swift: Honor CMAKE_OSX_SYSROOT on Apple platforms
Pass the value to the Swift compiler driver via `-sdk`.  We already do
this for C/C++ via `-isysroot`.

This fixes command-line builds on macOS 10.15 with Xcode 11 Swift tools.

Fixes: #19880
2019-10-28 11:52:31 -04:00
Butta
c5892e484e Android: add support for native compilation, such as with the Termux app
The CMake support for Android assumes cross-compilation using the NDK,
so stub out that Android NDK support and use the Linux support that's
already invoked. Set CMAKE_HOST_SYSTEM_NAME to "Android", rather than
"Linux".

Issue: #19840
2019-10-15 21:13:51 +05:30
Gregor Jasny
1a3a62251b Apple: Set Clang ASM compiler features
The same is done for the C and CXX language. This initializes
compiler flags like the sysroot path or deployment target.

Closes: #19794
Suggested-by: Kyle Fleming
2019-10-09 09:18:33 -04:00
Gregor Jasny
638fa41234 Apple: Set Clang ASM compiler features
The same is done for the C and CXX language. This initializes
compiler flags like the sysroot path or deployment target.

Closes: #19794
Suggested-by: Kyle Fleming
2019-10-07 20:51:01 +02:00
Cristian Adam
bc4f8f4472 PCH: Use clang's own pch functionality instead of the GCC emulation
Fixes: #19786
2019-10-03 14:43:00 +02:00