| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Xcode no longer puts an extra backslash in its `-std=` flags.
|
| |
|
|
|
|
|
|
|
|
| |
For policy-specific tests, use the version before the policy was
introduced. Otherwise, use 3.5 where possible.
Also, remove `cmake_minimum_required()` and `project()` calls from
individual cases where they are handled by `CMakeLists.txt`.
|
|
|
|
|
|
|
|
|
| |
With CMP0128 OLD compiler extensions are enabled by default regardless of the
compiler's default.
Fix the test to always check for the extension flag as it was intended to.
Fixes: 4a0485be7f4ab06201c478f5a46111ab1e8e773e (cmStandardLevelResolver: Avoid
unnecessary flags, fix unset level logic, 2021-04-29)
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| | |
ee1396e29e CMP0128: Add flag in OLD mode even when standard matches the default
b2c25de8e0 CMP0128: Avoid test code duplication
3a089cd256 CMP0128: Prefix test names with mode
e13dd52535 XL: Detect default extensions mode for legacy compiler
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6890
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Commit 4a0485be (cmStandardLevelResolver: Avoid unnecessary flags, fix unset
level logic, 2021-04-29) unintentionally changed the behavior by modifying the
code to match a pre-existing comment. The resulting behavior change however
matches the intentions of CMP0128, so we simply need to guard it.
Fixes #23122.
|
| | |
|
| |
| |
| |
| | |
Makes clear that these tests are for the NEW behaviour.
|
|/
|
|
| |
Fixes #23079
|
|
|
|
|
|
|
|
|
|
|
| |
This was intended to be part of the initial MR (!6177), but accidentally went
missing when debugging nightly failures on less common systems. Noticed during
!6711 review as the comment about this behaviour didn't match the code.
Documentation for CMP0128 is updated to remove a false case and note the two
cases related to this.
Fixes #22224.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The changes are part of CMP0128.
When the standard level is unset:
* Flags are added if extension mode doesn't match the compiler's default.
Previously logic only worked if LANG_EXTENSIONS was ON. Fixes #22224.
* The full flag is used. Previously CMAKE_LANG_EXTENSION_COMPILE_OPTION was
used. This was only supported for IAR.
Otherwise:
* Avoid adding flags if not necessary per the detected compiler defaults.
* Fixed check for when the requested standard is older. It now matches the
nearby comments.
I reworded the fallback comment as its logic was a bit difficult to wrap my
head around.
|
| |
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Use the __cplusplus and __STDC_VERSION__ macros to automatically
determine the default dialect for the compiler while determining its
id and version.
|
|\
| |
| |
| |
| | |
00d66557 Diagnose invalid <LANG>_STANDARD value instead of crashing (#15426)
|
| | |
|
|/
|
|
|
| |
The default expectation of RunCMake tests is empty content, so there
is no need to specify it.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Define an empty string in CMAKE_<LANG>_STANDARD_DEFAULT to mean that
the toolchain has no notion of lanuage standard levels. In this case
the <LANG>_STANDARD[_REQUIRED] properties will have no effect.
Update the RunCMake.CompileFeatures test to exclude the
LinkImplementationFeatureCycle test when there is no standard default.
It can never fail because no use of specific features will adjust the
CXX_STANDARD level required for any target since the standard levels
have no meaning in this case.
|
|
|
|
|
| |
Shorten the NotAFeature_OriginDebug_target_compile_features case name to
avoid creating really long paths that fail with some tools on Windows.
|
|
|
|
|
|
| |
We require that the $<$<COMPILE_FEATURES:cxx_feature>:empty2> generates
a '1' when CXX11 is enabled. GNU 4.4 does not support cxx_nullptr, but
does support cxx_auto_type.
|
|
|
|
|
| |
After commit f13a2eb1 (Features: Adjust the RunCMake test to use
more-common features., 2015-01-15).
|
| |
|
|
|
|
|
|
|
| |
The second hunk of commit 07d1f6fc (Features: Properly evaluate if the
compiler supports cxx_final, 2014-12-31) was a workaround for a bug in
the COMPILE_FEATURES generator expression that caused it never to return
0. Revert the workaround so we can fix the bug instead.
|
|
|
|
|
|
|
|
|
|
|
| |
Revert commits:
2d738ce3 Help: Add notes for topic 'feature_record_msvc'
f73718c9 Features: Enable writing of MSVC compiler feature header.
64c30bdc Features: Record for MSVC C++ 2015 and MSVC C 2010-2015.
225c0ef8 Features: Record for MSVC 2010-2013.
This topic was merged to master prematurely, so remove it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Notes:
VS2015 and above are the only MSVC versions to support cxx_final, so remove
usages from the tests, and instead only test for cxx_override.
VS2012 and above to conform to cxx_decltype_incomplete_return_types
proposal, but without support for auto return types the dcl.type.simple
example in the proposal doesn't compile.
VS2013 and above to conform to the updated cxx_contextual_conversions proposal,
but VS2010 and above pass the test.
Compilers such as MSVC have no explicit flags to enable C++11 mode,
it just is always on. So only run the link tests with compilers that require
a flag to specify the language version.
|
|
|
|
|
|
| |
Previously we expanded HAVE_FINAL to determine what the copied_file number
would be, but when we don't have cxx_final than HAVE_FINAL is not defined.
What we really want is to use expected_result.
|
|
|
|
|
|
|
| |
Mark the generated source file with the GENERATED property explicitly
since it is not marked automatically as the output of any custom
command. Mark both the 0 and 1 variants so it works no matter the
outcome of the generator expression.
|
|
|
|
|
|
|
|
|
|
|
| |
Compilers enable their extensions by default, and disabling them
implicitly can lead to results which are surprising or non-obvious
to debug.
http://public.kitware.com/pipermail/cmake-developers/2014-May/010575.html
http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/10214
https://www.mail-archive.com/cmake-developers@cmake.org/msg10116.html
(Compiler feature extensions by default, 29 May 2014)
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allow setting build properties based on the features available
for a target. The availability of features is determined at
generate-time by evaluating the link implementation.
Ensure that the <LANG>_STANDARD determined while evaluating
COMPILE_FEATURES in the link implementation is not lower than that
provided by the INTERFACE of the link implementation. This is
similar to handling of transitive properties such as
POSITION_INDEPENDENT_CODE.
|
|
|
|
|
|
|
|
|
|
|
| |
Add properties and variables corresponding to CXX equivalents.
Add features for c_function_prototypes (C90), c_restrict (C99),
c_variadic_macros (C99) and c_static_assert (C11). This feature
set can be extended later.
Add a <PREFIX>_RESTRICT symbol define to WriteCompilerDetectionHeader
to conditionally represent the c_restrict feature.
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
47795421 Fix whitespace in docs.
aa283b6b Features: Fix test for GNU 4.8.1.
bbfd4cd4 Features: Include the language of the compiler in error messages.
|
| | |
|
|/ |
|
|
|
|
|
|
| |
Users of the new target_compile_features command are expected to
check the existence of the CMAKE_CXX_COMPILE_FEATURES variable before
attempting to use it to require features.
|
|
|
|
|
|
|
|
|
|
|
| |
This can be used to set the compiler features required by particular
targets. An error is issued at CMake time if the compiler does not
support the required feature. If a language dialect flag is required
by the features used, that will be added automatically.
Base the target_compile_features command on cmTargetPropCommandBase. This
gives us 'free' handling of IMPORTED, ALIAS, INTERFACE, non-compilable
and missing targets.
|
|
|
|
|
|
|
|
|
|
|
| |
Extend the interface of the target_compile_features command with
PUBLIC and INTERFACE keywords. Populate the INTERFACE_COMPILER_FEATURES
target property if they are set. Consume the INTERFACE_COMPILER_FEATURES
target property from linked dependent targets to determine the final
required compiler features and the compile flag, if needed.
Use the same pattern of origin-debugging which is used for other
build properties.
|
|
|
|
|
|
| |
Delay validation of the content as a feature if it contains a
generator expression. It will be checked again at generate-time
after evaluation.
|
|
Record the availability of this feature for GNU 4.8 on (UNIX AND
NOT APPLE) only. In the future, availability can be recorded for
earlier GNU, for other platforms and for other compilers. Initially
the affected configurations are as restricted as possible to allow
for easy testing while extending the features vector in only one
dimension.
The error message when using the set_property API directly is not
very good, but follow up commits will provide origin debugging of
the property and a target_compile_features command which will
provide a configure-time backtrace when possible.
|