1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-18 01:38:44 +08:00

1108 Commits

Author SHA1 Message Date
Brad King
f10682b796 Merge topic 'ispc_lang_support'
5ece12b7e4 gitlab-ci: add ISPC to the Fedora CI image
8976817d6d ISPC: Update help documentation to include ISPC
2368f46ba4 ISPC: Support building with the MSVC toolchain
e783bf8aa6 ISPC: Support ISPC header generation byproducts and parallel builds
34cc6acc81 Add ISPC compiler support to CMake
419d70d490 Refactor some swift only logic to be re-used by other languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5065
2020-09-01 09:15:39 -04:00
Robert Maynard
e783bf8aa6 ISPC: Support ISPC header generation byproducts and parallel builds 2020-08-28 11:21:31 -04:00
Brad King
5e212cafba Merge topic 'osx_asm_architectures'
940fc62962 macOS: Respect OSX_ARCHITECTURES for ASM

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5152
2020-08-25 10:40:20 -04:00
Raul Tambre
940fc62962 macOS: Respect OSX_ARCHITECTURES for ASM
Fixes #20771.
2020-08-22 09:16:21 +03:00
Kyle Edwards
3ef0c40962 WIN32_EXECUTABLE: Add support for generator expressions 2020-08-21 09:17:27 -04:00
Brad King
0953c0051e Merge topic 'clang-cl-vfs'
20ebaed972 Clang: Add support for passing VFS arguments
d993ebd4ca clang-cl: Add '--' before source file
a94672b919 cmake: Change cmake_llvm_rc separator from -- to ++ to avoid conflict

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5087
2020-08-10 11:33:19 -04:00
Thomas Bernard
20ebaed972 Clang: Add support for passing VFS arguments 2020-08-07 11:52:45 -04:00
Brad King
89e5f95c2b Merge topic 'reuse_pch_no_delay'
ef97fbe6c2 PCH: Avoid unnecessary 30s delay on MSBuild Generator with REUSE_FROM

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5102
2020-08-06 10:39:47 -04:00
Cristian Adam
ef97fbe6c2 PCH: Avoid unnecessary 30s delay on MSBuild Generator with REUSE_FROM
Fix logic added by commit 1f791eb160 (Multi-Ninja: Fix reusable PCHs for
MSVC, 2020-05-24, v3.18.0-rc1~72^2) to avoid an unnecessary delay.

Fixes: #21054
2020-08-05 15:52:05 -04:00
Brad King
8878f59cf9 Merge topic 'unity_no_skip_autogen'
7051250a6c Unity Builds: Do not set SKIP_AUTOGEN to source files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5081
2020-07-30 08:28:49 -04:00
Cristian Adam
7051250a6c Unity Builds: Do not set SKIP_AUTOGEN to source files
Fixes: #21028
2020-07-29 17:57:50 +02:00
Vitaly Stakhovsky
f37c14e930 Source: use cmNonempty() 2020-07-28 08:31:31 -04:00
Brad King
2f0790df50 Factor out generator checks for filtering on non-compiling targets
Add a `cmGeneratorTarget::CanCompileSources` helper method to tell
generators whether a target might compile anything.
2020-07-23 13:31:45 -04:00
Brad King
422d9a0ab2 Factor out generator checks for filtering out interface libraries
Add a `cmGeneratorTarget::IsInBuildSystem` helper method to tell
generators whether a target should participate in the generated build
system.
2020-07-23 13:31:44 -04:00
Jean-Christophe Fillion-Robin
207373802e Fix typos identified using codespell
See https://github.com/codespell-project/codespell#readme

The following command was used:

```
codespell -q6 --skip="\
.git,\
*.json,\
./Copyright.txt,\
./Help/command/foreach.rst,\
./Help/prop_test/REQUIRED_FILES.rst,\
./Help/variable/CTEST_COVERAGE_COMMAND.rst,\
./Modules/CMakeCheckCompilerFlagCommonPatterns.cmake,\
./Modules/CMakeRCInformation.cmake,\
./Modules/Internal/CPack/NSIS.template.in,\
./Modules/FindMatlab.cmake,\
./Modules/MatlabTestsRedirect.cmake,\
./Modules/Platform/Windows-Clang.cmake,\
./Modules/Platform/Windows-Intel-Fortran.cmake,\
./Modules/Platform/Windows-MSVC.cmake,\
./Source/CMakeVersion.cmake,\
./Source/cmConvertMSBuildXMLToJSON.py,\
./Source/cmCreateTestSourceList.cxx,\
./Source/cmGlobalVisualStudio10Generator.cxx,\
./Source/cmExportBuildFileGenerator.cxx,\
./Source/cmExportInstallAndroidMKGenerator.cxx,\
./Source/cmExportInstallFileGenerator.cxx,\
./Source/cmExportSet.cxx,\
./Source/cmExportTryCompileFileGenerator.cxx,\
./Source/cmFindPackageCommand.cxx,\
./Source/cmInstallCommand.cxx,\
./Source/cmGeneratorExpressionLexer.cxx,\
./Source/cmLocalVisualStudio7Generator.cxx,\
./Source/cmOrderDirectories.cxx,\
./Source/cmTarget.cxx,\
./Source/kwsys/*,\
./Source/QtDialog/CMakeSetupDialog.ui,\
./Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx,\
./Source/CTest/cmParseCoberturaCoverage.h,\
./Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in,\
./Tests/RunCMake/CPack/tests/DMG_SLA/English.license.rtf,\
./Tests/RunCMake/CPack/tests/DMG_SLA/German.license.txt,\
./Tests/RunCMake/CPack/tests/DMG_SLA/German.menu.txt,\
./Tests/RunCMake/GoogleTest/xml_output.cpp,\
./Tests/RunCMake/Make/TargetMessages*,\
./Utilities/*,\
" \
-L "\
dependees,\
endwhile,\
fo,\
filetest,\
helpfull,\
nd,\
objext,\
stoll,\
supercedes,\
superceded,\
vas,\
varn,\
"
```
2020-07-22 12:44:47 -04:00
Brad King
4662c041ea Merge topic 'move_more_queries_to_cmStandardLevelResolver'
56cf509a72 Move AddCompilerRequirementFlag to cmStandardLevelResolver

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4989
2020-07-16 10:17:52 -04:00
Kyle Edwards
63ecf481da Merge topic 'cmnonempty'
eaad8072ee cmNonempty: Convenience inlines to check for non-empty string

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5017
2020-07-15 10:53:43 -04:00
Robert Maynard
56cf509a72 Move AddCompilerRequirementFlag to cmStandardLevelResolver
The cmLocalGenerator::AddCompilerRequirementFlag was another
source of truth on what standard levels existed per language,
so fold that into cmStandardLevelResolver to make updating
CMake easier
2020-07-15 09:40:33 -04:00
Vitaly Stakhovsky
eaad8072ee cmNonempty: Convenience inlines to check for non-empty string 2020-07-14 15:18:59 -04:00
Vitaly Stakhovsky
7156911242 cmIsOn: add overload accepting const std::string* 2020-07-14 08:22:24 -04:00
Vitaly Stakhovsky
18726ad634 GetFeature(): return cmProp 2020-07-11 14:03:03 -04:00
Brad King
a4cfc7d03c Merge topic 'refactor-generator-configs'
7a969fe21d cmMakefile: Refactor API to better handle empty config values

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4957
2020-07-06 09:28:11 -04:00
Robert Maynard
7a969fe21d cmMakefile: Refactor API to better handle empty config values 2020-07-03 07:43:18 -04:00
Robert Maynard
dc94b0249e cmStandardLevelResolver: Added to handle standard level queries
Refactored out of cmMakefile
2020-07-01 07:58:58 -04:00
Rahul Gottipati
27b03281e2 configure_file: Add option to control file permissions transfer to copy
Issue: #20866
2020-06-30 11:20:41 -04:00
Brad King
e0b21ad924 Merge topic 'languageStandardRefactor'
742ff97f80 Refactor language standard computation
0892c798f7 cmMakefile: Change CompileFeatureKnown to take target name instead of target

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4803
2020-06-18 09:47:41 -04:00
Justin Goshi
742ff97f80 Refactor language standard computation
Instead of mutating the configure-time cmTarget's properties at generate
time, compute and store it in a cmGeneratorTarget field.
2020-06-16 16:32:34 -07:00
Raul Tambre
fec7dd33d3 CUDA: Add issue number to Clang separable compilation error 2020-06-16 14:07:30 -04:00
Raul Tambre
0a056246a1 CUDA: Pass toolkit path to Clang
Clang isn't very good at finding the installed CUDA toolkit.
The upstream recommendation is that we should pass the toolkit explicitly.

Additionally:
* Avoids Clang having to search for the toolkit on every invocation.
* Allows the user to use a toolkit from a non-standard location by simply
  setting CUDAToolkit_ROOT. The same way as with FindCUDAToolkit.

Clang wants the directory containing the device library and version.txt as the
toolkit path.
We thus pass the newly introduced CUDAToolkit_LIBRARY_ROOT as the toolkit path.

We save CUDAToolkit_ROOT_DIR and CUDAToolkit_LIBRARY_ROOT on Clang to have them
available in try_compile() and avoid unnecessary re-searching or a possibly
different installation being found in FindCUDAToolkit.
This however means that the selected toolkit can't be changed after the initial
language enablement.

We now determine CUDA compiler ID before doing actual detection, as we don't
want to spend time finding the CUDA toolkit for NVIDIA.

Implements #20754.
2020-06-12 21:50:05 +03:00
Brad King
efac04465c Merge topic 'cuda_clang_separable_error'
b1243201e7 CUDA: Don't RunCMake generate separable compilation tests on Clang
1b4c690543 CUDA: Throw error if CUDA_SEPARABLE_COMPILATION is ON when using Clang

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4827
2020-06-05 07:56:19 -04:00
Raul Tambre
1b4c690543 CUDA: Throw error if CUDA_SEPARABLE_COMPILATION is ON when using Clang
Separable compilation isn't supported yet on Clang.
Let's throw a helpful error instead of confusing errors during the build.
2020-06-02 22:09:10 +03:00
Marc Chevrier
056489d567 add_library/add_executable: allow local alias to imported targets
Fixes: #20641
2020-06-02 17:11:47 +02:00
Brad King
a432b1075c Merge topic 'getdef-expand'
7ed8c9ebe3 cmMakefile: add GetDefExpandList() that splits value into std::vector

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4819
2020-06-02 08:02:24 -04:00
Vitaly Stakhovsky
b36d1bdd9d Single location for cmProp typedef 2020-06-01 08:54:20 -04:00
Vitaly Stakhovsky
7ed8c9ebe3 cmMakefile: add GetDefExpandList() that splits value into std::vector
Combines cmMakefile:GetDefinition() and cmExpandList()
2020-05-30 08:59:20 -04:00
Cristian Adam
1f791eb160 Multi-Ninja: Fix reusable PCHs for MSVC
Fixes: #20721
2020-05-27 14:19:03 -04:00
Cristian Adam
8f2702005a AutoMoc: Configure AutoMoc after generated sources (PCH, Unity)
Fixes: #20119
2020-05-26 13:14:27 +02:00
Cristian Adam
f6cb1e646c Multi-Ninja: Fix PCHs for Visual C++
Fixes: #20711
2020-05-20 11:20:38 +02:00
Brad King
cee7eb8b3a Merge topic 'unity_explicit_groups'
9f4eb352fe Unity Builds: Support explicit specification of sources to groups
b00585adcc Unity: Refactor implementation to make it easier to extend

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4716
2020-05-11 10:08:12 -04:00
Robert Maynard
9f4eb352fe Unity Builds: Support explicit specification of sources to groups
Instead of having CMake determine which files should go into each
unity file, the user can now use explicitly state the mapping.
2020-05-07 11:13:34 -04:00
Andreas Schönle
605d6c65c9 PCH: Fix REUSE_FROM in multi-config generators
Since commit a55df20499 (Multi-Ninja: Add precompile headers support,
2020-01-10, v3.17.0-rc1~136^2) the re-used PCH file object is added
once for each configuration to flags used for all configurations.
Put it in the flags for only the corresponding configuration instead.

Fixes: #20680
2020-05-07 09:58:44 -04:00
Robert Maynard
b00585adcc Unity: Refactor implementation to make it easier to extend 2020-05-06 15:56:16 -04:00
Vitaly Stakhovsky
53675adbcf GetSafeProperty: return std::string const& 2020-04-30 10:27:16 -04:00
Vitaly Stakhovsky
36aba01223 cmGeneratorTarget::GetProperty: return cmProp 2020-04-29 10:59:39 -04:00
Brad King
5a57cec2f4 Merge topic 'apple-merge-same-sysroot'
3a7d1e9592 Apple: Merge per-arch sysroot parameters if all are the same

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4647
2020-04-22 08:32:02 -04:00
Gregor Jasny
3a7d1e9592 Apple: Merge per-arch sysroot parameters if all are the same
Since commit a9b41195d2 (Handle multi-arch sysroots on Apple platforms,
2019-07-26, v3.17.0-rc1~287^2), CMake supports "fat" builds with
different sysroots. Those are passed to the compiler with the
`-Xarch_<xyz>` parameter.

Unfortunately this breaks the Compiler Cache (ccache) because
it does not support those compiler flags:

    https://github.com/ccache/ccache/blob/v3.7.9/src/ccache.c#L2700-L2705

Restore the caching ability for certain "fat" build configurations (e.g.
`arm64` and `armv7`) where the sysroot is the same for all selected
architectures and thus a plain `-isysroot` parameter could be used.
2020-04-21 11:18:12 -04:00
Marc Chevrier
4248bb452a CUDA: Device linking use now link options
properties LINK_OPTIONS and INTERFACE_LINK_OPTIONS are propagated
to the device link step.

To control which options are selected for normal link and device link steps,
the $<DEVICE_LINK> and $<HOST_LINK> generator expressions can be used.

Fixes: #18265
2020-04-19 15:53:11 +02:00
Marc Chevrier
aacd4e4a90 Refactoring: add cm::contains to <cmext/algorithm> 2020-04-17 10:00:03 +02:00
Brad King
7e8df1bb24 Merge topic 'cuda_architectures'
21131ca60c CUDA: Add CudaOnly.CompileFlags test
f0931b0790 CUDA: Convert tests to use CUDA_ARCHITECTURES
e98588aaba CUDA: Add CUDA_ARCHITECTURES target property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Patrick Stotko <stotko@cs.uni-bonn.de>
Merge-request: !4568
2020-04-16 11:11:33 -04:00
Raul Tambre
e98588aaba CUDA: Add CUDA_ARCHITECTURES target property
Simplifies CUDA target architecture handling.

Required for Clang support as Clang doesn't automatically select a supported architecture.
We detect a supported architecture during compiler identification and set CMAKE_CUDA_ARCHITECTURES to it.

Introduces CMP0104 for backwards compatibility with manually setting code generation flags with NVCC.

Implements #17963.
2020-04-15 17:55:41 +03:00