Commit Graph

36369 Commits

Author SHA1 Message Date
Ruslan Baratov
8d56308c44 Help: Fix module and function names in CMP0069 examples
Fixes: #17153
2017-08-10 09:03:49 -04:00
Brad King
f15cfd891d CMake 3.9.0 2017-07-18 11:18:18 -04:00
Brad King
b97878643b Merge branch 'objlib-own-target-objs' into release-3.9 2017-07-17 11:42:18 -04:00
Brad King
d89e10cd58 Diagnose object library self-reference
The code

    add_library(A OBJECT a.c)
    target_sources(A PRIVATE $<TARGET_OBJECTS:A>)

used to crash CMake via infinite recursion while evaluating the
generator expression.  Then the change in commit v3.9.0-rc1~266^2~1
(cmGeneratorTarget: Replace source classifier implementation,
2017-04-07) avoided the infinite recursion because GetKindedSources now
creates a map entry and initializes it once.  If it is called again on
the same target during that initialization, the partially computed
results are returned.  This is still wrong but does not crash.
Detect and diagnose this case instead.

Co-Author: Ben Boeckel <ben.boeckel@kitware.com>
Fixes: #16578
2017-07-14 14:05:22 -04:00
Brad King
f2b05a095a Merge branch 'doc-vs2015-update-relnote' into release-3.9 2017-07-14 11:02:45 -04:00
Brad King
cfa9a2bd88 Help: Add a 3.9 release note about the VS GenerateDebugInformation update
Add a release note corresponding to the environmental regression fixed
by commit v3.9.0-rc6~15^2~1 (VS: Fix GenerateDebugInformation values for
v140 and v141 toolsets, 2017-06-27).
2017-07-14 11:02:17 -04:00
Brad King
68a64478c5 Merge branch 'xcode9support' into release-3.9 2017-07-14 10:40:33 -04:00
Harry Mallon
0348383b8c Xcode: Add "outputPaths" to custom command script build phase
This is needed for Xcode 9's "New Build System", whose release notes
mention "that output must be declared as an explicit output by the
script which generates it" in reference to outputs of custom script
build phases.
2017-07-14 10:38:00 -04:00
Brad King
8c7facd69b Merge branch 'backport-fix-lang-std-option-list' into release-3.9 2017-07-14 10:20:12 -04:00
Brad King
218ce158f2 Features: Fix support for a list of language standard options
The change in commit v3.9.0-rc1~174^2~2 (CompileFeatures: Let STD
compile options be a list, 2016-10-05) did not change all the places we
add the language standard options.  Expand the list in the other places.
2017-07-14 10:19:44 -04:00
Brad King
13e9a370d9 Merge branch 'TestDriver-fix-Wconversion' into release-3.9 2017-07-14 08:01:55 -04:00
Brad King
221ffabfad TestDriver: Fix -Wconversion warning
Since commit v3.8.0-rc1~51^2~1 (TestDriver: calc NumTests at compile
time, 2017-01-24) we convert an expression that uses `sizeof()` to an
`int` as a compile-time constant.  Some GCC versions warn about this
with `-Wconversion`.  Add a cast to avoid the warning.
2017-07-14 08:01:26 -04:00
Brad King
9d9085ab36 Merge branch 'ninja_cuda_export_compile_commands_support' into release-3.9 2017-07-13 11:40:08 -04:00
Robert Maynard
712af07e47 CUDA: CMAKE_EXPORT_COMPILE_COMMANDS now works with CUDA and Ninja
Fixes: #17061
2017-07-13 11:23:16 -04:00
Brad King
d11c48e0e3 Merge branch 'android-system-include-last' into release-3.9 2017-07-13 10:04:14 -04:00
Brad King
4bafa3922e Android: Always add standard include directories last
The logic added in commit v3.6.0-rc1~30^2 (Add a variable to specify
language-wide system include directories, 2016-05-24) to use
`CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES` incorrectly filters them by
`CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES`.  Rather than recognizing
this, commit v3.8.0-rc1~60^2 (Android: Pass sysroot include directory
explicitly, 2017-01-20) worked around the problem by incorrectly
removing `/usr/include` from `CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES`
so it worked in `CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES`.

By not filtering out `/usr/include` from user-specified include
directories, we allow the code

    include_directories(${CMAKE_SYSROOT}/usr/include)

to place the include directory too early on the command line.

Fix support for standard include directories to not be filtered by
implicit include directories, and do not remove `/usr/include` from the
list of implicit include directories for Android builds.  Add a test
case to verify that an explicit `/usr/include` is ignored in favor
of the standard directory at the end.

Fixes: #17059
2017-07-13 10:03:58 -04:00
Brad King
25b72e9097 CMake 3.9.0-rc6 2017-07-12 09:20:01 -04:00
Brad King
e8e38aea26 Merge branch 'android-fix-c++_shared' into release-3.9 2017-07-12 08:39:55 -04:00
Brad King
e0fb3f314f Android: Link to android_support with c++_shared
The NDK has done this in `build/core/definitions.mk` since r13
(r12 and below do so only for c++_static).
2017-07-12 08:39:42 -04:00
Brad King
c42c039d32 Merge branch 'vs-2017-sln-guid' into release-3.9 2017-07-11 10:42:21 -04:00
Brad King
5cf9c3d0cc VS: Add SolutionGuid to generated .sln files
Visual Studio 2017 Update 3 adds a SolutionGuid to its `.sln` files.

Fixes: #17041
2017-07-11 10:41:28 -04:00
Brad King
7638c6ea8d Merge branch 'find_package-root-prefix-path-suffixes' into release-3.9 2017-07-11 09:20:37 -04:00
Brad King
80b905f882 find_*: Honor PATH_SUFFIXES in PackageName_ROOT paths
This was accidentally forgotten in commit v3.9.0-rc1~71^2~2 (find_*: Add
a new PackageRoot search path group, 2017-05-03).

Fixes: #17052
2017-07-11 09:11:19 -04:00
Brad King
1ae1b880a8 cmFindCommon: Drop unused FilterPaths method
The method has not been used since commit v3.2.0-rc1~400^2~1
(Encapsulate search path manipulation functions into a seperate class,
2014-10-15).
2017-07-11 09:11:19 -04:00
Brad King
cca8454ee5 cmFindCommon: Fix typo in PackageName_ROOT path label 2017-07-11 09:11:19 -04:00
Brad King
6fba4ec0f5 Merge branch 'bindexplib-revert-consts' into release-3.9 2017-07-10 14:54:30 -04:00
Brad King
3250b9a122 bindexplib: Revert support for constants symbols
Revert the main logic change of commit v3.9.0-rc1~192^2 (bindexplib: fix
constants symbols export, 2017-04-26) and its test case.  Unfortunately
some constants may be provided by multiple object files with different
`@...` suffixes, leading to ambiguous references.  Revert support
pending further investigation.

Fixes: #17045
2017-07-10 14:54:07 -04:00
Brad King
dd69dea3e7 Merge branch 'vs-2017-choose-via-environment' into release-3.9 2017-07-10 11:08:27 -04:00
Brad King
2644e4c9fc VS: Choose VS 2017 instance via environment variable
In the `Visual Studio 15 2017` generator, if the `VS150COMNTOOLS`
environment variable points at a specific VS 2017 instance reported by
the Visual Studio Installer tool, use that as the preferred instance.

Inspired-by: Iyyappa Murugandi <iyyappam@microsoft.com>
Fixes: #16846
2017-07-10 11:08:11 -04:00
Brad King
f7f721d40a Merge branch 'autogen_skip_included' into release-3.9 2017-07-10 10:26:32 -04:00
Sebastian Holtermann
ecac50e133 Autogen: Skip included files on demand 2017-07-10 13:36:48 +02:00
Brad King
9b9a57e16b Merge branch 'autogen-no-generated-files' into release-3.9 2017-07-07 11:44:35 -04:00
Brad King
916b7d5195 Merge branch 'find_package-restore-considered-configs' into release-3.9 2017-07-07 11:44:29 -04:00
Brad King
e7730d78b4 find_package: Restore longer message when config files were considered
Since commit v3.9.0-rc1~58^2 (find_package: shorten output for missing
package in config mode, 2017-05-09) we print only the one line

    - Could NOT find Foo (missing: Foo_DIR)

when package Foo cannot be found in CONFIG mode and it is not REQUIRED.
However, in the case that package configuration files were found but not
used, this one line message leaves out important information.  This can
happen when a package configuration file sets `Foo_FOUND` to `FALSE` or
when its package version file does not match the requested version.
Restore the longer message in these cases.  Otherwise a seemingly valid
explicit `Foo_DIR` setting appears to be silently ignored even if it was
considered.

Fixes: #17029
2017-07-07 11:43:59 -04:00
Brad King
9a34e95a41 Autogen: Skip generated files for compatibility with CMake 3.8
The change in commit v3.9.0-rc1~464^2~8 (Autogen: Add AUTOMOC/UIC
support for generated source files, 2017-03-02) changes behavior of
existing projects that may not expect `AUTOGEN` on generated files and
do not yet set `SKIP_AUTOGEN` on them.  Disable the behavior change for
now to fix the regression for CMake 3.9.  We can restore it later with a
policy.

In order to keep the implementation and tests working, add an
undocumented property we can use in the tests to enable the behavior
before the policy is introduced.

Fixes: #17031
Issue: #16186
2017-07-07 10:12:15 -04:00
Brad King
658ecc1a7c Merge branch 'FindDoxygen-create-output-dir' into release-3.9 2017-07-06 11:13:51 -04:00
Robert Dailey
796b8fcb14 FindDoxygen: Create DOXYGEN_OUTPUT_DIRECTORY if it doesn't exist
If the doxygen output directory does not exist, create it prior to
running the doxygen commands.
2017-07-06 10:00:28 -05:00
Brad King
cf9a994d9a Merge branch 'autogen_p' into release-3.9 2017-07-05 10:29:27 -04:00
Brad King
ef31812ede Merge branch 'autogen-header-skip' into release-3.9 2017-07-05 09:42:15 -04:00
Sebastian Holtermann
251bcbed72 Autogen: Continue search for FOO_p.h when FOO.h was found 2017-07-02 22:54:35 +02:00
Sebastian Holtermann
83d8aceeb3 Autogen: Check .moc header name against SKIP list
When encountering an #include "FOO.moc" statement where
FOO.hpp was chosen over FOO.cpp as the moc source, the
FOO.hpp name was not checked against the moc SKIP list.
2017-06-30 12:53:24 -04:00
Brad King
2086003145 Merge branch 'vs-link-guard-cf' into release-3.9 2017-06-30 10:57:55 -04:00
Olender, Sebastian D
82a5c2c6a5 VS: Fix support for '/guard:cf' linker flag
Although `$(VCTargetsPath)/1033/link.xml` for v140 and v141 toolsets
contains an entry for `LinkControlFlowGuard`, it does not work when used
in a `.vcxproj` file.  Drop our link flag table entries for these
toolsets so that the flag will be passed via `AdditionalOptions`.
2017-06-30 10:57:40 -04:00
Brad King
d3234a8a48 Merge branch 'FindDoxygen-project-in-subdir' into release-3.9 2017-06-30 10:16:35 -04:00
Brad King
bc92960b63 Merge branch 'xcode-cross-sdk-object-libraries' into release-3.9 2017-06-30 10:16:30 -04:00
Robert Dailey
97a9a35607 FindDoxygen: Use a stable reference to the location of global resources
FindDoxygen generates some files based on the version of Doxygen whose
content will not vary across a project and are therefore a global
resource that can be shared by all calls to `find_package(Doxygen)` and
to `doxygen_add_docs`.  We currently use `${PROJECT_BINARY_DIR}` to
reference their location, but this is not stable because `project()`
calls in a subdirectory can change it.  Use `${CMAKE_BINARY_DIR}`
instead.

Reviewed-by: Craig Scott <craig.scott@crascit.com>
Fixes: #17022
2017-06-29 13:39:26 -05:00
Gregor Jasny
c2a6df94ed Xcode: Use correct Object Library paths for cross-SDK builds
When calculating Object Library paths take a look at the
`XCODE_EMIT_EFFECTIVE_PLATFORM_NAME` property to enable builds with
different SDKs. Otherwise a hard-coded architecture could be chosen.

Fixes: #16040
2017-06-29 09:52:44 -04:00
Brad King
594b0f80a8 Merge branch 'vs-link-debug-flags' into release-3.9 2017-06-28 08:58:19 -04:00
Ian Hojnicki
7ba27e364f VS: Add v140 and v141 flag table entries for /DEBUG:NONE and /DEBUG:FULL 2017-06-28 08:55:40 -04:00
Brad King
ae44496e2b VS: Fix GenerateDebugInformation values for v140 and v141 toolsets
When VS 2015 was first released, its new v140 toolset came with a
`link.xml` file that changed the `GenerateDebugInformation` boolean
(`false` and `true`) value from earlier toolsets to an enumeration
consisting of the possible values `No`, `Debug`, and `DebugFastLink`.

We first adapted to this in commit v3.4.2~2^2 (VS: Fix VS 2015 .vcxproj
file value for GenerateDebugInformation, 2016-01-08), but that broke
older toolsets that still expected the boolean.  Then commit
v3.6.0-rc1~295^2~1 (VS: Fix VS 2015 .vcxproj debug setting for older
toolsets, 2016-02-24) added a hack to fix up the value based on the
toolset in use.  Several follow-up commits fixed this for more older
toolsets because our flag table was at the time based on the generator
in use rather than the toolset in use.

Since commit v3.8.0-rc1~396^2 (VS: Choose flag map based on the toolset
name, 2016-10-17) we use a flag table based on the toolset, so the fixup
hack should not be needed.  We had to keep it around only due to our
default value for GenerateDebugInformation (`false` or `No`) still being
based on the generator instead of the toolset.

A VS 2015 update was released that changed the v140 toolset `link.xml`
file back to using `false` and `true` for the `GenerateDebugInformation`
enumeration variants previously known as `No` and `Debug`.  In order to
know which pair to use, we need to parse the `link.xml` file for the
current toolset.

Switch back to using `false` and `true` unconditionally in our
`GenerateDebugInformation` flag table entries and default value.  With
that plus the toolset-based flag table, we now get incorrect values for
`GenerateDebugInformation` only when using a v140 toolset from an older
VS 2015 installation.  Detect this case by parsing `link.xml` and add
special logic to convert `false` and `true` to `No` and `Debug` to
satisfy the older toolset specification.

Inspired-by: Ian Hojnicki <nullref@live.com>
Fixes: #17020
2017-06-28 08:55:40 -04:00