Commit Graph

79 Commits

Author SHA1 Message Date
Brad King
805a40b668 Optionally exclude implicit link libraries via environment
CMake detects libraries that the compiler driver implicitly passes to
the linker, and stores them in `CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES`
for use in constructing mixed-language link lines.  Some compiler driver
flags add implicitly linked libraries that should not be used during
mixed-language linking because they are handled by similar flags passed
to the other language's compiler driver.  Add an environment variable
that users can set to avoid undesired implicit link libraries in such
scenarios.

Follow the pattern from commit 023de565d3 (Optionally exclude implicit
link directories via environment, 2023-05-25, v3.27.0-rc1~54^2).

Fixes: #26911
2025-05-05 12:12:44 -04:00
Brad King
2d04de2532 Merge topic 'macos-usr-local-lib'
6e63080d39 macOS: Restore RPATH entry for libraries linked from /usr/local/lib
430174e65d CMakeDetermineCompilerABI: Comment implicit link directory exclusion

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10663
2025-04-16 09:38:29 -04:00
Brad King
6e63080d39 macOS: Restore RPATH entry for libraries linked from /usr/local/lib
Since commit 7b19531291 (macOS: Do not pass any SDK/-isysroot to
compilers by default, 2024-11-06, v4.0.0-rc1~511^2) our default
invocation of compilers targeting macOS no longer passes `-isysroot`.
Without that, Xcode's compilers search `-L/usr/local/lib` by default
even though the macOS dynamic loader does not.  Since `/usr/local/lib`
is not a fully-implemented implicit link directory, exclude it from our
detected `CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES` so that our generators
do not suppress `RPATH` entries for dependencies in that directory.

Fixes: #26867
2025-04-15 14:13:45 -04:00
Brad King
430174e65d CMakeDetermineCompilerABI: Comment implicit link directory exclusion 2025-04-15 14:13:45 -04:00
Brad King
7f0f382c55 Provide CMAKE_<LANG>_COMPILER_ARCHITECTURE_ID on more compilers
Provide it whenever we can detect a target architecture from the
compiler during compiler inspection.  In order to avoid changing
existing IDs, do this only for compilers where we don't already
detect a target architecture during compiler identification.

Fixes: #17702
2025-03-25 09:30:36 -04:00
Marc Chevrier
ee066d2271 LinkerId: Suppress decorated diagnostics during linker inspection
Fixes: #26747
2025-03-10 10:36:27 -04:00
Kitware Robot
de273b2e11 LICENSE: Replace references to Copyright.txt with LICENSE.rst
```
git grep -lz 'Copyright.txt or https://cmake.org/licensing ' |
  while IFS= read -r -d $'\0' f ; do
    sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / {
              s/Copyright.txt/LICENSE.rst/
            }' "$f" ; done
```
2025-03-03 09:56:07 -05:00
Philip Lorenz
ec22cf1a67 CMakeDetermineCompilerABI: Strip -pipe from compile flags
When `-pipe` is enabled, GCC passes data among its different executables
using pipes instead of temporary files.  This leads to issues when cmake
attempts to infer compiler internals via the `-v` flag as each
executable will print to `stderr` in parallel.  Avoid this by stripping
`-pipe` from the compilation flags during compiler inspection.

This extends commit d5895f50c3 (CMakeDetermineCompilerABI: Avoid failing
on warnings with -Werror, 2020-01-30, v3.17.0-rc1~32^2).
2024-10-29 13:13:08 -04:00
Brad King
74beb6dba8 Xcode: Restore support for CMAKE_OSX_ARCHITECTURES=$(ARCHS_STANDARD)
Skip the `CMAKE_OSX_ARCHITECTURES` validation added by commit db409e5e68
(APPLE: Check if compilers respect CMAKE_OSX_ARCHITECTURES, 2024-05-04,
v3.30.0-rc1~15^2) if the value contains a placeholder, since we do not
know the real value.

Fixes: #26128
2024-07-19 09:42:45 -04:00
René Bertin
db409e5e68 APPLE: Check if compilers respect CMAKE_OSX_ARCHITECTURES
Not all compilers that can be used on APPLE platforms will respect
the architecture(s) set in CMAKE_OSX_ARCHITECTURES and some will
not raise an error if they are unable to do this. For instance,
GCC will accept ignore additional architectures specified after the
first -arch XXX (with a non-fatal warning) and will even link the
simple test applications used in the ABI determination (and other
tests that don't require external libraries) if an architecture
is requested for which it doesn't have the required "multilib"
set-up.

Prevent unexpected build results or build failures that may occur
after a lengthy build process: verify that the binary used to obtain
the ABI information contains the requested architectures.

Fixes: #25952
2024-06-04 08:37:50 -04:00
Brad King
617884e78a Merge topic 'cxx-inspect-without-scanning'
6df925b595 cxxmodules: Do not scan sources while testing the compiler

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !9494
2024-05-07 08:34:05 -04:00
Brad King
6df925b595 cxxmodules: Do not scan sources while testing the compiler
The C++ sources we use to test the compiler do not use modules.
Avoid requiring a compiler that can scan just to enable the language,
even when CMP0155 is NEW.  The project may explicitly turn off
`CMAKE_CXX_SCAN_FOR_MODULES` before adding any targets.

Fixes: #25956
2024-05-06 13:59:27 -04:00
Brad King
ad13d01621 Merge topic 'cmp0159_warnings'
3cd64287fe Modules: Fix CMP0159 warnings in modules when tracing

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9385
2024-04-01 09:43:14 -04:00
Juan Ramos
3cd64287fe Modules: Fix CMP0159 warnings in modules when tracing
Closes: #25829
2024-03-29 13:51:59 -07:00
Sung, Po Han
e60281e968 CMakeDetermineCompilerABI: Remove -Werror from per-config flags
Extend the fixes from

* commit 079ea66468 (CMakeDetermineCompilerABI: Handle NVCC-style -Werror
  flags, 2020-10-04, v3.19.0-rc1~45^2), and
* commit cec6f98018 (CMakeDetermineCompilerABI: Avoid removing the flag
  after -Werror, 2023-05-29, v3.26.5~4^2)

to apply to the per-config flags propagated by CMP0066's NEW behavior.
2024-03-28 13:16:18 -04:00
Marc Chevrier
c26c6ac488 Link Step: compute effective linker used by the compiler
Extract the effective linker during the computation of implicit artifacts
delivered by the compiler to the linker.
Define various variables describing the linker:
* CMAKE_<LANG>_COMPILER_LINKER
* CMAKE_<LANG>_COMPILER_LINKER_VERSION
* CMAKE_<LANG>_COMPILER_LINKER_ID
* CMAKE_<LANG>_COMPILER_LINKER_FRONTEND_VARIANT

This is complementary to feature introduced by commit 96a953b1ed
(Add options to specify linker tool, 2023-09-27).

Fixes: #17596, #18209, #25344
2023-10-24 08:34:50 -04:00
Brad King
7571e653f4 CMakeDetermineCompilerABI: Add option to skip implicit link info parsing
Provide a way to do the parsing earlier and not overwrite it here.
2023-10-02 18:51:59 -04:00
Brad King
8c8b3f1bfa HIP: Fix support for -DCMAKE_HIP_ARCHITECTURES=native with NVCC 2023-09-25 16:21:55 -04:00
Brad King
888c235eca Merge topic 'werror_space_fix'
cec6f98018 CMakeDetermineCompilerABI: Avoid removing the flag after -Werror

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !8518
2023-05-31 09:25:08 -04:00
Raul Tambre
cec6f98018 CMakeDetermineCompilerABI: Avoid removing the flag after -Werror
The matching became too eager after commit 079ea66468
(CMakeDetermineCompilerABI: Handle NVCC-style -Werror flags, 2020-10-04,
v3.19.0-rc1~45^2). When -Werror was specified without a value we would
eat the following flag. Prevent this by disallowing "-" as the first
character of the flag's value.

Fixes: 079ea66468
See-also: https://discourse.cmake.org/t/8230
2023-05-30 11:03:09 -04:00
Brad King
023de565d3 Optionally exclude implicit link directories via environment
A misconfigured compiler may pass extraneous implicit link directories
to its linker.  If they are in `CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES`,
CMake may generate extra `-L` flags on mixed-language link lines that
break linking.  Add an environment variable that users can set to work
around such misconfiguration of their compilers.
2023-05-25 13:42:58 -04:00
Brad King
997e5fa714 Merge topic 'vs-fortran-try_compile'
4da50fe3f4 VS: Remove extra try_compile argument in Intel Fortran check

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8383
2023-04-03 08:56:55 -04:00
Brad King
921ffd3070 Merge topic 'vs-fortran-try_compile' into release-3.26
4da50fe3f4 VS: Remove extra try_compile argument in Intel Fortran check

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8383
2023-04-03 08:56:54 -04:00
Brad King
4da50fe3f4 VS: Remove extra try_compile argument in Intel Fortran check
Refactoring in commit d00d8537f6 (Modules: Use new keyword-dispatched
try_compile signature, 2022-09-16, v3.25.0-rc1~115^2) accidentally
left one of the old signature arguments behind, causing a warning.
2023-03-31 08:22:23 -04:00
Brad King
f6ed2585e5 Modules: Record system inspection steps in the configure log
Replace old-style `file(APPEND .../CMake{Output,Error}.log)` logging
with calls to `message(CONFIGURE_LOG)` to record the steps in the
`CMakeConfigureLog.yaml` configure log instead.

Issue: #23200
2023-01-18 17:59:10 -05:00
Brad King
0f688386ea Modules: Drop redundant check logging to CMakeOutput.log and CMakeError.log
`try_compile` and `try_run` now automatically log checks using them to
`CMakeConfigureLog.yaml`.

Add `LOG_DESCRIPTION` arguments to some `try_compile` calls to
replace the description previously written to the old logs.

Issue: #23200
2023-01-18 16:41:01 -05:00
Matthew Woehlke
d00d8537f6 Modules: Use new keyword-dispatched try_compile signature
Modify modules that ship with CMake and use the project flavor of
try_compile to use the new signature added by commit 56ae40cc59
(try_compile: Add PROJECT keyword-dispatched signature, 2022-09-14).
2022-09-16 13:14:51 -04:00
Matthew Woehlke
2edf0fc6d7 Modules: Use new keyword-dispatched try_compile signature
Modify most of the modules that ship with CMake to use the new
try_compile / try_run signatures added by commit aa9220d3a0
(try_compile: Add keyword-dispatched signature, 2022-09-02). This
improves debugging by each invocation using its own directory so that
the results of multiple invocations can be retained.

This does not cover any invocations which provide an entire project, as
that flavor of try_compile has not yet been updated.
2022-09-14 07:52:16 -04:00
Robert Maynard
93f2cd5b7c CMakeParseImplicitLinkInfo: Better detection of msvc
Use the compiler id information in addition to checking for `cl.exe`.
2022-09-02 08:04:39 -04:00
Brad King
d1b48bfabd CUDA: Add support for CUDA_ARCHITECTURES=native
CUDA 11.6 added the `nvcc -arch=native` flag to automatically compile
for the host GPUs' architectures.  Add support for specifying this
special `native` value in `CMAKE_CUDA_ARCHITECTURES` and
`CUDA_ARCHITECTURES`.  During the compiler ABI detection step,
detect the native architectures so we can pass them explicitly
when using Clang or older versions of nvcc.

Fixes: #22375
2022-03-10 09:27:29 -05:00
Robert Maynard
764606e256 CMakeDetermineCompilerABI: Extract lib arch from implicit object file paths
The NVHPC compiler does not have any implicit link directories that can
be used to detect `CMAKE_LIBRARY_ARCHITECTURE`, but it does have
implicit object files.  Extract implicit object file paths from link
lines and check them for the `CMAKE_LIBRARY_ARCHITECTURE` pattern.

Issue: #22024
2021-04-05 17:41:10 -04:00
Robert Maynard
657fc3a9a7 CMakeDetermineCompilerABI: Parse library arch from versioned paths
Teach CMake how to extract `CMAKE_<LANG>_LIBRARY_ARCHITECTURE` from
versioned paths such as `/usr/lib/gcc/x86_64-linux-gnu/9`. These kind of
paths are generated by NVHPC compilers.
2021-02-04 15:17:49 -05:00
Brad King
f511a1c009 CMakeDetermineCompilerABI: Detect byte order as part of check
We already detect `sizeof(void*)`.  Detect the byte order as part of the
same check.

Issue: #21392
2020-11-04 10:08:13 -05:00
Brad King
606b34b3a6 CMakeDetermineCompilerABI: Look for more INFO strings in test binary
Explicitly use only the first occurrence of each matched INFO string
since previously we only extracted the first two anyway.
2020-11-04 09:45:28 -05:00
Raul Tambre
079ea66468 CMakeDetermineCompilerABI: Handle NVCC-style -Werror flags
NVCC doesn't require an equals sign for its -Werror flags.

Fixes #21265.
2020-10-04 09:09:21 +03:00
Brad King
7a01250581 CMakeDetermineCompilerABI: Fold copy error into CMAKE_<LANG>_ABI_COMPILED 2020-05-25 14:08:19 -04:00
David Rohr
d5895f50c3 CMakeDetermineCompilerABI: Avoid failing on warnings with -Werror
Simply remove `-Werror` flags from `CMAKE_<LANG>_FLAGS` to avoid failing
ABI detection if there happen to be warnings in the test project.  For
example, `-Wunused-command-line-argument` warnings are common since the
ABI detection project may not exercise all the flags passed by users.

Fixes: #20305
2020-02-03 17:01:35 -05:00
Stephen Kelly
32a6ab1f3b QNX: Add support for CMAKE_SYSROOT
QCC is a wrapper around GCC, but it is not a fully transparent wrapper.
Some compile options need to be passed to GCC using a `-Wc` option.

QCC does not support --sysroot, so setting CMAKE_SYSROOT in a toolchain
file currently does not work.  This means that it is likely that no one
is setting CMAKE_SYSROOT in existing QNC toolchain files.  Override the
GCC option for sysroot in the QCC.cmake file with -Wc,-isysroot.

This exposes a further issue in that the QNX SDK does not follow the
same architectural folder structure as linux uses.  That is, on linux
systems, architecture-specific libraries might be in

    <sysroot>/usr/lib/<arch>

such as

    /usr/lib/x86_64-linux-gnu/libcurl.so

CMake models this by suffixing the <arch> onto lib directories when
searching for libraries.

The QNX SDK is structured differently such that the <arch> should be
used as a prefix:

    <sysroot>/<arch>/usr/lib

such as

    <sysroot>/x86_64/usr/lib/libcurl.so

Add a variable for platform configuration to set whether to prefix or
suffix the <arch> and set that in the QCC.cmake.

Use the directory structure of the QNX SDK to compute the <arch> from
the implicit library directories.  The assumption is that the arch will
be a single directory directly below the CMAKE_SYSROOT, below which the
usr/ prefix occurs.

It would not be appropriate to instruct users to make the <arch> part of
the sysroot when specified in the toolchain file because:

1.  That would be non-DRY - The QCC wrapper already determines the <arch>
    by the -V argument passed to the compiler, specified in the toolchain
    file as the CMAKE_C_COMPILER_TARGET variable.
2.  The includes in the QNX SDK are not below the <arch> directory.

So, the location of the <arch> in the full path is different on QNX
compared to, say an embedded linux platform, but the intent is the same.

Add documentation to recommend the use of CMAKE_SYSROOT in a QNX
toolchain file.

As the CMAKE_SYSROOT is always the same for QNX, it would be possible to
simply set it in QCC.cmake.  However, that would change behavior for
existing users as when CMAKE_SYSROOT is set, files/paths outside of the
CMAKE_SYSROOT do not get found.

The <arch> prefixing is only enabled in cmSearchPath.cxx if
CMAKE_SYSROOT is set.  This ensures that the user gets consistency in
the current state without CMAKE_SYSROOT, and gets better consistency
when using CMAKE_SYSROOT.
2020-01-27 14:04:56 -05:00
Alex Turbov
7b2dd9dedc Refactor: Use added message types in various modules
Co-Authored-By: Craig Scott <craig.scott@crascit.com>
2019-11-02 14:10:09 +02:00
Brad King
588fa1bb9e Restore support for include_directories() in toolchain files
Any `include_directories()` calls in toolchain files are used during our
ABI detection step even though it does not include any system headers.
Since commit 5990ecb741 (Compute implicit include directories from
compiler output, 2018-12-07, v3.14.0-rc1~108^2), that check is also used
to detect implicit include directories.  Any `include_directories()` in
a toolchain file are detected as implicit and later excluded from
explicit specification on compiler command lines, thus breaking the
purpose of the calls in the first place.

Fix the implicit include directory detection step to avoid using paths
from `include_directories()` calls in the toolchain file.

Fixes: #19079
2019-03-25 11:48:17 -04:00
Brad King
890bae524c Do not explicitly report "standard" include directories as implicit
In commit 1293ed8507 (ParseImplicitIncludeInfo: keep implicit incl.
consistent when rerunning cmake, 2019-01-30, v3.14.0-rc1~26^2) we did
not account for `CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES`.  This
variable lets platform modules or toolchain files specify directories
that are to be explicitly passed as standard include directories.  These
include directories are used by the test project from which we extract
implicit include directories so they appear in the parsed results
whether or not the compiler really considers them implicit.  Exclude
these entries from the computed implicit include directories since they
are not actually implied by the compiler when we invoke it with
"standard" include directories passed explicitly.

Instead teach the build system generators to treat the "standard"
directories as implicit for purposes of excluding them from appearing
earlier in the compiler command line due to `include_directories` and
`target_include_directories` calls.

Issue: #18936, #18944
2019-02-18 17:12:14 -05:00
Chuck Cranor
1293ed8507 ParseImplicitIncludeInfo: keep implicit incl. consistent when rerunning cmake
The first time you run cmake, it sets the implicit include path
to the value reported by the parser (and this value gets saved
in CMake${lang}Compiler.cmake).  But if you re-run cmake,
UnixPaths.cmake blindly appends an extra /usr/include to the
value saved in CMake${lang}Compiler.cmake.  That should not be
harmful in most cases, but we want later runs of cmake to be
consistent with the initial one.  Resolve using a solution
suggested by Brad King:

  - UnixPaths now sets the default implicit include path in a new
    variable named _CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES_INIT
    This value is only used the first time cmake is run (by
    CMakeDetermineCompilerABI.cmake when it calls the implicit
    include parser).

  - if CMakeDetermineCompilerABI.cmake successfully calls the
    implicit include parser, it overwrites the value in
    _CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES_INIT with the
    value returned by the parser

  - CMakeDetermineCompilerABI.cmake always sets
    CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES to the above value
    of _CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES_INIT

  - the final value of CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES gets
    saved to CMake${lang}Compiler.cmake when it is regenerated after
    the compiler tests are done.

  - CMakeDetermineCompilerABI.cmake is only executed the first time cmake
    is run.  Additional runs of cmake directly load the implicit include
    path from the value saved in CMake${lang}Compiler.cmake (the parser
    and _INIT variable are not used).

The above depends on UnixPaths.cmake being loaded to set the _INIT value
before CMakeDetermineCompilerABI.cmake runs the implicit include parser.
2019-01-30 12:05:21 -07:00
Chuck Cranor
5990ecb741 Compute implicit include directories from compiler output
- CMakeParseImplicitIncludeInfo.cmake: new parser that extracts the
   compiler's include path from verbose output.  If the parser cannot
   parse the output, we fall back to the old behavior.  On osx we skip
   over framework directories (handled elsewhere).

 - CMakeDetermineCompilerABI.cmake:
     - use verbose flag in try_compile for ${src}
     - use new cmake_parse_implicit_include_info() to attempt extract
       implicit include directory path and if successful set
        CMAKE_${LANG}_IMPLICIT_INCLUDE_DIRECTORIES

 - CMakeCCompiler.cmake.in and CMakeCXXCompiler.cmake.in - preserve
   CMAKE_${LANG}_IMPLICIT_INCLUDE_DIRECTORIES value between runs in
   the same way CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES is preserved

 - Tests/RunCMake/ParseImplicitIncludeInfo: tests for parse
   based on the older Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in.
   The test runs a set of verbose compiler outputs collected from
   various machines through the parser and checks the results.  New
   compiler files can be added by dropping input/output files in the
   ParseImplicitIncludeInfo/data subdirectory and then adding the new set
   of files to the ${targets} list in ParseImplicitIncludeInfo.cmake.
   There is a helper CMakeLists.txt in ParseImplicitIncludeInfo/data
   that can help with the generation of test input files.
   NOTE: the standard cmake pre-commit hook rejects verbose compiler
   output with trailing spaces... you have to manually edit them out.
   This shouldn't impact the test.

Note that both the parser and the test code can use CMAKE_${LANG}_COMPILER_*
variables such as ${CMAKE_CXX_COMPILER_ID} to decide how to parse
verbose compiler output.  For the test code, this requires us to
save the variables values in the test input files.

Fixes: #16291
2019-01-21 11:14:08 -05:00
Chuck Cranor
d751d2d2ed CMakeDetermineCompilerABI: set locale to C for try_compile()
Have CMakeDetermineCompilerABI set the locale to C before calling
try_compile().  This is for the implicit include path parser to
keep all the verbose compiler messages in English so we can parse
it.   See #18784 for discussion.
2019-01-21 11:14:08 -05:00
Brad King
c765ae495a CMakeDetermineCompilerABI: pass verbose flag during compilation
Default to the same flag that is used for verbose link information, but
provide another internal platform information variable to use a
compilation-specific variant.  Populate it for CUDA where we use a
different compiler for compilation and linking and therefore need
different flags.

Co-Author: Chuck Cranor <chuck@ece.cmu.edu>
2019-01-21 11:14:08 -05:00
Fred Baksik
72e0c115b7 GHS: Add Compiler ID detection
-- Detect GHS compiler and version
   Detect ARCHITECTURE_ID for PPC / ARM / 86 targets
   Detect PLATFORM_ID for Integrity and Integrity178 platforms
   Using defines specified in the documents for the compilers: 201416 PPC / 201754 ARM / 201714 86
-- Fallback C/CXX compiler ID to GHS if not otherwise detected and using GHS MULTI generator
   Works around issue with some GHS compilers not setting __ghs__ compiler define
-- Tweak Compiler ID checking so major id of 002017 is not replaced with 217
-- Prefer try_compile() library targets when testing for working GHS compilers
-- Avoid CMake errors if reading past end of file for checking if file is PE executable
2019-01-16 10:42:04 -05:00
Brad King
86578eccf2 Simplify CMake per-source license notices
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.
2016-09-27 15:14:44 -04:00
Brad King
a4f9b6f0ca CMakeDetermineCompilerABI: Use normal linker flags in ABI project
When compiling the ABI detection test project, do not override
CMAKE_EXE_LINKER_FLAGS completely.  The normally selected value of this
variable may influence how the link is done and may be needed to be
representative of how the calling project will be built.  Instead pass a
variable that try_compile will reference as additional flags.  Leave
this behavior of try_compile undocumented for now.
2014-12-03 14:53:14 -05:00
Chuck Atkins
3e84e78c3f Use a more reliable regex for extracting binary INFO strings
A few different regular expressions were being used in various
places to extract info strings from binaries.  This uses a
consistent regex amongst all of them now.  This also fixes the
broken ABI detection for Cray compilers.
2014-09-03 17:00:48 -04:00
Brad King
03ad8f28c8 CMakeDetermineCompilerABI: Link with standard libraries on MSVC
In commit v2.8.0~395 (Implicit link info for C, CXX, and Fortran,
2009-07-23) we added a '-DCMAKE_${lang}_STANDARD_LIBRARIES=' flag to the
try_compile used to build the ABI detection project.  It is needed when
detecting the implicit libraries added by the GNU compiler on Windows
(MinGW tools) to avoid contaminating the list with standard Windows
libraries.  However, with MSVC we do not detect such implicit link
libraries anyway, and for some target platforms (e.g. Windows Phone) we
may need the standard libraries to link the ABI detection executable.
Drop the flag when detecting the ABI using MSVC.
2014-08-21 09:28:19 -04:00