Commit Graph

4483 Commits

Author SHA1 Message Date
Brad King
1f8480312e Features: Suppress c_static_assert test coverage on Intel <= 15
It works on some pre-15.0.2 versions but not others.
2016-11-10 15:29:25 -05:00
Brad King
de53eb18ab Merge topic 'import-librhash'
cd8a57ae Add option to build CMake against a system librhash
71180fc8 FindLibRHash: Add module to find the librhash package
3216e94c Remove unused cm_sha2 infrastructure
5420278d Port hash computation to cmCryptoHash
9a596b33 cmCryptoHash: Re-implement in terms of librhash
47f91a61 cmCryptoHash: Avoid using subclasses at client sites
d0ff3e70 librhash: Port to KWIML for ABI and integer type information
465a85fb librhash: Avoid signed left-shift overflow
fc2cb74f librhash: Implement bswap_32 as a function even in strict C90 mode
0bd333bc librhash: Implement bswap_64 even in strict C90 mode
7189d62c librhash: Use __builtin_bswap{32,64} on Clang
af7ebf8a librhash: Install COPYING file with CMake documentation
bb01f20e librhash: Disable warnings to avoid changing 3rd party code
31bb727f librhash: Build the library within CMake
53048afa librhash: Remove source fragments not needed for CMake
5cb1b345 Merge branch 'upstream-librhash' into import-librhash
...
2016-11-10 08:34:28 -05:00
Brad King
71180fc8aa FindLibRHash: Add module to find the librhash package
Add it to a private source directory that is not installed so that we
can use it for building CMake itself.  This will allow it to mature
before being distributed publicly.
2016-11-10 08:29:38 -05:00
Brad King
64b5b06dc6 Merge topic 'drop-kwstyle'
36f9f0f8 Drop KWStyle checks in favor of clang-format and Git hooks
2016-11-09 09:49:58 -05:00
Brad King
453df662ba Merge topic 'imported-interface-libname'
09cda9d5 Allow imported INTERFACE libraries to specify a link library name
1d1f1eeb cmTarget: Refactor GetMappedConfig to choose location property up front
479932fa cmTarget: Add comment clarifying interface library special case
925e4270 cmTarget: Clarify comments in GetMappedConfig
2016-11-09 09:49:49 -05:00
Brad King
09cda9d5e7 Allow imported INTERFACE libraries to specify a link library name
Add an `IMPORTED_LIBNAME[_<CONFIG>]` target property to specify a library
name to be placed on the link line in place of an interface library
since it has no library file of its own.  Restrict use of the property
to imported `INTERFACE` libraries.

This will be particularly useful for find modules that need to provide
imported libraries from system SDKs where the full path to the library
file is not known.  Now such find modules will be able to provide an
imported interface library and set `IMPORTED_LIBNAME` to refer to the
SDK library by name.

Issue: #15267
2016-11-09 09:45:14 -05:00
Brad King
36f9f0f8a3 Drop KWStyle checks in favor of clang-format and Git hooks
We now define code layout by clang-format and enforce whitespace with
Git hooks.  There is no need to run KWStyle anymore, as all we used it
to check was line length anyway.
2016-11-08 11:40:20 -05:00
Alexander Adam
cd0423300b CPack/RPM test for Suggests tag
Suggests tag was not present in older versions
of rpmbuild so we test that the rpm package is
always generated either with Suggests tag present
or skipped if not supported.
2016-11-05 11:44:32 +01:00
Brad King
df252db15a Features: Test cycle diagnostic with language standard meta-feature
The `cxx_static_assert` feature may be available in C++ 98 mode of some
compilers or not available at all in others.  Intstead of using an
individual feature to test cyclic requirement of a feature requiring
C++ 11, use the `std_cxx_11` meta-feature that has exactly this meaning.
2016-11-02 10:01:24 -04:00
Brad King
6d5fb0e0d0 Features: Test feature propagation with language standard meta-feature
The `cxx_static_assert` feature may be available in C++ 98 mode of some
compilers or not available at all in others.  Intstead of using an
individual feature to test propagation of a feature requiring C++ 11,
use the `std_cxx_11` meta-feature that has exactly this meaning.
2016-11-02 10:01:23 -04:00
Brad King
b0996a3fa2 Features: Add meta-features requesting awareness of a particular standard
A common use case of `target_compile_features` is simply to specify that
the compiler should be run in a mode that is aware of e.g. C++11.  Some
projects simply specify a particular C++11-only feature to request this.
Provide a first-class way to do this by naming features after the
corresponding language standard.  Record them as always available in the
corresponding standard level so that requesting them always ensures that
standard (or higher) is used.
2016-11-02 10:00:28 -04:00
Brad King
505f56dc91 Merge topic 'custom-command-CROSSCOMPILING_EMULATOR'
f648b9be Tests: Check that CROSSCOMPILING_EMULATOR is not used on imported targets
e7480d67 Fix custom command target substitution with CROSSCOMPILING_EMULATOR
2016-11-01 09:14:37 -04:00
Brad King
f648b9be63 Tests: Check that CROSSCOMPILING_EMULATOR is not used on imported targets 2016-10-28 15:08:08 -04:00
Brad King
e7480d670b Fix custom command target substitution with CROSSCOMPILING_EMULATOR
In commit v3.6.0-rc1~88^2 (CustomCommandGenerator: Add support for
CROSSCOMPILING_EMULATOR, 2016-05-04) logic was introduced to substitute
a target's `CROSSCOMPILING_EMULATOR` for argv0 in a custom command.
However, it broke the case when the argv0 was a target name and now
fails to expand the target name to its location at the same time as
inserting the emulator.  Fix the latter case.

Inspired-by: Brian Maher <brian@brimworks.com>
Closes: #16288
2016-10-28 15:08:03 -04:00
Brad King
9a58517df4 Tests: Add case for Xcode per-config per-source COMPILE_FLAGS diagnostic 2016-10-28 11:18:15 -04:00
Zsolt Parragi
1e4bb35894 Add generator expression support to per-source COMPILE_FLAGS
This allows users to specify different genex-based compile flags for
each file in a target, e.g. compiling just a single file with `Od/Ox` in
release builds on Visual Studio.
2016-10-28 11:18:03 -04:00
Brad King
18a966c80f Merge topic 'cmake-server-handshake-improvements'
42ccbee1 server-mode: Handle generator toolset and platform in handshake
d792491c cmake-server: Better error reporting during handshake
2016-10-28 08:26:49 -04:00
Tobias Hunger
d792491c40 cmake-server: Better error reporting during handshake
Catch more problematic input during handshake and report failure.

These were caught before when trying to configure, but it is way better
to get these reports early.
2016-10-27 14:18:42 -04:00
Alex Wang
68e7250a9f Features: Fix cxx_right_angle_brackets compiler feature test
The clang-format pass in commit v3.6.0-rc1~54^2~1 (Revise C++ coding
style using clang-format, 2016-05-16) changed the template right angle
brackets from `>>` to `> >`, which defeats the purpose of this test.
Change it back and exclude this content from formatting.
2016-10-25 13:38:12 -04:00
Brad King
9430125511 Merge topic 'ninja-subdir-binary-dir'
87cc9bfc Merge branch 'backport-ninja-subdir-binary-dir' into ninja-subdir-binary-dir
e983bd32 Ninja: Use binary dir for `$subdir/all` targets
42db2ebc Ninja: Use binary dir for `$subdir/all` targets
2016-10-25 09:08:51 -04:00
Brad King
9a399c27a8 Merge topic 'cmake-server-message-quoting'
9b8dc79c cmake-server: Change message wrapper to avoid ambiguity with content
2016-10-25 09:08:49 -04:00
Brad King
9b8dc79cc8 cmake-server: Change message wrapper to avoid ambiguity with content
Change our message wrapper from

    [== CMake Server ==[ ... ]== CMake Server ==]

to

    [== "CMake Server" ==[ ... ]== "CMake Server" ==]

to guarantee that no JSON content can ever contain the ending string
(because it would be encoded as `]== \"CMake Server\" ==]`).
2016-10-24 14:36:13 -04:00
Alexis Murzeau
e983bd326a Ninja: Use binary dir for $subdir/all targets
The targets added by commit v3.6.0-rc1~240^2~2 (Ninja: Add `$subdir/all`
targets, 2016-03-11) use as `$subdir` the relative path from the top of
the source tree to the current source directory.  This is not correct
when using `add_subdirectory(test test_bin)`.  Instead we need to use
the relative path from the top of the binary tree to the current binary
directory as was done for related targets by commit v3.7.0-rc1~268^2
(Ninja: Add `$subdir/{test,install,package}` targets, 2016-08-05).
2016-10-24 10:30:02 -04:00
Daniel Pfeifer
e3770c56a8 BootstrapTest: Use --parallel=... argument.
Determine the number of processors and provide it to the bootstrap
script.  Also make sure this test does not run parallel with other
tests.
2016-10-21 18:22:44 +02:00
Brad King
dd7f9d8393 Merge topic 'allow-fallback-config-mapping'
587ab322 Tests: Add test for MAP_IMPORTED_CONFIG_<CONFIG> empty fallback
149d49ea Teach MAP_IMPORTED_CONFIG_<CONFIG> to support configuration-less import
60d73393 Help: Format MAP_IMPORTED_CONFIG_<CONFIG> documentation
2016-10-21 08:59:37 -04:00
Brad King
e094c8fa0a Merge topic 'ninja-diagnose-missing-tool'
010560be Ninja: Fail early on when ninja build tool does not run
2d3aa942 cmGlobalGenerator: Allow FindMakeProgram to fail
2016-10-21 08:59:30 -04:00
Brad King
97670dbf2f Merge topic 'android-armeabi-c++_static'
43f4326e Android: Fix support for armeabi with c++_static
2016-10-21 08:59:07 -04:00
Brad King
43f4326ece Android: Fix support for armeabi with c++_static
Add missing "unwind" and "atomic" libraries needed for this combination.
See `${ndk}/sources/cxx-stl/llvm-libc++/libs/armeabi/libc++.a` for the
libraries the NDK uses.

Issue: #16380
2016-10-21 08:42:25 -04:00
Brad King
587ab32213 Tests: Add test for MAP_IMPORTED_CONFIG_<CONFIG> empty fallback 2016-10-20 11:51:11 -04:00
Brad King
010560be66 Ninja: Fail early on when ninja build tool does not run
Diagnose failure to run `ninja --version` and abort early.  Otherwise we
end up aborting with a confusing message about ninja version "" being
too old.

Closes: #16378
2016-10-20 11:04:21 -04:00
Brad King
c61b6f7f37 Merge topic 'ExternalData-multiple-hashes'
33a9aaa8 ExternalData: Add support for multiple hash algorithms
2016-10-19 08:48:37 -04:00
Brad King
1745733809 Merge topic 'fix-Android-NsightTegra'
9af881d8 Tests: Add VSNsightTegra test for VS 2015
6739d240 Tests: Fix VSNsightTegra test on Android NDK r12b
06c39612 VS: Fix NVIDIA Nsight Tegra Visual Studio Edition support
2016-10-19 08:48:31 -04:00
Brad King
a0c539b546 Merge branch 'fix-Android-NsightTegra' into release 2016-10-18 14:24:34 -04:00
Brad King
9af881d810 Tests: Add VSNsightTegra test for VS 2015 2016-10-18 13:32:50 -04:00
Brad King
6739d24030 Tests: Fix VSNsightTegra test on Android NDK r12b
Test with architecture `armv7-a` instead of `armv7-a-hard` because the
latter is supporte supported only with NDK revisions r9c to r11c.
2016-10-18 13:32:50 -04:00
Matt McCormick
33a9aaa89b ExternalData: Add support for multiple hash algorithms
Add support for projects to have `Data.txt.md5` *and* `Data.txt.sha512`
where the content links hold hashes for the same file.  Check all
`ExternalData_URL_TEMPLATES` entries in order for all available hashes.
The data acquisition is considered a failure if none of the available
URL resources has any of the given hashes.  This makes it possible to
have multiple data server resources where all servers do not support all
hashing algorithms.
2016-10-18 11:16:45 -04:00
Brad King
99177a2029 Merge topic 'propagate_ctest_use_launchers'
19beee46 ctest_configure: Propagate CTEST_USE_LAUNCHERS from caller to project
2016-10-18 08:43:00 -04:00
Brad King
9519d79b63 Merge topic 'math-EXPR-unary'
2810e561 math(EXPR): Add support for unary `+` and `-` expressions
834f52a6 cmExprParser: Revise indentation style to match rest of CMake
7aaed265 cmExprParser: Port to bison 3
2016-10-18 08:42:54 -04:00
Bill Hoffman
19beee46cc ctest_configure: Propagate CTEST_USE_LAUNCHERS from caller to project
If `CTEST_USE_LAUNCHERS` is `TRUE` in a CTest script then the
`ctest_configure` command will add `-DCTEST_USE_LAUNCHERS:BOOL=TRUE` to
the cmake command used to configure the project.  This allows a project
to only set `CTEST_USE_LAUNCHERS` in a ctest script and have launchers
work.
2016-10-17 11:15:36 -04:00
Stephen Kelly
c3fb0d95ad cmTarget: Move sanity checks and computed property access to callers
The GetProperty method is now just accessing contained data, meaning it
can be implemented in cmState.

Remove the cmMakefile context from the signature as a result and remove
the overload with the same signature.

Add a GetComputedProperty to cmTarget so that templates can be properly
instantiated.  Otherwise the Commands would need to be able to reach the
specializations which are currently in cmTarget.cxx.

As a side-effect, the CMP0026 warning now gives a backtrace to the
target when issued from a generator expression.
2016-10-16 13:56:12 +02:00
Brad King
2810e56182 math(EXPR): Add support for unary + and - expressions
Closes: #8996
2016-10-14 15:35:15 -04:00
Brad King
a8513d8a80 Merge topic 'vs-host-x64-tools'
d079e71c VS: Provide an option to use x64 host tools
779939a0 Help: Document VS and Xcode toolset selection
2016-10-14 09:25:34 -04:00
Brad King
d079e71c29 VS: Provide an option to use x64 host tools
Visual Studio provides toolchains that are themselves built for 32-bit
or 64-bit host architectures.  By default it uses the 32-bit tools, but
it can be told to prefer the 64-bit tools on 64-bit hosts.  Extend the
`CMAKE_GENERATOR_TOOLSET` specification to provide a way to request
use of the 64-bit host tools.

Closes: #15622
2016-10-14 09:22:26 -04:00
Brad King
dabd177922 Merge topic 'ninja-framework-POST_BUILD'
20278872 Ninja: Fix POST_BUILD commands on macOS Frameworks
2016-10-14 09:02:43 -04:00
Brad King
a975b21cec Merge branch 'ninja-framework-POST_BUILD' into release 2016-10-13 14:09:43 -04:00
Brad King
20278872e3 Ninja: Fix POST_BUILD commands on macOS Frameworks
The condition added by commit v2.8.12~179^2 (OS X: Fix regression
handling frameworks for Ninja, 2013-07-16) for excluding use of
versioning symlinks on macOS Frameworks must match that used for
POST_BUILD selection.  Otherwise we place the POST_BUILD commands after
a symlink step that is never added.

Closes: #16363
2016-10-13 14:04:12 -04:00
Brad King
9d0e556904 Merge topic 'ExternalProject-fix-CMAKE_CACHE_ARGS-list'
a3c98cb3 ExternalProject: Fix regression in passing list to CMAKE_CACHE_ARGS
2016-10-13 08:25:56 -04:00
Brad King
acd2eab2f3 Merge branch 'ExternalProject-fix-CMAKE_CACHE_ARGS-list' into release 2016-10-10 14:49:10 -04:00
Max Smolens
a3c98cb30e ExternalProject: Fix regression in passing list to CMAKE_CACHE_ARGS
Fix passing a list to the CMAKE_CACHE_ARGS and CMAKE_CACHE_DEFAULT_ARGS
options of ExternalProject_Add.

Following commit v3.7.0-rc1~273^2~1 (prefer list(APPEND) over
string(APPEND) where appropriate, 2016-08-08), the semicolon list
separator after the first list element was missing in the generated
cache.
2016-10-10 14:40:12 -04:00
Brad King
8fe948c54c Merge topic 'minor-cleanups'
c637e0c5 cmMakefile: Return a string from GetDefineFlags
fbc1b75c Test: Remove condition for CMake version no longer supported
3d0e95f6 cmLocalGenerator: Extract definition retrieval out of loop
2a49d86d Makefiles: Inline only use of method
b0301db2 Makefiles: Make helper class independent of cmLocalGenerator
267e0209 cmMakefile: Remove pointless condition
009019f2 Makefiles: Extract identical code from condition
378849f4 Makefiles: Replace array access with local variable
4a3c49b4 Makefiles: Separate two coupled calls
2016-10-10 10:23:39 -04:00