Commit Graph

20093 Commits

Author SHA1 Message Date
Milian Wolff 275f2a85b2 Remove temporary allocations when calling cmGeneratorTarget::GetName.
This happens quite often from within comparisons such as in
NamedGeneratorTargetFinder or FindGeneratorTargetImpl. It is the
top hotspot of both, number of allocations as well as number of
temporary allocations - the majority of calls lead to temporary
allocations.

In raw numbers, this patch removes ~1E6 temporary allocations of
1.5E6 temporary allocations in total when running the cmake daemon
on the KDevelop build dir. That is 2/3 of the total.

This hotspot was found with heaptrack.
2016-01-20 21:20:54 +01:00
Brad King 1787269ef3 cmake: Fix `-E time` argument passing to child
Since this command was introduced in 2002 it has incorrectly constructed
the child process command line by concatenating arguments separated by
spaces with no quoting.  Fix this by passing the command argument vector
directly to RunSingleCommand without an intermediate quoting and
re-parsing step.

Reported-by: Andrey Pokrovskiy <wonder.mice@gmail.com>
2016-01-20 08:55:23 -05:00
Brad King d8bced813c Merge topic 'cleanup-RunSingleCommand'
1040e690 cmSystemTools: Teach RunSingleCommand to merge child pipes when possible
ce3b713b cmSystemTools: Simplify RunSingleCommand output string construction
dc039cc0 cmSystemTools: Drop redundant condition in RunSingleCommand
ffa2a8c9 cmSystemTools: Rename OUTPUT_NORMAL to OUTPUT_FORWARD to clarify its purpose
92e9bb21 cmcmd.cxx: Remove unused code in __run_iwyu implementation
fb1526f5 cmake: Change `-E chdir` to pass through stdout/stderr directly
2016-01-20 08:33:41 -05:00
Brad King ae5f30b36a Merge topic 'mfc-utility-targets'
a15e375c Fix MFC setting on utility targets (#15867)
2016-01-20 08:33:38 -05:00
Brad King 184be68580 Merge topic 'cache-parse-error-line-number'
77cd74a3 Print line number of cache parse errors (#11109)
2016-01-20 08:33:35 -05:00
Kitware Robot 15fe480bf0 CMake Nightly Date Stamp 2016-01-20 00:01:12 -05:00
Clinton Stimpson a15e375cdd Fix MFC setting on utility targets (#15867)
Multi-byte MFC is deprecated, and some projects will not compile if MFC is enabled.
2016-01-19 14:04:15 -07:00
Brad King 1040e690c6 cmSystemTools: Teach RunSingleCommand to merge child pipes when possible
Audit the code to make sure there are no callers that use OUTPUT_MERGE
with separate capture strings.  Then change RunSingleCommand to
implement output merging by giving the child process a single pipe for
both its stdout and stderr descriptors.  This will more cleanly merge
the content on atomic write boundaries in the child instead of on
arbitrary buffering boundaries in the parent.
2016-01-19 15:55:05 -05:00
Brad King ce3b713baa cmSystemTools: Simplify RunSingleCommand output string construction
Assign to the result strings instead setting to empty and appending.
The old approach was left from when we directly buffered output in
the strings.
2016-01-19 15:51:00 -05:00
Brad King dc039cc02c cmSystemTools: Drop redundant condition in RunSingleCommand
The output processing loop is already guarded by a condition so we do
not need to repeat the condition inside the loop.
2016-01-19 15:49:48 -05:00
Brad King ffa2a8c967 cmSystemTools: Rename OUTPUT_NORMAL to OUTPUT_FORWARD to clarify its purpose
The OUTPUT_NORMAL value is not really "normal" and has only one caller.
Rename it to OUTPUT_FORWARD to clarify that we are explicitly forwarding
the output.
2016-01-19 15:47:48 -05:00
Brad King 92e9bb2175 cmcmd.cxx: Remove unused code in __run_iwyu implementation
Do not try to capture stderr with OUTPUT_PASSTHROUGH.  RunSingleCommand
will never populate it.
2016-01-19 15:46:15 -05:00
Brad King fb1526f57f cmake: Change `-E chdir` to pass through stdout/stderr directly
Use OUTPUT_PASSTHROUGH instead of OUTPUT_NORMAL in order to avoid
buffering the output just to re-print it.
2016-01-19 15:44:30 -05:00
Ashley Whetter 77cd74a3ea Print line number of cache parse errors (#11109)
Track the line number while parsing `CMakeCache.txt` files and include
it in a parse failure error message.
2016-01-19 10:19:42 -05:00
Brad King 249aac71d0 Merge topic 'export-static-private-depend'
aea1b036 Fix export of STATIC library PRIVATE dependencies with CMP0022 NEW
e5cbec14 Tests: Use CMP0022 NEW behavior in some ExportImport cases
0ca122fc Tests: Isolate policy changes in ExportImport test
2016-01-19 09:35:46 -05:00
Brad King caf4985346 Merge topic 'rpath-preserve-compiler-defined'
3ec92267 install: Do not remove compiler-defined RPATH entries
2016-01-19 09:35:33 -05:00
Kitware Robot 5079cc1243 CMake Nightly Date Stamp 2016-01-19 00:01:07 -05:00
Kitware Robot 03c0303d2e CMake Nightly Date Stamp 2016-01-18 00:01:06 -05:00
Kitware Robot 27410a9c62 CMake Nightly Date Stamp 2016-01-17 00:01:07 -05:00
Kitware Robot 66942a764c CMake Nightly Date Stamp 2016-01-16 00:01:07 -05:00
Lior Goldberg 3ec9226779 install: Do not remove compiler-defined RPATH entries
Some compilers may add their own RPATH entries when invoking the linker.
For example, a GCC installation may contain the following definition in
the specs file:

  *link_libgcc:
  %D -rpath <<some specific rpath in which libstdc++.so can be found>>

In this case binaries may contain RPATH entries that CMake did not add.
When we update the RPATH on installation we must preserve these entries
even if CMake thinks the INSTALL_RPATH value should be empty.

Fix this by always using file(RPATH_CHANGE) and teach it to behave as
file(RPATH_REMOVE) if the actual RPATH in the file is empty after
replacing the build-tree RPATH with the install-tree RPATH.  This will
preserve any compiler-added RPATH value instead of removing it.
2016-01-15 14:53:24 -05:00
Brad King aea1b03617 Fix export of STATIC library PRIVATE dependencies with CMP0022 NEW
The target_link_libraries command records the PRIVATE dependencies of a
STATIC library in INTERFACE_LINK_LIBRARIES as "$<LINK_ONLY:dep>".  This
hides the target name from export namespacing logic inside a generator
expression.  When user-written generator expressions reference a target
name they must put it inside a "$<TARGET_NAME:dep>" expression to allow
the export logic to rename the target.  In the case that the private
dependency is not already a generator expression, target_link_libraries
must use "$<LINK_ONLY:$<TARGET_NAME:dep>>" to allow the export logic to
rename the target.

Reported-by: Tamás Kenéz <tamas.kenez@gmail.com>
2016-01-15 10:18:53 -05:00
Kitware Robot b8d002af1a CMake Nightly Date Stamp 2016-01-15 00:01:07 -05:00
Brad King f3fd50ad4b Merge topic 'report_failed_tests'
a7393cbd ctest_test: Report which tests failed even when QUIET is used
2016-01-14 11:42:26 -05:00
Brad King 9cf6388698 Merge topic 'install-DIRECTORY-genex'
630c8aa8 install: Allow generator expressions in DIRECTORY
2016-01-14 11:42:20 -05:00
Kitware Robot 6be2dedaed CMake Nightly Date Stamp 2016-01-14 00:01:07 -05:00
Zack Galbreath a7393cbd40 ctest_test: Report which tests failed even when QUIET is used
Since commit v3.3.0-rc1~410^2~3 (ctest_test: Add QUIET option,
2015-02-17) if tests fail when QUIET is used one sees:

  The following tests FAILED:

but not the subsequent line(s) indicating which tests failed.
Restore the list of failed tests.
2016-01-13 10:32:24 -05:00
Brad King 05ab4b7c66 Merge topic 'vs-debug-fastlink'
fc5d6592 VS: Map link `/debug:fastlink` flag to VS 2015 IDE property (#15894)
2016-01-13 09:33:21 -05:00
Brad King 59dac28856 Merge topic 'cmake-W-options'
82166701 cmake-gui: Add options to control warning-as-error messages
28f2d750 Add -Werror and -Wno-error command-line options
2016-01-13 09:33:18 -05:00
Brad King ef3202fb98 Merge topic 'update-kwsys'
33cafa68 Merge branch 'upstream-KWSys' into update-kwsys
ffcc235c KWSys 2016-01-11 (bc07fbf7)
2016-01-13 09:33:13 -05:00
Yves Frederix 630c8aa843 install: Allow generator expressions in DIRECTORY
Teach install(DIRECTORY) to support generator expressions in the list
of directories, much like install(FILES) already supports.
2016-01-13 09:02:06 -05:00
Kitware Robot 39b7954d4d CMake Nightly Date Stamp 2016-01-13 00:01:10 -05:00
Michael Scott 821667018c cmake-gui: Add options to control warning-as-error messages
Add new widgets to the warning messages dialog to control treating
warnings as errors.
2016-01-12 14:03:32 -05:00
Michael Scott 28f2d750ed Add -Werror and -Wno-error command-line options
Expand the -W set of cmake options to include support for the -Werror
and -Wno-error format, which is used to control upgrading and
downgrading warning and error messages. Implement support for these new
formats for the dev and deprecated message types.

Add tests and updated documentation for new options.
2016-01-12 14:02:51 -05:00
Brad King fc5d659229 VS: Map link `/debug:fastlink` flag to VS 2015 IDE property (#15894)
Suggested-by: Thomas Laguzzi <tholag@gmail.com>
2016-01-12 13:59:59 -05:00
Brad King 33cafa68b8 Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys:
  KWSys 2016-01-11 (bc07fbf7)
2016-01-12 10:55:49 -05:00
Brad King ae7398c0a7 Merge topic 'vs-win10-sdk'
a57caf7e VS: Fix Windows 10 SDK version selection (#15831)
ad594de8 cmSystemTools: Add VersionCompareEqual helper
c173e37f VS: Do not select a partial Windows 10 SDK folder (#15831)
2016-01-12 10:53:45 -05:00
Brad King 0355421035 Merge topic 'update-kwsys'
9821924d Merge branch 'upstream-KWSys' into update-kwsys
8e7356a2 KWSys 2016-01-11 (e8bf616e)
2016-01-12 10:23:07 -05:00
Brad King 31a58b438f Merge topic 'vs-global-properties'
af39f115 VS: Implement VS_GLOBAL_* target properties in VS 2010+ (#13666)
2016-01-12 10:23:02 -05:00
Brad King b3c10efb08 Merge topic 'vs-link-debug-property'
b3677b35 VS: Map the link `/debug` to its IDE property
c22da7cf VS: Drop unused condition in link debug flag generation
4ca9df8b cmIDEOptions: Add support for case-insensitive flags
2016-01-12 10:22:59 -05:00
Kitware Robot cd9a59b199 CMake Nightly Date Stamp 2016-01-12 00:01:09 -05:00
Brad King a57caf7eec VS: Fix Windows 10 SDK version selection (#15831)
In commit v3.4.0-rc1~5^2~1 (VS: Add support for selecting the Windows 10
SDK, 2015-09-30) we added Windows 10 SDK selection choosing the most
recent SDK that is not newer than the target version.  This is backward
because it should be up to the application code to not use APIs newer
than the target version.  It is up to the build system to provide a SDK
that has at least the APIs expected to be available for the target
version.  Furthermore, since the default target version is the host
version of Windows, the old approach breaks when the only SDK available
is for a newer version of Windows.

Fix this by always selecting a Windows 10 SDK if one exists.  Use the
SDK for the exact version if is available.  Otherwise use the latest
version of the SDK available because that will have at least the APIs
expected for the target version.
2016-01-11 13:44:11 -05:00
Brad King ad594de8cc cmSystemTools: Add VersionCompareEqual helper
Wrap a call to VersionCompare with OP_EQUAL.
2016-01-11 13:43:22 -05:00
Mike Fitzgerald af39f11521 VS: Implement VS_GLOBAL_* target properties in VS 2010+ (#13666)
These have been documented but previously only implemented for VS 2008
and below.
2016-01-11 13:04:34 -05:00
Brad King 9821924d45 Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys:
  KWSys 2016-01-11 (e8bf616e)
2016-01-11 11:20:14 -05:00
Brad King b3677b35d3 VS: Map the link `/debug` to its IDE property
Fix the link flag table entries for this flag to be case-insensitive.
Also fix the VS 2015 value for the build property enumeration name.

This causes `linkOptions.Parse(...)` to correctly extract the `/debug`
flag and map it to the IDE property instead.  Therefore we do not need
to look for the flag explicitly when initializing the property.
2016-01-11 09:45:00 -05:00
Brad King c22da7cff7 VS: Drop unused condition in link debug flag generation
The `linkOptions.IsDebug()` call never returns true because it
checks for `DebugInformationFormat` which is a compiler (cl) flag.
2016-01-11 09:43:13 -05:00
Brad King 4ca9df8bd1 cmIDEOptions: Add support for case-insensitive flags 2016-01-11 09:43:09 -05:00
Brad King cedbb7994d Merge topic 'vs14-debug-enum'
f086c665 VS: Fix VS 2015 .vcxproj file value for GenerateDebugInformation (#15894)
2016-01-11 09:17:41 -05:00
Kitware Robot 196d912200 CMake Nightly Date Stamp 2016-01-11 00:01:06 -05:00
Kitware Robot 7a45d91dc4 CMake Nightly Date Stamp 2016-01-10 00:01:06 -05:00
Kitware Robot c6ff95be61 CMake Nightly Date Stamp 2016-01-09 00:01:11 -05:00
Brad King f086c665da VS: Fix VS 2015 .vcxproj file value for GenerateDebugInformation (#15894)
Starting with VS 2015 the GenerateDebugInformation build property is an
enumeration (`No`, `Debug`, `DebugFastLink`) instead of a boolean value
(`false`, `true`).  For now we simply change to `No` and `Debug` fix
current behavior.  Support for `/debug:fastlink` can be added later.
2016-01-08 14:15:39 -05:00
Brad King b74560c32a Merge topic 'cpack-dmg-license-fixes'
bbb3c4ff CPack/DragNDrop: Fix handling of certain license file content (#15899)
2016-01-08 10:43:37 -05:00
Brad King 4226c83fa2 Merge topic 'update-kwsys'
0a5ce85f Merge branch 'upstream-KWSys' into update-kwsys
f2b0bf6e KWSys 2016-01-07 (2418443e)
2016-01-08 10:43:28 -05:00
Brad King c173e37fa3 VS: Do not select a partial Windows 10 SDK folder (#15831)
Skip SDK candidate folders that do not contain <um/windows.h> as they
are not full SDKs.
2016-01-08 10:05:40 -05:00
Kitware Robot 963d99de14 CMake Nightly Date Stamp 2016-01-08 00:01:08 -05:00
Andrey Mishchenko bbb3c4ffc1 CPack/DragNDrop: Fix handling of certain license file content (#15899)
There were issues in the special-character-escaping and line-wrapping
code which caused DragNDrop packaging to fail mysteriously at a later
step with parsing errors in the `sla.r` file generated by the following
code.
2016-01-07 15:24:42 -05:00
Brad King 070f09f91e Merge topic 'xcode-global-attribute-variant'
d8bc26a0 Xcode: Parse variant and genex for CMAKE_XCODE_ATTRIBUTE (#14947)
dc0ddb9e Xcode: Store configuration name along with XcodeObject (#14947)
28f98cee Xcode: Make CMAKE_XCODE_ATTRIBUTE calculation last step (#14947)
28db2268 Xcode: Factor out XCODE_ATTRIBUTE_ variant filter (#14947)
2016-01-07 13:28:28 -05:00
Brad King f7fbe0f681 Merge topic 'xcode-escape-backslash'
ba39d7e9 Xcode: Escape all backslashes in strings (#15328)
2016-01-07 13:28:26 -05:00
Brad King 64dd52422b Merge topic 'install-xdgdata-dir'
76566621 QtDialog: Add option to control XDG file install destination
2016-01-07 13:28:21 -05:00
Gregor Jasny ba39d7e9d0 Xcode: Escape all backslashes in strings (#15328)
Before this change backslashes in strings were escaped during compile
flags adds via AppendFlag(). But global flags like OTHER_CPLUSPLUSFLAGS
are not added as flags but as plain strings so they were not escaped
properly.

Now the escaping is performed within cmXCodeObject::PrintString() which
ensures that strings are always encoded.
2016-01-07 13:23:24 -05:00
Brad King 0a5ce85f60 Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys:
  KWSys 2016-01-07 (2418443e)
2016-01-07 13:13:51 -05:00
Kitware Robot b021455e40 CMake Nightly Date Stamp 2016-01-07 00:01:05 -05:00
Kitware Robot bc908abd98 CMake Nightly Date Stamp 2016-01-06 00:01:07 -05:00
Kitware Robot a6cbc89179 CMake Nightly Date Stamp 2016-01-05 00:01:05 -05:00
Kitware Robot 3d2d17c00c CMake Nightly Date Stamp 2016-01-04 00:01:08 -05:00
Gregor Jasny d8bc26a065 Xcode: Parse variant and genex for CMAKE_XCODE_ATTRIBUTE (#14947) 2016-01-03 22:31:12 +01:00
Gregor Jasny dc0ddb9e34 Xcode: Store configuration name along with XcodeObject (#14947) 2016-01-03 18:31:33 +01:00
Gregor Jasny 28f98ceef1 Xcode: Make CMAKE_XCODE_ATTRIBUTE calculation last step (#14947) 2016-01-03 12:06:56 +01:00
Gregor Jasny 28db2268e8 Xcode: Factor out XCODE_ATTRIBUTE_ variant filter (#14947)
Move the variant=<config> filter out to a helper function
so that it can be re-used later for CMAKE_XCODE_ATTRIBUTE_*.
2016-01-03 11:46:27 +01:00
Kitware Robot 506504d440 CMake Nightly Date Stamp 2016-01-03 00:01:06 -05:00
Kitware Robot 90b50b2e28 CMake Nightly Date Stamp 2016-01-02 00:01:06 -05:00
Kitware Robot 9ebc5626ef CMake Nightly Date Stamp 2016-01-01 00:01:06 -05:00
Kitware Robot 4aff1650d6 CMake Nightly Date Stamp 2015-12-31 00:01:09 -05:00
Kitware Robot f04a09d1bd CMake Nightly Date Stamp 2015-12-30 00:01:05 -05:00
Kitware Robot 69374919fd CMake Nightly Date Stamp 2015-12-29 00:01:08 -05:00
Kitware Robot 9fdb66cff6 CMake Nightly Date Stamp 2015-12-28 00:01:06 -05:00
Kitware Robot 1d73f6525c CMake Nightly Date Stamp 2015-12-27 00:01:05 -05:00
Kitware Robot 0b3b5fb169 CMake Nightly Date Stamp 2015-12-26 00:01:06 -05:00
Kitware Robot 630e444e97 CMake Nightly Date Stamp 2015-12-25 00:01:06 -05:00
Kitware Robot 554c307455 CMake Nightly Date Stamp 2015-12-24 00:01:07 -05:00
Kitware Robot 56653b81b8 CMake Nightly Date Stamp 2015-12-23 00:01:05 -05:00
Kitware Robot 8a45573e99 CMake Nightly Date Stamp 2015-12-22 00:01:07 -05:00
Niels Ole Salscheider 7656662148 QtDialog: Add option to control XDG file install destination
Create a `CMAKE_XDGDATA_DIR` option and add a corresponding flag to the
`bootstrap` script.  This is needed for multiarch layouts where the
prefix is `/usr/${host}` but where architecture-independent files (like
the XDG-specific ones) are installed to `/usr/share`.
2015-12-21 10:23:48 -05:00
Brad King a53e0168c3 Merge topic 'import-kwiml'
a5dd0c9d Add option to use a system-installed KWIML
036b6ef7 Port CMake from cmIML to KWIML
12293371 Merge branch 'upstream-KWIML' into import-kwiml
3fdbb0a8 KWIML 2015-12-09 (43f9f8d0)
55b21d07 Add script to update KWIML from upstream
c7d9a249 Utilities/KWIML: Drop sources to make room for fresh import
2015-12-21 09:41:09 -05:00
Kitware Robot ba88bfcf21 CMake Nightly Date Stamp 2015-12-21 00:01:16 -05:00
Kitware Robot 693a42fb00 CMake Nightly Date Stamp 2015-12-20 00:01:16 -05:00
Kitware Robot a5149d31be CMake Nightly Date Stamp 2015-12-19 00:01:07 -05:00
Brad King f9e3ca46cb Merge topic 'release-wix-config-ng'
24cdb9df CMake: Mimic NSIS options dialog in WiX installer
de77d4a7 CPackWIX: Allow multiple patch files and diagnose if any are missing
38d723b3 CPackWIX: Allow patching of shortcut components
2015-12-18 10:55:35 -05:00
Brad King 81e5bf2548 Merge topic 'update-kwsys'
38c31ed5 Merge branch 'upstream-KWSys' into update-kwsys
ec1398d7 KWSys 2015-12-14 (c1149ef6)
c4282347 Add script to update KWSys from upstream
f1ee10c1 Merge branch 'upstream-KWSys' into update-kwsys
498c3685 Add a script to help update third-party sources
dcca7892 KWSys 2015-12-09 (cdcf4c47)
2015-12-18 10:12:41 -05:00
Brad King 4395190cd4 Merge topic 'CMakeParseArguments-native-impl'
ab8a2808 cmake_parse_arguments: consider duplicate keyword as warning
e8b14831 CMakeParseArguments: replace by native cmake_parse_arguments command
cbbdfc2b CMakeParseArguments: add a RunCMake test suite
2015-12-18 10:12:35 -05:00
Brad King a5dd0c9d42 Add option to use a system-installed KWIML
Do not activate it with the general use-system-libs options for now
because KWIML is not commonly distributed or available.
2015-12-18 10:02:28 -05:00
Brad King 036b6ef7c4 Port CMake from cmIML to KWIML
KWIML no longer uses a configured prefix.
2015-12-18 10:02:07 -05:00
Kitware Robot 614c8a1c92 CMake Nightly Date Stamp 2015-12-18 00:01:07 -05:00
Brad King 38c31ed5f5 Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys:
  KWSys 2015-12-14 (c1149ef6)
2015-12-17 14:46:12 -05:00
Matthias Maennich ab8a280857 cmake_parse_arguments: consider duplicate keyword as warning
The behaviour of double specified keywords is rather undefined or at
least not clearly documented. This change introduces a strict check and
emits a warning in case a keyword has been specified more than once.
2015-12-17 10:45:19 -05:00
Matthias Maennich e8b148318f CMakeParseArguments: replace by native cmake_parse_arguments command
Implement a native `cmake_parse_arguments` command that is fully
compatible with the documented behaviour of the previous implementation.
Leave the CMakeParseArguments module empty but existing for
compatibility.
2015-12-17 10:44:28 -05:00
Kitware Robot e51fa1dc4d CMake Nightly Date Stamp 2015-12-17 00:01:05 -05:00
Kitware Robot 7e29021465 CMake Nightly Date Stamp 2015-12-16 00:01:06 -05:00