| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Also add a test to `RunCMake/CXXModules` to test `try_compile` with C++
modules.
Fixes: #25097
|
|
|
|
|
|
| |
This will serve to add context for the source listing in order to
properly mark sources as `FILE_SET TYPE CXX_MODULES` in the generated
code.
|
| |
|
|
|
|
|
|
|
| |
These provide more detailed information about how the test project was
configured.
Issue: #23200
|
| |
|
|
|
|
| |
Issue: #23200
|
|
|
|
|
|
| |
Add configure log events for `try_compile` and `try_run` results.
Issue: #23200
|
|
|
|
|
|
| |
Update the `TryCompileCode` signature to allow callers to distinguish
between administrative failures and a compilation failure. Return
results in a structure to which more information can be added later.
|
|
|
|
|
|
|
|
|
| |
Change the SOURCE_FROM_ARG keyword to try_compile to SOURCE_FROM_CONTENT
(which we can do because it was recently added and hasn't been in a
release yet). The new name should be clearer as to what it does, and
also more consistent with the CONTENT arguments to some other commands.
Also, fix a typo in an error message.
|
|
|
|
|
|
|
| |
Add NO_CACHE option to try_compile and try_run, which places the results
in regular, rather than cache, variables.
Issue: #22799
|
|
|
|
|
|
|
| |
Add ability to copy try_compile (and try_run) source files from
arbitrary locations into the operation directory. This is included for
the sake of completion and consolidation, although use cases which
actually require this may be rare.
|
|
|
|
|
|
|
|
| |
Add ability to "feed" try_compile (and try_run) sources more directly,
either from literal content, or from a CMake variable which contains
literal content. This saves the user from needing a separate step to
write the content to a file, and allows for the sources to only exist in
the scratch directory.
|
|
|
|
| |
Fixes #23887, #23942, #20163, #18288
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Introduce a new signature for try_compile (and try_run) which removes
the `bindir` argument and requires the SOURCES tag. This will eventually
allow us to add other ways of providing sources, but also allows us to
change the behavior without breaking compatibility.
The old signature uses a special, but non-unique temporary location
inside the specified `bindir`, which conventionally is just the
project's build directory. The new signature unconditionally uses the a
unique temporary directory which is unconditionally within the project's
build directory (which is no longer separately specified). This ensures
that successive runs do not overwrite previous runs, will simplify
debugging, and should also, eventually, allow us to execute multiple
trials in parallel.
|
| |
|
|
|
|
|
| |
This is specific to `try_compile` since `try_run` always needs an
executable. Move the logic out of the common code path.
|
|
|
|
| |
The return value is only used as a boolean, so use `bool`.
|
|
|
|
| |
Convert the command entry points to free functions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
#pragma once is a widely supported compiler pragma, even though it is
not part of the C++ standard. Many of the issues keeping #pragma once
from being standardized (distributed filesystems, build farms, hard
links, etc.) do not apply to CMake - it is easy to build CMake on a
single machine. CMake also does not install any header files which can
be consumed by other projects (though cmCPluginAPI.h has been
deliberately omitted from this conversion in case anyone is still using
it.) Finally, #pragma once has been required to build CMake since at
least August 2017 (7f29bbe6 enabled server mode unconditionally, which
had been using #pragma once since September 2016 (b13d3e0d)). The fact
that we now require C++11 filters out old compilers, and it is unlikely
that there is a compiler which supports C++11 but does not support
#pragma once.
|
|
|
|
|
|
|
| |
cmCoreTryCompile had significant code duplication around handling
languages that offer standard levels. This refactoring reduces
the complexity and makes it easier to add new languages in the
future.
|
|
|
|
|
|
| |
Several class constructors leave members uninitialized. The members are
initialized before use in methods, but it is clearer and less
error-prone to initialize them at their definition site.
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Automate with:
git grep -l '#include <cm_' -- Source \
| xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g'
git grep -l '#include <cmsys/' -- Source \
| xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g'
git grep -l '#include <cm[A-Z]' -- Source \
| xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Projects use `try_compile` to check if they will be able to compile some
particular source code. When a language standard variable like
`CMAKE_CXX_STANDARD` is set, then the project intends to compile source
code using a compiler mode for that standard. Therefore it makes sense
for `try_compile` to use that standard in the test project too.
Unfortunately this was not done when support for the
`CMAKE_CXX_STANDARD` variable was first implemented. Add a policy to
introduce the improved behavior in a compatible way.
Closes: #16456
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Per-source copyright/license notice headers that spell out copyright holder
names and years are hard to maintain and often out-of-date or plain wrong.
Precise contributor information is already maintained automatically by the
version control tool. Ultimately it is the receiver of a file who is
responsible for determining its licensing status, and per-source notices are
merely a convenience. Therefore it is simpler and more accurate for
each source to have a generic notice of the license name and references to
more detailed information on copyright holders and full license terms.
Our `Copyright.txt` file now contains a list of Contributors whose names
appeared source-level copyright notices. It also references version control
history for more precise information. Therefore we no longer need to spell
out the list of Contributors in each source file notice.
Replace CMake per-source copyright/license notice headers with a short
description of the license and links to `Copyright.txt` and online information
available from "https://cmake.org/licensing". The online URL also handles
cases of modules being copied out of our source into other projects, so we
can drop our notices about replacing links with full license text.
Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority
of the replacements mechanically. Manually fix up shebang lines and trailing
newlines in a few files. Manually update the notices in a few files that the
script does not handle.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Run the `Utilities/Scripts/clang-format.bash` script to update
all our C++ code to a new style defined by `.clang-format`.
Use `clang-format` version 3.8.
* If you reached this commit for a line in `git blame`, re-run the blame
operation starting at the parent of this commit to see older history
for the content.
* See the parent commit for instructions to rebase a change across this
style transition commit.
|
|
|
|
|
|
|
| |
Create a `CMAKE_TRY_COMPILE_TARGET_TYPE` option to specify use
of `add_library(... STATIC ...)` for the generated test project.
This will be useful for cross-compiling toolchains that cannot
link a binary without custom flags or scripts.
|
| |
|
|
|
|
| |
Alex
|
|
|
|
|
|
|
| |
This converts the CMake license to a pure 3-clause OSI-approved BSD
License. We drop the previous license clause requiring modified
versions to be plainly marked. We also update the CMake copyright to
cover the full development time range.
|
|
STYLE: create a new base class cmCoreTryCompile, from which
cmTryCompileCommand and cmTryRunCommand are derived, so there are no public
static functions with lots of arguments anymore
Alex
|