420 Commits

Author SHA1 Message Date
Brad King
941c09616b Merge topic 'multi-ninja-pch'
a55df20499 Multi-Ninja: Add precompile headers support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4201
2020-01-20 11:59:28 -05:00
Brad King
56a3e84a67 Merge topic 'realpath-cache'
9d5a554cc9 cmGlobalGenerator: Add cache for realpath() results

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4220
2020-01-20 11:55:04 -05:00
Cristian Adam
a55df20499 Multi-Ninja: Add precompile headers support
Fixes: #19789
2020-01-17 23:17:35 +01:00
Tim Blechmann
9d5a554cc9 cmGlobalGenerator: Add cache for realpath() results
Cache the results of `realpath()` system calls in `cmGlobalGenerator`
to avoid repeating such calls for the same paths over and over.
2020-01-16 11:29:25 +08:00
Marc Chevrier
a00960288b GlobalGenerator family: modernize memory management 2020-01-07 11:03:11 +01:00
Marc Chevrier
5444a8095d cmGlobalGenerator: modernize memrory managemenbt 2019-12-30 16:55:39 +01:00
Marc Chevrier
f7d12609f0 Refactoring: use append functions from cmext/algorithm 2019-12-17 10:44:02 +01:00
Kyle Edwards
5a8a9f7229 Ninja: Add multi-config variant
Co-Authored-by: vector-of-bool <vectorofbool@gmail.com>
2019-12-13 10:51:46 -05:00
Marc Chevrier
36c8cae2e8 cmLocalGenerator: modernize memory management 2019-12-10 00:24:06 +01:00
Alexander Boczar
99e83d4235 cmake: Teach --build mode to load CMAKE_GENERATOR_TOOLSET
Extend the `cmGlobalGenerator::SetGeneratorToolset` signature to
indicate when it is called from `cmake::build`.
2019-10-15 13:28:41 -04:00
Brad King
f1fb63b306 file(GENERATE): Create output file structures even earlier
Since commit b80557c7bd (file(GENERATE): Evaluate early to allow
generating source files, 2014-11-04, v3.2.0-rc1~398^2) we create the
`cmSourceFile` instances marked with a `GENERATED` source file property
before tracing source dependencies.  Move it to even earlier so that
steps in `cmGlobalGenerator::AddAutomaticSources` can operate on all
sources.  This also avoids the accidental `O(n^2)` calls for `n` local
generators that we had previously.

This is also needed since commit 83c1657ff7 (Unity build: Generate
sources during Compute step, 2019-10-03) to support `file(GENERATE)`
outputs as sources in a target with `UNITY_BUILD` enabled.
2019-10-07 15:22:12 -04:00
Brad King
83c1657ff7 Unity build: Generate sources during Compute step
The unity build sources need to be added for all generators.  Create
them during `cmGlobalGenerator::Compute` to avoid duplicating the calls
in every generator.  We already handle Qt autogen there too.

Issue: #19789
2019-10-03 14:55:22 -04:00
Brad King
d57c1a5b31 Merge topic 'clang-format-normalize-headers-presentation'
ed98209ddc Revise include order using clang-format-6.0
185fe49f29 clang-format: Normalize headers presentation
42ef28b4f3 Remove unused uid_t/gid_t types on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sebastian Holtermann <sebholt@web.de>
Merge-request: !3851
2019-10-02 07:53:43 -04:00
Cristian Adam
e6e189e02b PCH: Report error when setting COMPILE_PDB_NAME property
Reusable precompile headers require specific COMPILE_PDB_NAME property
values. Report error if the user tries to set a different value.
2019-10-01 18:33:40 +02:00
Kitware Robot
ed98209ddc Revise include order using clang-format-6.0
Run the `clang-format.bash` script to update our C and C++ code to a new
include order `.clang-format`.  Use `clang-format` version 6.0.
2019-10-01 12:26:36 -04:00
Brad King
dce58afd30 Merge branch 'backport-3.15-fix-EXCLUDE_FROM_ALL-subdir-all'
Resolve conflicts with changes since the 3.15 series:

* Convert `cmSystemTools::IsOn` => `cmIsOn`.
* Move one "EXCLUDE_FROM_ALL" target property logic fix to
  its new location in `cmMakefile::AddNewUtilityTarget`.
2019-09-30 09:34:57 -04:00
Brad King
05d7ca14e9 Merge branch 'backport-3.14-fix-EXCLUDE_FROM_ALL-subdir-all' 2019-09-30 09:19:21 -04:00
Brad King
b3b1c7bf3a Restore "all" target in subdirectories marked EXCLUDE_FROM_ALL
The "all" target in each directory is supposed to have targets from that
directory even if the directory itself is marked `EXCLUDE_FROM_ALL` in
its parent.  This was broken by commit dc6888573d (Pass EXCLUDE_FROM_ALL
from directory to targets, 2019-01-15, v3.14.0-rc1~83^2) which made the
participation of a target in "all" independent of context.  Revert much
of the logic change from that commit to restore the old behavior.  Then
re-implement the behavior intended by the commit to keep its test
working.  Extend the test to cover the old behavior too.

Fixes: #19753
2019-09-30 09:18:20 -04:00
Daniel Eiband
0965bd9c06 Generators: Remove function declarations which do not have a definition 2019-09-21 12:55:37 +02:00
Tushar Maheshwari
71f088f53a cmExportSet: subsume cmExportSetMap source files 2019-09-19 19:20:30 +05:30
Regina Pfeifer
a1ddf2d0ba clang-tidy: Replace typedef with using
Automate the conversion with

  perl -i -0pe 's/typedef ([^;]*) ([^ ]+);/using $2 = $1;/g'

then manually fix a few places.
2019-09-04 18:03:01 +02:00
Regina Pfeifer
62e5f72289 clang-tidy: Replace typedef with using 2019-09-03 13:21:26 -04:00
Kitware Robot
54e9d38c28 Refactor: Convert all instances of CMAKE_BUILD_WITH_CMAKE to CMAKE_BOOTSTRAP 2019-08-09 10:41:44 -04:00
Sebastian Holtermann
f71f7ce3f0 cmStringAlgorithms: Move string functions to the new cmStringAlgorithms.h
This adds the `cmStringAlgorithms.h` header and moves all string functions
from `cmAlgorithms.h` to `cmStringAlgorithms.h`.
2019-07-29 21:13:56 +02:00
Brad King
71fbebd1dc IWYU: Fix handling of <memory> standard header
An old workaround for `std::allocator_traits<>::value_type` lints from
IWYU on `std::vector<>` usage breaks IWYU's handling of `<memory>`.
Convert the workaround to use the same approach we already use for a
workaround of `std::__decay_and_strip<>::::__type` lints.  Then update
the `<memory>` inclusions to follow the now-correct IWYU lints.
2019-07-10 11:48:56 -04:00
Alex Turbov
5e52de7d57 modermize: replace some raw pointers w/ unique_ptr 2019-06-24 09:36:09 -04:00
Saleem Abdulrasool
b06f4c8a74 Swift: disallow WIN32_EXECUTABLE properties
Currently, the compiler does not synthesize the correct entry point for
the application and passing the subsystem flag does not work the same
way with the Swift linker language.  Add a check to prevent the
application of `WIN32_EXECUTABLE` to Swift executables until they can be
properly supported.  This will prevent the need for a future policy
change.

Closes: #19325
2019-06-03 14:05:10 -04:00
Sebastian Holtermann
006229278b Use cmAppend to append ranges to std::vector instances 2019-05-23 16:19:49 +02:00
Sebastian Holtermann
735c6f39d9 Fix invalid ///! doxygen comment line starts
In various places `///!` was used to start a comment line.  This is not valid
Doygen syntax.  This patch replaces `///!` comment starts with `//!`.
2019-03-31 11:27:12 +02:00
Bartosz Kosiorek
324d18bb34 cmake: Teach --build mode to support multiple targets
Fixes: #16136
2019-03-05 08:55:28 -05:00
Bartosz Kosiorek
ebc94500c1 cmGlobalGenerator: Optimize Printable() method from GeneratedMakeCommand 2019-03-04 10:44:15 +01:00
Bartosz Kosiorek
fdeb364a84 cmGlobalGenerator: Change case of methods from GeneratedMakeCommand struct 2019-03-04 10:44:14 +01:00
Brad King
d75fec5a88 Merge topic 'tidy-use-equals-default'
094f01d0f0 cleanup: Prefer compiler provided special member functions
55671b41d2 clang-tidy: Use `= default`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Brad King <brad.king@kitware.com>
Merge-request: !2841
2019-01-29 14:07:24 -05:00
Brad King
9620cb935a Merge topic 'add_consistent_verbose_build_flag'
66801f4d40 cmake: Add tests for verbose output to --build mode
439fe2e253 cmake: Add options for verbose output to --build mode
638667efa2 cmake: cmcmd.cxx fix "The arguments are" comments
3ca4402966 ctest: Fix --build-and-test without --build-target on Xcode
cb6c233ecc cmake: Add -hideShellScriptEnvironment xcodebuild option
1a45266cb5 cmGlobalGenerator: Add a class that represent the build command

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2708
2019-01-29 09:19:39 -05:00
Robert Maynard
1a45266cb5 cmGlobalGenerator: Add a class that represent the build command
This refactors a std::vector<std::string> into a class so that
we can extend the features to represent things such as multiple
chained commands in the future.
2019-01-25 08:20:02 -05:00
Brad King
40628b2519 Merge topic 'max-recursion-depth'
a6982cff0d cmMakefile: Impose maximum recursion limit

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Juraj Oršulić <juraj.orsulic@fer.hr>
Merge-request: !2746
2019-01-25 08:09:37 -05:00
Regina Pfeifer
094f01d0f0 cleanup: Prefer compiler provided special member functions 2019-01-25 06:45:00 -05:00
Regina Pfeifer
55671b41d2 clang-tidy: Use = default
Suppress some cases in `Source/cmGeneratorExpressionNode.cxx` and
`Source/cmUVHandlePtr.h` where a few older compilers require a
user-defined default constructor (with `{}`).
2019-01-25 06:44:32 -05:00
Kyle Edwards
a6982cff0d cmMakefile: Impose maximum recursion limit
In order to keep infinitely-recursive scripts from causing a stack
overflow in the CMake executable, CMake now imposes a maximum
recursion limit before issuing an error message. The limit can be
adjusted at runtime with CMAKE_MAXIMUM_RECURSION_DEPTH.

Fixes: #18694
2019-01-23 09:52:29 -05:00
Zack Galbreath
dc6888573d Pass EXCLUDE_FROM_ALL from directory to targets
When a target is created it now inherits the EXCLUDE_FROM_ALL property
from its directory. This change makes it possible to include a target
in "all", even if its directory has been marked as EXCLUDE_FROM_ALL.
2019-01-21 11:38:24 -05:00
Regina Pfeifer
b2aa3aedea clang-tidy: Use default member initialization 2018-12-15 10:52:37 +01:00
Brad King
b83fe27d8d fileapi: Report cmake generator in reply index file 2018-12-12 06:40:10 -05:00
Brad King
a8f628c0a4 Merge topic 'getsafedef-stdstring'
f4ff60a803 cmMakefile: Make GetSafeDefinition return std::string const&

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2350
2018-09-18 11:18:00 -04:00
Vitaly Stakhovsky
f4ff60a803 cmMakefile: Make GetSafeDefinition return std::string const& 2018-09-18 11:16:46 -04:00
Brad King
a1ad0a699b target_link_libraries: Allow use with targets in other directories
Previously the command did not allow naming targets on the LHS that
were not created in the calling directory.  Lift this restriction to
enable more flexible use by projects.

Targets named on the RHS will need to be looked up during generation in
the scope of the call site rather than the scope of the LHS target.
Introduce an internal syntax in `[INTERFACE_]LINK_LIBRARIES` properties
to specify target names that need to be looked up in a directory other
than that containing the target on which the property is set.  Add
minimal documentation of the syntax to help users that encounter it.

Unfortunately CMake previously did allow such calls in the case that
only `INTERFACE` libraries are specified, but those libraries would be
looked up in the target's directory rather than the caller's.  Add
policy `CMP0079` to enable the new behavior with new lookup scope in a
compatible way.

Fixes: #17943
2018-09-12 13:06:36 -04:00
Brad King
2f708f5d65 Make internal TARGET_PROPERTY generator expressions more robust
While collecting usage requirements from the `INTERFACE_*` properties of
directly linked targets, we internally generate `TARGET_PROPERTY:` and
`TARGET_OBJECTS:` generator expressions to refer to those properties on
those targets.  At the point we generate these expressions we already
have a pointer to an exact `cmGeneratorTarget` instance.

Switch from using the target name in these generator expressions to
using an internal unique name generated for each `cmGeneratorTarget`
instance to be referenced.  This avoids depending on the user-facing
target name to find the same target we already have.
2018-09-12 12:46:25 -04:00
Brad King
8a63b23d16 cmGlobalGenerator: Remove unused FindLocalGenerator method
This method has not been used since commit v3.4.0-rc1~234^2~1
(cmGlobalGenerator: Port Find API to cmMakefile, 2015-08-02).
2018-09-11 08:21:22 -04:00
Vitaly Stakhovsky
4e94f6447a cmGlobalGenerator::AddInstallComponent(): Accept std::string argument 2018-08-30 11:52:45 -04:00
Brad King
1d76991a41 Merge topic 'autogen_single_entry'
87e7904c91 Autogen: Use a single AUTOGEN  setup function in cmGlobalGenerator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2260
2018-08-06 08:43:54 -04:00
Sebastian Holtermann
87e7904c91 Autogen: Use a single AUTOGEN setup function in cmGlobalGenerator
By moving all AUTOGEN setup code in ``cmGlobalGenerator``
into a single ``cmGlobalGenerator::QtAutoGen`` function, the
``cmGlobalGenerator::Compute`` function becomes cleaner.
2018-08-03 12:55:50 +02:00