Commit Graph

24 Commits

Author SHA1 Message Date
Robert Maynard
646fb1a646 CompileFeatures: memoize C++ compilers with full language level support
Previously compilers that had full support for a language standard level
were still verified every time a new build directory was created.  Now
we record this information and insert the correct granular compile
features instead of doing a `try_compile`.
2019-04-09 08:44:56 -04:00
Robert Maynard
f92ccbc306 CompileFeatures: memoize C compilers with full language level support
Previously compilers that had full support for a language
standard level was forced to verify this every time a new build
directory was created. Now we record this information and insert
the correct granular compile features instead of doing a try_compile.
2019-03-27 15:45:11 -04:00
Robert Maynard
85415afbdc CompileFeatures: Don't try_compile for language levels with no features
Previously Compilers always had to run a try_compile to determine what
language level each feature mapped to. Now we can skip the try_compile
when a language level has no features.
2019-03-20 09:10:10 -07:00
Harry Mallon
d3ffe90598 CPackRPM: Fix packaging in folders with ++ in name
Construct a regex that can match a path with special characters instead
of treating the path as a regex directly.

Fixes: #18967
2019-02-25 09:46:19 -05:00
Marc Chevrier
f255280fd9 PIE link options: Update strategy to fix performance regression
Fixes: #18700
2018-12-19 19:41:27 +11:00
Guillem Jover
38e75bb3c6 CPack/Deb: Remove paxr as a supported tar format for a .deb
The only format supported from the ones available within cpack is
gnutar, which supports large numbers encoded in base-256, and long
filenames and linknames. PAX is not and has never been a supported
format by dpkg.

Fixes: #18620
2018-11-28 09:31:28 -05:00
Marc Chevrier
c4b4d8b3a6 POSITION_INDEPENDENT_CODE: Manage link flags for executables
Fixes: #14983, #16561
2018-11-11 17:34:09 +01:00
Craig Scott
20d5e77a27 CPack: Rename Ext generator to External
Ext and External were used inconsistently in the code and the
docs. This change converts all uses of Ext to External, including
within variable names used by the generator.
2018-11-05 07:56:03 -05:00
luz.paz
6b4c5a0365 Fix misc. typos
Found via `codespell -q 3 -I ../cmake-whitelist.txt --skip="./Utilities"`
where the whitelist consists of

```
aci
ans
behaviour
buil
convertor
dum
earch
ect
emmited
emmitted
helpfull
iff
isnt
ith
lowercased
mose
nd
nknown
nto
objext
ot
pathes
pevents
splitted
substract
superceded
supercedes
te
tim
todays
uint
upto
whitespaces
```
2018-10-03 15:32:46 -04:00
Andrew Fuller
d8a3939aef CPack/Deb: Add ability to split out debug symbols into .ddeb package 2018-09-21 20:19:31 +00:00
Andrew Fuller
42fbff45e4 CPack/Deb: Use CMAKE_COMMAND to set the environment 2018-09-18 11:41:36 -07:00
Craig Scott
8ede35523e IN_LIST: Ensure policy allows if(IN_LIST) if used by a module 2018-09-12 14:50:16 +08:00
Kyle Edwards
80914d88da CPack: Add "CPack External" generator
This generator doesn't actually package the files. Instead, it
provides a metadata JSON file that can be used by external packaging
software to do its own packaging. This JSON file provides information
about the components, component groups, installation types, and CMake
projects.
2018-07-02 09:51:02 -04:00
Daniel Wyatt
611ad19499 CPack/RPM: Use CMAKE_COMMAND to reference cmake executable
Ensure we use the `cmake` corresponding to the running `cpack`
even if it is not first in `PATH` or has had its name changed.
This was accidentally left out in commit v3.7.0-rc1~81^2 (CPack/RPM:
Generate source rpm (SRPM) packages on demand, 2016-09-19).
2018-06-26 13:25:08 -04:00
Kyle Edwards
48bc8b2b82 CPack: Move internal implementation modules into Internal/CPack directory
These modules are not meant to be included by user code, they are
only an internal implementation detail for CPack. Having them live
in the main Modules directory with documentation was misleading, so
they have been moved into Modules/Internal/CPack, and their
documentation has been stripped following its move into the new
"CPack Generators" section. No-op modules which contained only
documentation have been removed entirely.

The only module that hasn't been moved is CPackIFW, because it
contains user-facing macros which would be lost if it were moved.
So, the CPackIFW module has been updated with a note explaining what
needs to (eventually) happen.
2018-06-21 11:00:28 -04:00
Brad King
d49aa10768 Features: On SunPro link feature check with lang std flag
Follow up commit e17b179184 (Features: On SunPro link with language
standard compiler flag, 2017-04-28) to apply the same fix to the feature
checks.  The `try_compile` used for these is intentionally not using
`CXX_STANDARD`-based logic so that it can test the individual flags.
2017-05-09 11:22:18 -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
8b6cc2518a Features: Centralize per-compiler recording macros
Simplify and de-duplicate per-compiler feature recording macros and
convert to a centralized per-language macro.
2016-11-02 09:51:48 -04:00
Brad King
150e1b27c5 Features: Extract strings from test binary more reliably (#15736)
Since commit v3.1.0-rc1~635^2~7 (project: Add infrastructure for
recording CXX compiler features, 2013-10-17) we compile a test source to
a binary and then extract "<LANG>_FEATURES:..." strings from the binary
with the file(STRINGS) command.  Add a newline at the beginning of the
string literal to be sure file(STRINGS) can extract the first entry as a
string independent of whatever else the compiler may put before the
storage it allocates for the literal within the binary.
2015-09-10 14:41:05 -04:00
Stephen Kelly
f6f1095413 Features: Use the features symbol in the feature-test compile.
Clang discards the entire string if it is not used, removing
the ability to read the features from the compiled binary. That
is prevented by using the symbol.

GNU with -O3 also discards the string, so use the string in a
way which is determined by a runtime value (argc) to prevent
it being discarded.
2014-05-15 19:38:25 +02:00
Stephen Kelly
5bb7ce724c Project: Use nullary form of main for compile feature tests. 2014-05-07 12:16:13 +02:00
Stephen Kelly
64254e7a74 Project: Remove extern from static string in feature tests. 2014-05-07 12:16:13 +02:00
Stephen Kelly
3fdfa5d3fc Features: Make CMAKE_CXX_KNOWN_FEATURES a property.
As a 'built-in' variable it imposes a cost on all variable lookups
and it is expected to be rarely used.
2014-05-02 10:18:16 +02:00
Stephen Kelly
faeddf64f2 project: Add infrastructure for recording CXX compiler features
Add a feature test using the compiler macros and the preprocessor to
determine available features.

Add a CMAKE_CXX_COMPILE_FEATURES variable which contains all features
known to the loaded compiler, and a CMAKE_CXX_KNOWN_FEATURES variable
containing all features known to CMake.  Add language standard specific
variables for internal use to determine the standard-specific compile
flags to use.

This will be extended to other languages in the future.  Follow-up
commits will add features which will be recorded by the feature test.
2014-04-07 16:48:44 +02:00