Commit Graph

145 Commits

Author SHA1 Message Date
Saurabh Kumar
daf6cc89ee LFortran: Remove hard-coded --generate-object-code flag
This was added in commit 98d0f918ba (LFortran: Add support for this
compiler, 2024-01-25, v3.31.0-rc1~303^2~2) because it is needed for
cases covered by CMake's Fortran tests.  However, it does not work
with Fortran modules and breaks lfortran's own `examples/project1`.
Move the flag to the test cases that need it, just as the original
commit did with `--implicit-interface`.

Fixes: #26597
Co-authored-by: Brad King <brad.king@kitware.com>
2025-01-09 14:49:39 -05:00
Brad King
9e3b559b6a Tests: Update cmake_minimum_required versions to 3.10 2024-10-03 14:18:16 -04:00
Christoph Junghans
98d0f918ba LFortran: Add support for this compiler
Fixes: #25419
2024-07-22 16:50:33 -04:00
Brad King
264dcae5e4 Tests: Fix clang -Wstrict-prototypes warnings 2023-10-26 09:20:45 -04:00
David Lindauer
531b4fe643 OrangeC: Add support for OrangeC compiler
Add compiler information modules.  Update the test suite.

Fixes: #25032
Co-authored-by: Brad King <brad.king@kitware.com>
2023-09-25 12:27:29 -04:00
Ryan Krattiger
80838316a8 CrayClang: Add support for this compiler
Add `CrayClang` compiler ID for newer Cray compilers.

Fixes: #25102
2023-09-22 09:39:52 -04:00
Brad King
3728f079af codespell: Avoid escape sequence that looks like misspelled "nodes" 2023-05-22 16:50:51 -04:00
Robert Maynard
96bc59b1ca CUDA: Add Device LTO support for nvcc
Fixes #22200
2022-07-22 10:34:45 -04:00
Aaron Liu
6da99e671c IBMClang: Add support for IBM Open XL C/C++
Fixes: #22929
2022-01-27 09:38:01 -05:00
makise-homura
3958ed878f LCC: Add policy CMP0129 regarding interpreting LCC as GNU
Due to MCST LCC compiler identification is now changed to LCC,
there should be a way for old projects to still identify it as GNU,
as it was before.
This commits adds the policy:
CMP0129: Compiler id for MCST LCC compilers is now LCC, not GNU.
This policy controls such a behavior.
OLD behaivior is to treat LCC as GNU, NEW is to treat is as LCC.
2021-10-21 17:24:22 +03:00
makise-homura
e5d9fce03f LCC: Add dedicated support for MCST LCC compiler
Divert LCC compiler as a new one, instead of treating it as GNU.

Since old times, Elbrus C/C++/Fortran Compiler (LCC) by MCST has been
passing checks for GNU compilers, so it has been identified as GNU.
Now, with intent of seriously upstreaming its support, it has been
added as a separate LCC compiler, and its version displays not a
supported GCC version, but LCC version itself (e.g. LCC 1.25.19 instead
of GNU 7.3.0).

This commit adds its support for detection, and also converts basically
every check like 'is this compiler GNU?' to 'is this compiler GNU or
LCC?'. The only places where this check is untouched, is where it
regards other platforms where LCC is unavailable (primarily non-Linux),
and where it REALLY differs from GNU compiler.

Note: this transition may break software that are already ported to
Elbrus, but hardly relies that LCC will be detected as GNU; still such
software is not known.
2021-10-15 05:05:19 +03:00
Yuichiro Utsumi
a237450948 Tests: Update for the FujitsuClang compiler 2021-03-31 09:14:45 -04:00
Chuck Atkins
a55feff69c Tests: Update for the Fujitsu compiler 2021-03-31 09:14:38 -04:00
Brad King
f26f10184f Tests: Update Module.WriteCompilerDetectionHeader for IntelLLVM 2021-01-28 09:07:01 -05:00
Tin Huynh
4de28ba4e6 Tests: Update tests for NVHPC compiler
Treat it just like PGI.
2021-01-27 09:53:02 -05:00
Brad King
1806cdd17c Tests: Avoid duplicate custom commands for Xcode "new build system" 2020-09-18 13:02:19 -04:00
Brad King
7f786c6a40 Tests: Cover CheckTypeSize with uint8_t and std::uint8_t 2020-07-22 08:25:09 -04:00
Zsolt Parragi
c856d4556b bindexplib: supporting llvm bitcode formats using llvm-nm 2019-08-30 11:30:38 -04:00
Brad King
d50b31be35 Clang: For MSVC ABI do not use modes older than C++14
Since commit d44c0db0b2 (clang: setup correct configuration in gnu mode,
2019-02-20, v3.15.0-rc1~41^2~5) we support the GNU-like Clang that
targets the MSVC ABI.  However, Clang cannot compile with the MSVC
standard library unless it runs in a mode aware of C++14 (since MSVC
itself does not even have a lower mode).  When `CMAKE_CXX_STANDARD` is
set to 98 or 11, use C++14 anyway.

Since Clang's default mode is aware of C++14, another option is to not
add any flags for 98 or 11.  However, if a future Clang version ever
defaults to a higher C++ standard, setting the standard to 98 or 11
should at least not use a mode higher than 14.

Also revert test updates from commit 4819ff9647 (Tests: fix failures
with gnu mode clang on windows, 2019-03-21, v3.15.0-rc1~41^2~3) that
were meant to work around the standard selection problem.

Fixes: #19496
2019-07-24 07:40:30 -04:00
Zsolt Parragi
4819ff9647 Tests: fix failures with gnu mode clang on windows
Root causes were:
    * Using incorrect conditions (assuming MSVC-like command line mode)
    * Trying to compile the MSVC STL in C++11 mode, when parts of it require
      C++14 or enabling MS extensions in clang.
    * Missing flush in a testcase using stdout in a dll and a main part
    with static crt
2019-05-24 08:43:42 +02:00
Brad King
876680e94b Merge topic 'meta-feature_only_infer_granular_support'
613ac56e50 Add a test to verify meta-feature parity with granular features
b0f46c48f6 CompileFeatures: Now able to presume full language level support
646fb1a646 CompileFeatures: memoize C++ compilers with full language level support
0d641fcfad Tests: Remove outdated portion of CompileFeatures genex test

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3176
2019-04-10 08:49:21 -04:00
Robert Maynard
b0f46c48f6 CompileFeatures: Now able to presume full language level support
Previously compilers that only supported the meta-level flags
would not have any of the granular features listed. Now we
presume that they have full support and enable all the features.

Update granular feature tests to skip the actual compilation
checks for the presumed features.
2019-04-09 08:44:56 -04:00
Damien R
37da6af17d find_dependency: Always search dependencies
When a dependency was already found, find_dependency did not search it
again. While this works in basic case, it does not when there are
components as the check does not take components into account.

Given the fact that there is no documentation about this optimization and
that the correct implementation is not trivial as it would require
changes in find_package to have the list of components already found we
always search dependencies.

Fix #17583.
2019-03-29 22:03:21 +01:00
Brad King
8fc0c98f08 Tests: Fix Module.WriteCompilerDetectionHeader for Intel on Windows
Fix a condition added by commit 091afa7342 (Tests: Teach tests when to
treat clang-cl as MSVC, 2018-11-06) to be specific to Clang.
2019-02-14 09:27:40 -05:00
Zsolt Parragi
091afa7342 Tests: Teach tests when to treat clang-cl as MSVC
* Disable the system include unused variable test in ExportImport when
  clang is in MSVC compatible mode.

* Disable CxxDialect testcase when clang is in MSVC compatible mode, as
  it doesn't support `typeof`.

* Teach Module.WriteCompilerDetectionHeader to treat clang-cl as MSVC.

* Disable the SystemIncludeDirectories testcase within
  IncludeDirectories when clang is in MSVC compatible mode.

* Disable the CMakeOnly.CheckCXXCompilerFlag testcase when clang is in
  MSVC compatible mode.

* Treat clang-cl as MSVC in LinkOptions.cmake in the try_run and
  try_compile testcases.
2019-02-11 15:04:28 +01:00
Kitware Robot
d7204e649e Revise C++ coding style using clang-format-6.0
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`.  Use `clang-format` version 6.0.

* 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.
2018-06-01 09:53:42 -04:00
Brad King
bb66cea6c5 Tests: Avoid duplicate rules in ExternalData test
In commit v3.7.0-rc1~158^2 (ExternalData: Tolerate files duplicated
across multiple targets, 2016-07-07) we added a test case for repeating
the same data file reference in three different targets in the same
directory in order to exercise its corresponding fix.  However, we
re-used the top-level `Data.dat` file which is already produced by
an unrelated test case.  `ninja` diagnoses the duplicate rule.

Update the test to use a dedicated data file name for the three-times
repeated case to avoid this conflict.  It still covers the original
purpose of the test.
2018-04-13 08:06:48 -04:00
Rolf Eike Beer
f38d050231 WCDH: introduce BARE_FEATURES
This allows defining compat versions of some C/C++ features with the name of the
keyword itself, so all code can look as if it was written for the new language
standard.
2018-04-03 20:56:28 +02:00
Brad King
a749fcb3d0 Merge topic 'modernize-git-whitespace-attributes'
8ed03baa gitattributes: prefer `eol=crlf` to `-crlf`
40470031 MumpsCoverage: remove unnecessary attribute
d20485d8 gitattributes: prefer `eol=lf` to `crlf=input`
b85c2589 gitattributes: prefer `-text` for binary files
377f3685 gitattributes: remove unused attributes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1173
2017-08-25 11:04:05 -04:00
Ben Boeckel
b85c2589a1 gitattributes: prefer -text for binary files 2017-08-23 13:30:00 -04:00
Brad King
6756b552ee Tests: Print more info on CheckIPOSupported test failure 2017-08-23 08:43:28 -04:00
Chuck Atkins
e556f1b909 CompileFeatures: Makes tests work with meta-feature only 2017-05-29 13:51:45 -04:00
Ruslan Baratov
eeb58c5c34 Tests: Add cases for typical CheckIPOSupported usage 2017-04-18 11:54:33 -04:00
Daniel Pfeifer
e2f25d3e82 WriteCompilerDetectionHeader: fix STATIC_ASSERT
fixes #16185
2017-03-06 20:52:09 +01:00
Rolf Eike Beer
940bf6a4a4 Tests/Module/WCDH: only use -Werror=undef compiler flag if actually supported 2017-02-02 18:28:56 +01:00
Rolf Eike Beer
f26ca5a195 Tests/Module/WCDH: write multi_file_compiler_detection.h before using it
This was broken in commit 98e6d1e5e4
(Tests/Module/WCDH: make it work with only C features defined) when all C tests
were made accessible even if no C++ features are available, but the header was
only created if C++ features are available. Fix it by creating the header
unconditionally before any checks on the available features.
2017-02-02 18:25:28 +01:00
Rolf Eike Beer
98e6d1e5e4 Tests/Module/WCDH: make it work with only C features defined 2017-01-30 19:19:44 +01:00
Rolf Eike Beer
c8703e9d7b WCDH: optionally omit error code for unknown compilers or compiler versions
This allows one to generate a header that will basically always work. In case
an unknown compiler or compiler version is encountered it simply falls back to
the unsupported case.
2017-01-30 19:19:44 +01:00
Brad King
b4ffd26fd8 ExternalData: Add support for SHA-3 algorithms 2016-11-11 11:46:00 -05:00
Matt McCormick
33a9aaa89b ExternalData: Add support for multiple hash algorithms
Add support for projects to have `Data.txt.md5` *and* `Data.txt.sha512`
where the content links hold hashes for the same file.  Check all
`ExternalData_URL_TEMPLATES` entries in order for all available hashes.
The data acquisition is considered a failure if none of the available
URL resources has any of the given hashes.  This makes it possible to
have multiple data server resources where all servers do not support all
hashing algorithms.
2016-10-18 11:16:45 -04:00
Brad King
f9973166e8 ExternalData: Tolerate files duplicated across multiple targets
If multiple ExternalData_Target_Add calls generate the same output file
then we need to avoid calling add_custom_command multiple times with
that output.  This was already done within a single target by setting a
variable in the local function scope.  This will not be visible in other
calls though so we need to use a directory property instead to prevent
adding a custom command multiple times for one output in a directory.

Normally it is not safe to have multiple custom commands that produce
the same output file across multiple independent targets, but since we
use atomic replacement of outputs the resulting races should not be a
problem.  For the convenience of projects, tolerate this instead of
diagnosing it.  In particular, we previously allowed up to two copies
of the custom command in one directory because CMake has a fallback
from MAIN_DEPENDENCY to an `<output>.rule` file.

While at it, add a note to the documentation that typically only one
external data target should be needed for a project.

Reported-by: David Manthey <david.manthey@kitware.com>
2016-09-07 15:17:33 -04:00
Brad King
fc3dab0ea9 Tests: Port GenerateExportHeader test to RunCMake infrastructure
This will allow build failure cases to be added later.
2016-09-05 09:45:42 -04:00
Daniel Pfeifer
7a649111cd Use string(APPEND) in Tests
Automate with:

find Tests -type f -print0 | xargs -0 perl -i -0pe \
's/set\(([a-zA-Z0-9_]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
2016-07-28 00:43:04 +02:00
Brad King
a9252441b3 Tests: Run clang-format on GenerateExportHeader code 2016-06-29 09:09:54 -04:00
Brad King
843402b04a GenerateExportHeader: Add option to specify custom content 2016-06-28 09:43:52 -04:00
Kitware Robot
d9fd2f5402 Revise C++ coding style using clang-format
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.
2016-05-16 16:05:19 -04:00
Robert Maynard
15a6c9502d WCDH: Add Intel to list of supported compilers 2016-04-28 09:16:36 -04:00
Andreas Schuh
be5a8973c3 GenerateExportHeader: Do not define DEFINE_NO_DEPRECATED (#16022)
Previously we allowed this definition to persist outside our header.
This would cause conflicts across multiple such headers because the name
was always the same.  Fix this by avoiding the definition altogether.
2016-03-17 10:40:24 -04:00
Mariusz Pluciński
ada3736c78 Tests: fix Module.GenerateExportHeader building on Clang/C2 2016-03-10 09:11:41 -05:00
Ben Boeckel
326ad9949f Tests: fix GenerateExportHeader directory definitions
There's no need to stringify the values, but instead just pass in
strings. The core problem is that the path may have tokens which are
replaced by the preprocessor which causes an invalid path to be used.
2016-02-12 13:50:32 -05:00