We use `-Werror` in the Android test builds to make sure there are
no warnings that we care about (e.g. unused flags). However, the
NDK r13 tools produce a warning about their own builtins:
```
<built-in>: In function 'float abs(float)':
<built-in>: warning: conflicts with previous declaration here [-Wattributes]
```
Suppress this warning so that we can continue using `-Werror` but
tolerate these warnings.
Add a module to manage the data needed for the project tests. It will
move the test data to the build directory and transfer necessary data to
an Android device if that is enabled.
The `PARSE_ARGV` mode was recently added to help functions properly
parse their arguments even when those arguments may be quoted and
contain literal `;` in their values. Fix the implementation to encode
`;`s in reported multi-value arguments and in `UNPARSED_ARGUMENTS` so
that `;`s in the individual values are preserved in the lists. This
allows clients to access all their argument values correctly.
The check added in commit v3.6.0-rc1~293^2 (Diagnose recursive
project/enable_language without crashing, 2016-03-07) broke support for
enabling `RC` explicitly along with other languages like `C`. The
reason is that we enable all listed languages at once so the internal
`enable_language(RC)` that we do while enabling `C` or `CXX` on some
platforms triggers the recursion check if `RC` is explicitly listed.
Ideally we should refactor things to only enable one language at a time,
but for now it is simplest to just exclude `RC` from the explicit list
until other languages are enabled, and then enable it.
Closes: #16330
The `main.cpp` that this test generates needs a newline so that
compilers do not warn about a missing newline. Otherwise the warning
causes RunCMake infrastructure to detect unexpected output.
Refactoring in commit v3.5.0-rc1~272^2~16 (cmGeneratorTarget: Add API for
property keys, 2015-10-25) changed the Xcode generator implementation of
`XCODE_ATTRIBUTE_...` properties to use the target `GetProperty` method on each
`XCODE_ATTRIBUTE_...` property listed by `GetPropertyKeys` instead of looping
over the property entries directly. This made the lookup of property names of
the form `XCODE_ATTRIBUTE_..._LOCATION` accidentally trigger the computed
property logic for the undocumented/legacy `<CONFIG>_LOCATION` property. Of
course the computed property value is not the same as the value stored in the
`XCODE_ATTRIBUTE_..._LOCATION` property. Fix the computed property logic to
avoid triggering on `XCODE_ATTRIBUTE_...` attributes.
Closes: #16319
Use it to split pipe and stdin/out handling out of cmServer itself.
The server will shut down when it looses its connection to the client.
This has the nice property that a crashing client will cause the server
to terminate as the OS will close the connection on behave of the client.
adf1e32f Help: Add notes for topic 'ctest-capture-error'
d328dc68 CTest: Add CAPTURE_CMAKE_ERROR val to `ctest_*` commands
9ac2e189 ctest_coverage: If gcov is not found just warn, not error
The changes in commit d9cec8ad (CPack/RPM: Generate source rpm (SRPM)
packages on demand, 2016-09-19) logically conflict with the
infrastructure updates in commit 4682b42b (Tests: Add subtest support to
RunCMake/CPack infrastructure, 2016-09-13). Integrate the two changes
so they work together.
Add new test properties:
* FIXTURES_SETUP
* FIXTURES_CLEANUP
* FIXTURES_REQUIRED
to specify the roles and dependencies of tests providing/using
test fixtures.
If a `ctest_*` command has CAPTURE_CMAKE_ERROR then any errors generated
by cmake during that command will cause the value to be assigned `-1`.
This will prevent a `ctest -S` script from returning non-zero unless the
script explicitly calls `message(FATAL_ERROR)`.
d0be1e15 Add directory properties to get source and binary directories
cbca6582 Add directory property to list buildsystem targets
7a4b8d0d Add a directory property to list subdirectories
089868a2 cmState: Record buildsystem target names in each directory
Allow for experimental cmProtocolVersions, which will only ever get
listed if the server was started with the (undocumented)
"--experimental" flag.
Mark current protocol version 1.0 as experimental.
Add SOURCE_DIR and BINARY_DIR directory properties that return the
absolute paths to the corresponding directories. These correspond
to the target properties of the same names that we already have.
Adds a bare-bones cmake-server implementation and makes it possible
to start that with "cmake -E server".
Communication happens via stdin/stdout for now.
Protocol is based on Json objects surrounded by magic strings
("[== CMake Server ==[" and "]== CMake Server ==]"), which simplifies
Json parsing significantly.
This patch also defines an interface used to implement different
versions of the protocol spoken by the server, but does not include
any protocol implementaiton.
I otherwise get:
Expected stderr to match:
expect-err> CMake Error at AppendNotOutput.cmake:1 \(add_custom_command\):
expect-err> add_custom_command given APPEND option with output.*
expect-err> which is not already a custom command output.
expect-err> Call Stack \(most recent call first\):
expect-err> CMakeLists.txt:3 \(include\)
Actual stderr:
actual-err> CMake Error at AppendNotOutput.cmake:1 (add_custom_command):
actual-err> add_custom_command given APPEND option with output
actual-err> "/home/stephen/dev/src/cmake/with
actual-err> space/Tests/RunCMake/add_custom_command/AppendNotOutput-build/out" which is
actual-err> not already a custom command output.
actual-err> Call Stack (most recent call first):
actual-err> CMakeLists.txt:3 (include)
Using a specific line for paths is a style already used elsewhere for
the same reason, such as CMP0041 output.
With the most recent KWSys update, the "actual case" operation on
Windows always upper-cases the drive letter now even for absolute paths
that do not exist. Use an upper-case drive letter in the test so that
it can tolerate this operation on Windows and the lack of this operation
elsewhere.
Add options to the `install()` and `export()` commands to export the
targets we build into Android.mk files that reference them as prebuilt
libraries with associated usage requirements (compile definitions,
include directories, link libraries). This will allow CMake-built
projects to be imported into projects using the Android NDK build
system.
Closes: #15562
612d6f29 Tests: Refactor GenerateExportHeader test code
ce76abb4 Tests: Add data symbols to GenerateExportHeader test
8f95b93b Tests: Add failure test for GenerateExportHeader
Refactor the library code used in the GenerateExportHeader test to use
an improved naming convention that more directly identifies what it
being tested, making use of namespaces to avoid possible symbol
collisions. This also eliminates duplicate cases such as `libshared()`
and `libshared_not_exported()` which had the same decoration, and adds
consistent pairings of <name>_EXPORT and <name>_DEPRECATED_EXPORT which
were missing previously. The data tests from the previous commit are
also added to `libstatic` and `libshared_and_static` for consistency.
Note that there are no exported members of exported classes, as these
are not allowed on Windows.
Add static data members and global variables to the GenerateExportHeader
shared library, testing that export decoration for these works in
addition to decoration of classes and free functions.
Modify notation of statements in the GenerateExportHeader test expected
to result in link errors. Modify script used to build the test to also
generate a suite of modified sources, each having exactly one of the
failing lines enabled, and to generate EXCLUDE_FROM_ALL executables for
the same. Modify RunCMake script used to drive the test to read the list
of such executables and try to build each of them, verifying that they
do in fact fail to build.
This will verify that the _NO_EXPORT macros are working as expected, and
will also catch errors like the one that commit 0cbaaf2d
(GenerateExportHeader: Fix add_compiler_export_flags regression,
2016-09-01) fixed.
When setting up the failure tests for GenerateExportHeader, check if the
compiler actually hides non-exported stuff. If not, the failure tests
won't fail, and will cause the overall test to fail. Since this
typically is only the case for very old compilers, simply skipping them
as opposed to trying to do something more fine grained seems reasonably
safe.
The `ARGC`/`ARGV#` variables in function scope hold the original
arguments with no ;-list flattening. Add a way for functions to
cleanly parse arguments that may contain `;`. This also avoids
extra copying of the arguments.
Co-Author: Brad King <brad.king@kitware.com>