Commit Graph

24157 Commits

Author SHA1 Message Date
Brad King
a039029e7c Merge branch 'genex-COMPILE_LANGUAGE-system-include' into release-3.11
Merge-request: !1844
2018-03-13 13:40:25 -04:00
Brad King
a54b56a10b Merge branch 'ccmake-stack-smashing' into release-3.11
Merge-request: !1836
2018-03-13 13:40:17 -04:00
Tianhao Chai
7899e53691 ccmake: fix status line buffer overflow on very wide terminals
A mistyped length calculation will memset across stack frame when
the user's terminal width is larger than 270.
2018-03-13 13:38:12 -04:00
Brad King
1b5e52fd65 Genex: Fix COMPILE_LANGUAGE propagation through try_compile
When evaluating include directories during export to a `try_compile`
test project, thread the compile language through to the generator
expression evaluator so it can support `$<COMPILE_LANGUAGE:...>`.

Issue: #17811
2018-03-12 13:30:14 -04:00
Brad King
2deb9b7f34 Genex: Fix COMPILE_LANGUAGE in SYSTEM include directories
When evaluating `INTERFACE_SYSTEM_INCLUDE_DIRECTORIES`, or evaluating
`INTERFACE_INCLUDE_DIRECTORIES` on an imported target, thread the
compile language through to the generator expression evaluator so
that it can support `$<COMPILE_LANGUAGE:...>`.

Fixes: #17811
2018-03-12 11:45:01 -04:00
Brad King
c5541cf0da CMake 3.11.0-rc3 2018-03-09 08:33:11 -05:00
Brad King
9288abf567 Merge branch 'update-kwsys' into release-3.11
Merge-request: !1830
2018-03-07 07:39:16 -05:00
Brad King
2c5b4359f8 Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys:
  KWSys 2018-03-07 (2ad561e7)
2018-03-07 06:48:34 -05:00
Sebastian Holtermann
50b7be6d1f Autogen: Check if a file is empty before reading it
Calling `std::string::front()` on an empty string results
in an undefined behavior by the C++ standard.
In gcc8 it causes an assertion to fail.

This adds a check to `AUTOGEN` if a file to read is empty
and in case avoids the use of an empty `std::string` buffer.

Closes #17793
2018-03-06 08:35:08 -05:00
Brad King
ac925ec09e CMake 3.11.0-rc2 2018-02-27 09:34:35 -05:00
Brad King
72a85d9f0b Merge branch '14297-partial-xcode-zero-check' into release-3.11
Merge-request: !1790
2018-02-23 08:17:51 -05:00
Gregor Jasny
481420ee89 Xcode: Generate ZERO_CHECK generator target only once
In case CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY has been enabled
generate only the root-level ZERO_CHECK target so targets in
subdirectories pick up the root generator target of ZERO_CHECK.

For the case that CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY is not
enabled more investigation and a proper and final fix is still needed.

Issue: 14297
2018-02-22 21:15:48 +01:00
Brad King
36fc89b7d9 Merge branch 'std-thread-link' into release-3.11
Merge-request: !1789
2018-02-22 13:15:58 -05:00
Brad King
94eee5e683 CMakeLib: Link to system thread libraries to support std::thread
Some environments require linking to thread libraries for `std::thread`.
Express this direct dependency of CMakeLib explicitly.  Previously this
was done indirectly through our bundled libuv, but that does not work
when using a system libuv.

Fixes: #17757
2018-02-22 12:59:20 -05:00
Brad King
02edf08be2 Merge branch 'export-android-mk' into release-3.11
Merge-request: !1766
2018-02-15 08:42:07 -05:00
Brad King
b6d68766b1 Android.mk: Fix export of static libraries with PRIVATE dependencies
The `LINK_ONLY` generator expression is used to represent private
dependencies of static libraries in their `INTERFACE_LINK_LIBRARIES`
property value.  Fix evaluation of generator expressions during export
to support the `LINK_ONLY` genex.  Extend the RunCMake.AndroidMK test
with a case for this.
2018-02-14 11:24:05 -05:00
Brad King
56e1688517 Android.mk: Evaluate generator expressions up front
When exporting `INTERFACE_LINK_LIBRARIES`, we must evaluate generator
expressions first, before expanding the `;` list, in case they contain
or generate semicolons.
2018-02-14 11:19:47 -05:00
Brad King
43cd9467cd Merge branch 'autogen-write-on-change-only' into release-3.11
Merge-request: !1753
2018-02-13 11:05:11 -05:00
Brad King
2a730e24c6 Merge branch '17711-reset-xcode-target-var' into release-3.11
Merge-request: !1757
2018-02-13 11:03:15 -05:00
Gregor Jasny
4349393d1d cmGlobalXCodeGenerator: Properly initialize TARGETS variable
Fixes: #17711
2018-02-13 11:02:24 -05:00
Sebastian Holtermann
c85ef9c339 Autogen: Overwrite info files when changed only
Check if the content of the AUTOMOC/UIC/RCC info file
will change before overwriting it. This avoids unnecessary
AUTORCC rebuilds when AUTORCC unrelated CMake settings change.
2018-02-06 11:20:08 -05:00
Brad King
51b287c40c CMake 3.11.0-rc1 version update 2018-02-05 11:16:50 -05:00
Brad King
213ecf05d6 Merge topic 'autogen-improve-multi-config'
a8ee7406 Autogen: Improved multi-config include scheme

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1735
2018-02-05 08:43:05 -05:00
Brad King
4d9ccd0abd Merge topic 'vs-static-ConvertToWindowsSlash'
6d148d6d cmVisualStudio10TargetGenerator: Limit scope of ConvertToWindowsSlash()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1741
2018-02-05 08:41:52 -05:00
Kitware Robot
30ee1dc7b0 CMake Nightly Date Stamp 2018-02-05 00:01:09 -05:00
Kitware Robot
b4a06e2cf7 CMake Nightly Date Stamp 2018-02-04 00:01:09 -05:00
Kitware Robot
09d7ed20df CMake Nightly Date Stamp 2018-02-03 00:01:12 -05:00
Brad King
457bcbd4f9 Merge topic 'simplify-ccg-converter'
df1693bd cmCustomCommandGenerator: Simplify cmOutputConverter access

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1738
2018-02-02 07:24:07 -05:00
Brad King
52ed76e46e Merge topic 'ninja-unused-device-link'
20676cba Ninja: Remove unused device link line code

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1737
2018-02-02 07:23:08 -05:00
Brad King
d280327713 Merge topic 'update-kwsys'
be46f9fb Merge branch 'upstream-KWSys' into update-kwsys
854feacc KWSys 2018-02-01 (04fcc449)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1736
2018-02-02 07:22:40 -05:00
Sebastian Holtermann
a8ee7406a7 Autogen: Improved multi-config include scheme
For multi configuration generators AUTOMOC generates the
moc files that are included in `mocs_compilation.cpp`
in `AUTOGEN_BUILD_DIR/include_$<CONFIG>/`. By doing so each
configuration reads different moc files when compiling
`mocs_compilation.cpp`. Since we do not (need to) rewrite
`mocs_compilation.cpp` on a configuration change anymore,
the files also does not need to be recompiled anymore.
Not having to rewrite and recompile `mocs_compilation.cpp`
on a configuration change anymore was the main objective of
this patch.

In a similar fashion AUTORCC generates a `qrc_BASE_CMAKE.cpp`
file below `AUTOGEN_BUILD_DIR/include_$<CONFIG>/` and
`qrc_BASE.cpp` becomes a mere wrapper that includes this
actuall rcc output file (when using multi configuration
generators).

The template files `Modules/AutoRccInfo.cmake.in` and
`Modules/AutogenInfo.cmake.in` were removed in favor
of writing the info `.cmake` files manually.

Closes #17230
2018-02-02 09:10:40 +01:00
Kitware Robot
a53697acc7 CMake Nightly Date Stamp 2018-02-02 00:01:06 -05:00
Vitaly Stakhovsky
6d148d6d53 cmVisualStudio10TargetGenerator: Limit scope of ConvertToWindowsSlash()
It is no longer used outside this class, so its scope can be limited to file.
2018-02-01 19:09:34 -05:00
Brad King
df1693bdfc cmCustomCommandGenerator: Simplify cmOutputConverter access
In commit v3.4.0-rc1~480^2~3 (cmCustomCommandGenerator: Port to
cmOutputConverter, 2015-06-04), cmCustomCommandGenerator's access to the
local generator was removed so it needed to construct its own
cmOutputConverter instance.  Access to the local generator was then
restored by commit v3.4.0-rc1~285^2~21 (cmCustomCommandGenerator:
Require cmLocalGenerator in API, 2015-07-25), so now we can use its
cmOutputConverter base class methods directly.
2018-02-01 14:58:25 -05:00
Brad King
20676cbaca Ninja: Remove unused device link line code
Remove the `PRE_LINK` and `POST_BUILD` variables.  They are not
referenced by `WriteDeviceLinkRule`.

Remove the `byproducts` local variable from `WriteDeviceLinkStatement`
and all the code populating it.  We never used the result.
2018-02-01 14:36:09 -05:00
Brad King
be46f9fb6e Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys:
  KWSys 2018-02-01 (04fcc449)
2018-02-01 08:15:44 -05:00
Brad King
f8ca0ab3ac Merge topic 'std-string-apis'
653b8946 Reduce raw string pointers usage.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1729
2018-02-01 08:05:33 -05:00
Brad King
8cb92c25d7 Merge topic 'perf-from-callgrind'
901c4a1e cmExpandedCommandArgument: add an overload for const char*
88ed556d cmGeneratorTarget: make keyword strings const
14a13d30 cmGeneratorExpressionLexer: only tokenize strings with a '$'
f2b8d67f cmTarget: use static strings for special property names
6dfd0f92 cmGeneratorExpressionNode: avoid some strlen in $<TARGET_PROPERTY>
f9235fd4 cmAddCustomCommandCommand: use std::string const& for FileIsFullPath
c0e7a137 cmAddCustomCommandCommand: store keywords in strings

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1689
2018-02-01 08:03:13 -05:00
Kitware Robot
70695e72a6 CMake Nightly Date Stamp 2018-02-01 00:01:10 -05:00
Ben Boeckel
901c4a1e05 cmExpandedCommandArgument: add an overload for const char*
Static string comparisons were causing heap allocations just for a
comparison.
2018-01-31 11:04:36 -05:00
Ben Boeckel
88ed556d99 cmGeneratorTarget: make keyword strings const 2018-01-31 11:04:36 -05:00
Ben Boeckel
14a13d30ee cmGeneratorExpressionLexer: only tokenize strings with a '$'
In standard libraries, `std::string::find` is usually implemented using
vectorized code. Since the Tokenize method iterates
character-by-character, doing an initial check using `find` improves
performance.
2018-01-31 11:04:36 -05:00
Ben Boeckel
f2b8d67f19 cmTarget: use static strings for special property names
Similar to 660769151a, the `SetProperty`
side is showing up in performance listings due to string comparisons.
2018-01-31 11:04:35 -05:00
Ben Boeckel
6dfd0f9294 cmGeneratorExpressionNode: avoid some strlen in $<TARGET_PROPERTY> 2018-01-31 11:04:35 -05:00
Ben Boeckel
f9235fd474 cmAddCustomCommandCommand: use std::string const& for FileIsFullPath 2018-01-31 11:04:35 -05:00
Ben Boeckel
c0e7a13702 cmAddCustomCommandCommand: store keywords in strings
Callgrind indicated that `strlen` was being called a lot of times here
due to the string comparisons. Since keywords are "sparse" in
`add_custom_command`, use a hash comparison to handle keywords and then
use strings for comparison since they have a built-in length parameter.
2018-01-31 11:03:51 -05:00
Pavel Solodovnikov
653b894683 Reduce raw string pointers usage.
* Change some functions to take `std::string` instead of
  `const char*` in the following classes: `cmMakeFile`, `cmake`,
  `cmCoreTryCompile`, `cmSystemTools`,  `cmState`, `cmLocalGenerator`
  and a few others.
* Greatly reduce using of `const char*` overloads for
  `cmSystemTools::MakeDirectory` and `cmSystemTools::RelativePath`.
* Remove many redundant `c_str()` conversions throughout the code.
2018-01-31 18:23:03 +03:00
Brad King
e2db8531f1 Merge topic 'windows-embed-cmake-gui-version'
45f6aa32 Windows: Embed version information into cmake-gui

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1726
2018-01-31 09:22:43 -05:00
Brad King
4499cc8bb6 Merge topic 'msvc_cuda_files_use_consistent_obj_names'
fa583869 CUDA: Use MSVC default pattern for naming object files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1722
2018-01-31 08:36:24 -05:00
Brad King
a7ee918f19 Merge topic 'generate_speedup'
aed227fd cmLocalGenerator: change ImportedGeneratorTargets from vector to map
4443adc1 cmLocalGenerator: remove public GetImportedGeneratorTargets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Attila Krasznahorkay <attila.krasznahorkay@gmail.com>
Merge-request: !1717
2018-01-31 08:34:59 -05:00