1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-21 12:10:05 +08:00

25 Commits

Author SHA1 Message Date
Evan Wilde
e88509d0e8
Swift: Omit output-file-map when used as a linker
Swift is used as the linker for non-swift files because it needs to pull
files like swiftrt.o in when swift symbols are present to ensure that
the swift runtime is linked.

The swift driver uses clang as the underlying linker, which pulls in
crtbegin.o and friends when appropriate, so using Swift as a linker for
C/C++ libraries is fine.

The output-file-map was getting passed to all Swift invocations,
regardless of whether or not we generated one. This patch changes it so
that we only include the output-file-map in the Swift compiler
invocation if we have actually generated the file.
2022-10-28 16:44:26 -07:00
Marc Chevrier
78dd7d5292 cmRulePlaceholderExpander: add base class for placeholder expansion reuse 2022-02-06 14:32:24 +01:00
Robert Maynard
61b9764b03 CUDA: Allow both CUDA_SEPARABLE_COMPILATION and CUDA_PTX_COMPILATION
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.
2021-10-20 11:18:06 -04:00
Bobby D Reynolds
ae108418ae Launchers: Support setting linker launchers
Fixes: #18316
2021-05-28 12:28:43 -04:00
Brad King
4b23359117 ninja: Add experimental infrastructure for C++20 module dependency scanning
Optionally enable this infrastructure through an undocumented
`CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP` variable.  Currently this is
experimental and intended for use by compiler writers to implement their
scanning tools.  Warn as such when the feature is activated.  Later when
compilers provide the needed scanning tools we can enable this variable
from our corresponding compiler information modules.  It is never meant
to be set by project code.

When enabled, generate a build graph similar to what we use for Fortran
module dependencies.  There are some differences needed because we can
scan dependencies without explicit preprocessing, and can directly
compile the original source afterward.

Co-Author: Ben Boeckel <ben.boeckel@kitware.com>
2021-01-05 09:34:55 -05:00
Marc Chevrier
3401403f69 Refactoring: Introduce place-holder for dependency target.
These changes are in preparation of compiler generated dependencies support
for Makefiles generators

* compiler output and dependency target can be different for Makefiles generators
* resolve inconsistency naming for dependency file place-holder
2020-11-28 16:02:58 +01:00
Raul Tambre
c63fe01835 CUDA: Clang separable compilation
For NVCC the compiler takes care of device linking when passed the "-dlink"
flag.
Clang doesn't support such magic and requires the buildsystem to do the work
that NVCC does behind the scenes.

The implementation is based on Bazel's device linking documentation:
7cabcdf073/third_party/nccl/build_defs.bzl.tpl (L259)

Closes: #20726
2020-09-24 15:19:54 -04:00
Kitware Robot
bdca8b01d2 Modernize: Use #pragma once in all header files
#pragma once is a widely supported compiler pragma, even though it is
not part of the C++ standard. Many of the issues keeping #pragma once
from being standardized (distributed filesystems, build farms, hard
links, etc.) do not apply to CMake - it is easy to build CMake on a
single machine. CMake also does not install any header files which can
be consumed by other projects (though cmCPluginAPI.h has been
deliberately omitted from this conversion in case anyone is still using
it.) Finally, #pragma once has been required to build CMake since at
least August 2017 (7f29bbe6 enabled server mode unconditionally, which
had been using #pragma once since September 2016 (b13d3e0d)). The fact
that we now require C++11 filters out old compilers, and it is unlikely
that there is a compiler which supports C++11 but does not support
#pragma once.
2020-09-03 09:30:21 -04:00
Robert Maynard
e783bf8aa6 ISPC: Support ISPC header generation byproducts and parallel builds 2020-08-28 11:21:31 -04: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
Saleem Abdulrasool
b6412e3e38 Ninja: add placeholders to support Swift build
Add the placeholders needed to support compiling Swift code.
2019-05-16 14:41:05 -04:00
Saleem Abdulrasool
d688c4c19d Swift: remove unnecessary unreleased Ninja infrastructure
This cleans up the new options that were added to support Swift.  This
was not released, and the proper support approach that we settled upon
does not require as much specialised support.
2019-05-16 14:41:05 -04:00
Saleem Abdulrasool
001446126e Ninja: add final placeholders to merge Swift partials
This adds the placeholders that are needed to merge the swift partial
modules.  It permits generating the rules necessary to actually merge
the partial modules emitted for a partial compilation.
2019-02-20 09:25:34 -08:00
Saleem Abdulrasool
c048cb75fc Ninja: add properties for Swift partial module and doc
When building a swift object, we emit a partial swiftmodule and swiftdoc
that must be merged at the end.  However, in order to do that, we need
to enumerate the swiftmodules and swiftdocs.  As a result, the path must
be known to CMake.  Rather than hardcoding the rules into CMake, create
a source property that we can query.  This will allow us to create a
final placeholder to emit the merge rule.

Issue: #18800
2019-02-18 11:15:47 -08:00
Saleem Abdulrasool
157570b5a2 Add placeholder for Swift's library name
This allows us to set the proper link name for the Swift library
(soname).  Because this needs to be passed to the object being compiled,
we need to create a new placeholder so that it can be sent along to the
frontend.  Default to the target name unless it is explicitly provided.
2019-02-13 09:25:29 -08:00
Regina Pfeifer
5a0784ddea clang-tidy: Pass by value 2019-01-22 13:03:04 -05:00
Saleem Abdulrasool
0ffe8f8844 Ninja: support SWIFT_MODULE_NAME property
Add a new `SWIFT_MODULE_NAME` property that defaults to the target name.
This is needed as otherwise, the first source file determines the module
name.

Issue: #18800
2019-01-18 07:52:17 -05:00
Saleem Abdulrasool
b90e6134a7 Ninja: add new placeholder SWIFT_AUXILIARY_SOURCES
The swift compilation model requires all sources for the module to be
listed for the compiler to type check across them.  Provide a
placeholder to allow enumerating the remainder of the swift sources in a
target for the language compile rule.

Issue: #18800
2019-01-15 09:13:33 -08:00
luz.paz
193082a3c8 MAINT: Misc. typos
Found via `codespell -q 3 -I ../cmake-whitelist.txt`.
2018-02-13 11:24:30 -05:00
Brad King
53e89b6ab0 Add options for separate compile and link sysroots
Add `CMAKE_SYSROOT_COMPILE` and `CMAKE_SYSROOT_LINK` variables to as
operation-specific alternatives to `CMAKE_SYSROOT`.  This will be useful
for Android NDKs that compile and link with different sysroot values
(e.g. `r14` with unified headers).

Co-Author: Florent Castelli <florent.castelli@gmail.com>
2017-05-09 14:21:54 -04:00
Daniel Pfeifer
1d829c862c Use quotes for non-system includes
Automate with:

git grep -l '#include <cm_' -- Source \
  | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g'

git grep -l '#include <cmsys/' -- Source \
  | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g'

git grep -l '#include <cm[A-Z]' -- Source \
  | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
2017-04-11 22:35:21 +02:00
Brad King
ce71bd9505 Merge topic 'fix-ctest-launchers'
db61cd5d cmRulePlaceholderExpander: Remove unused member RuleLauncher
b7771078 Comment ExpandRuleVariables calls not preceded by launcher insertion
c58a5198 Makefile: Restore RULE_LAUNCH_COMPILE generation on compilation rules
2016-12-12 14:21:20 -05:00
Brad King
db61cd5d72 cmRulePlaceholderExpander: Remove unused member RuleLauncher 2016-12-09 08:59:17 -05:00
Daniel Pfeifer
2e620f0b38 Fix several include-what-you-use findings 2016-11-08 09:42:04 -05:00
Stephen Kelly
bdddd4234e cmRulePlaceholderExpander: Extract from cmLocalGenerator
Implement cmLocalGenerator::ExpandRuleVariables in terms of the new
class for source compatibility and to reduce diff noise in this commit.
2016-10-15 11:25:12 +02:00