Commit Graph

30 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
26fa048ffe Tests: Enable CMP0091/CMP0141 for MSVC settings in FortranOnly test 2023-10-02 18:52:01 -04:00
Ben Boeckel
45513c1a69 Tests/FortranModules: move issue 25112 fix from FortranOnly
It involves modules, so it belongs in the `FortranModules` test set.
2023-09-18 19:41:47 -04:00
Ben Boeckel
c172eecea6 cmTarget: Restore Fortran_PREPROCESS property initialization
Fix a typo from commit e522f8ca06 (cmTarget: factor out properties
initialized for target which compile, 2023-02-01, v3.27.0-rc1~577^2~13),
that broke this property.

Also update the test suite to use this upgrade as some level of
coverage.

Fixes: #25123
2023-07-25 11:35:24 -04:00
Ben Boeckel
2870a67540 Tests/FortranOnly: add a test case for issue #25112
Add a test case for Fortran `OBJECT` libraries providing modules to
consumers.
2023-07-22 06:53:36 -04:00
Brad King
f53bd6f450 Tests: Bump CMake minimum required in tests to 3.5
CMake 3.27 deprecates compatibility with CMake < 3.5.  Update tests that
do not cover older interfaces to avoid the deprecation warning.

Follow the pattern from:

* commit 7b07ccdd2b (Tests/*Only: Update cmake_minimum_required versions,
                     2020-06-15, v3.19.0-rc1~629^2~1)

* commit 72e7c45e98 (Tests: Bump CMake minimum required in tests to 2.8.12,
                     2020-12-22, v3.20.0-rc1~224^2)

* commit f6b4db365a (Tests: bump cmake_minimum_required version to 2.8.12,
                     2021-04-04, v3.21.0-rc1~372^2)

Also remove explicit `cmake_policy` settings made redundant by the
version.
2023-03-01 16:36:54 -05:00
makise-homura
9f9d121ddb LCC: Disable Fortran preprocessor testing if unsupported
LCC < 1.24 has no way to disable integrated Fortran preprocessor,
and it can't produce preprocessed files explicitly. So we
disable all functionality (and therefore tests) related to it.
2023-02-16 03:55:31 +03:00
Brad King
95976514f6 Tests: Avoid using CMake{Output,Error}.log files
These log files will soon go away, so avoid using them in tests.
2023-01-18 16:40:19 -05:00
Peter Hill
6b4885b58b Ninja: Avoid preprocessing twice with explicit Fortran_PREPROCESS
Fix spurious warnings from gfortran+Ninja for preprocessing.

Fixes: #23248
2022-02-24 12:54:46 -05:00
Brad King
82470e24ae Tests: Fix FortranOnly test with Intel compiler on Windows
The test regularly fails updating the `vc*.pdb` compiler-generated
PDB file.  Add the `/Z7` flag as the compiler suggests for this.
2021-04-28 09:55:42 -04:00
Chuck Atkins
a55feff69c Tests: Update for the Fujitsu compiler 2021-03-31 09:14:38 -04:00
William R. Dieter
882baca37b Tests: Update Fortran tests for IntelLLVM
Update checks for the `Intel` compiler id to match `IntelLLVM` too.

Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
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
7b07ccdd2b Tests/*Only: Update cmake_minimum_required versions
Use 3.3 or 2.8.12 where possible.
2020-06-18 09:52:05 -04:00
Peter Hill
3888de23da Ninja: Skip Fortran preprocessing if Fortran_PREPROCESS is OFF
If `Fortran_PREPROCESS` is explicitly turned off for a source file then
we know it does not need to be preprocessed.  Teach the Ninja generator
to skip preprocessing in this case.  Otherwise we still must preprocess
just in case.

Fixes: #18870
2020-05-21 11:46:32 -04:00
Peter Hill
b0a6161190 Fortran: Add Fortran_PREPROCESS property
Issue: #18870
2020-05-21 11:44:14 -04:00
Brad King
1bc521416f CheckFortranSource*: Avoid passing -DVAR to linker
The test project is compiled with a `-DVAR` compiler flag where `VAR` is
the result variable.  Tell `try_compile` to add the flag through
`add_definitions` instead of `CMAKE_Fortran_FLAGS` so that it is not
used for linking.  Otherwise some Fortran compilers (e.g. XL 15) do not
like the flag when used to drive linking.
2020-02-28 10:57:45 -05:00
Johnny Jazeix
2d0100fac7 replace remove and remove_directory with rm in tests 2019-11-13 18:02:18 -05:00
Brad King
fb9da8e6f4 Ninja: Pass preprocessor definitions when compiling with Intel Fortran
The Intel Fortran compiler supports an extension that allows conditional
compilation based on preprocessor definitions specified on the command
line even when not preprocessing.

Fixes: #19664
2019-09-03 14:20:26 -04:00
Brad King
0b82f56ac6 VS: Fix Fortran target type selection with RC sources
The Intel Fortran `.vfproj` files do support both Fortran and the
Windows Resource compiler (`.rc)` files.  Prior to CMake 3.9 we did not
support that, but commit 2c9f35789d (VS: Decide project type by linker
lang as fallback, 2017-03-30, v3.9.0-rc1~340^2) accidentally enabled it.
It was then broken by commit d3d2c3cd49 (VS: Fix Fortran target type
selection when linking C++ targets, 2019-02-04, v3.14.0-rc1~13^2).

Restore support for Fortran+RC in VS projects and add a test case.

Fixes: #19002
2019-03-01 11:58:21 -05:00
Michael Hirsch, Ph.D
10a1477b63 CheckFortranSourceRuns: Add module to check if Fortran code runs
Add a Fortran equivalent to the existing `Check{C,CXX}SourceRuns`
modules.
2019-01-10 14:09:12 -05:00
Luz Paz
3ab7bf8285 Various typo fixes
Some are user-facing. Others are source comments.
2018-01-04 06:52:01 +11:00
Brad King
54e900abfb CheckFortranCompilerFlag: Add test case
Extend the FortranOnly test with a case covering this module.
2015-02-05 11:18:13 -05:00
Tim Gallagher
b6b37e3037 Makefile: Add assembly and preprocessed targets for Fortran
Extend the FortranOnly test to cover "make <src>.i" targets.
2014-11-10 10:24:53 -05:00
Brad King
a128129a86 VS: Support Intel Fortran 15 .vfproj generation (#15175)
This version of the Intel Fortran plugin to Visual Studio says:

 please make sure that $(OutDir), $(TargetName) and $(TargetExt)
 property values match the value specified in %(Link.OutputFile)

We must set TargetName and TargetExt in addition to the existing
setting for OutputDirectory.  The settings do not appear to hurt
older versions of Intel Fortran, so set them unconditionally.

Extend the FortranOnly test to cover a corresponding use case by
using the OUTPUT_NAME target property.

Inspired-by: Ian Harvey <Ian.Harvey@megms.com.au>
2014-09-30 08:24:50 -04:00
Brad King
7386d0d6df Add CheckFortranSourceCompiles module (#14656)
Copy the CheckCSourceCompiles module and port it to Fortran.
Extend the FortranOnly test to try using the new module.

Suggested-by: Nicolas Bock <nicolasbock@gmail.com>
2014-08-18 11:18:48 -04:00
Brad King
5c0c635a09 Fortran: Add support for free- and fixed-form flags
Define a "Fortran_FORMAT" target and source file property.  Initialize
the target property from a "CMAKE_Fortran_FORMAT" variable.  Interpret
values "FIXED" and "FREE" to indicate the source file format.  Append
corresponding flags to the compiler command line.
2011-08-31 10:24:43 -04:00
Bill Hoffman
3c53fbb1f0 Fix custom commands in VS2010 Fortran projects using CFG_INTDIR and test.
For custom commands in VS2010 Fortran projects the INTDIR variable
is different than in the rest of the solution because Intel
fortran still uses the old VS project files even in VS2010. So,
we replace $(Configuration) directly in the project files. I have also
added a FortranOnly test that tests this feature and is run on any
generator that has Fortran abilities.
2011-08-03 17:24:43 -04:00