diff options
author | Brad King <brad.king@kitware.com> | 2023-02-17 13:48:34 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-02-17 13:48:50 (GMT) |
commit | 31a8e05d46c918313a8c33d79df046e0527719ca (patch) | |
tree | dc3d4ee17332da91de728d6acb7fe3a1d474bfb7 /Tests | |
parent | 7992df0751ce6437f8967adc17a3eb7098ab0993 (diff) | |
parent | 9f9d121ddb75e480660976555791e2cf3b61b1c9 (diff) | |
download | CMake-31a8e05d46c918313a8c33d79df046e0527719ca.zip CMake-31a8e05d46c918313a8c33d79df046e0527719ca.tar.gz CMake-31a8e05d46c918313a8c33d79df046e0527719ca.tar.bz2 |
Merge topic 'lcc-lfortran-fix'
9f9d121ddb LCC: Disable Fortran preprocessor testing if unsupported
ea5f1f33fd LCC: Disable implicit testing of FortranCInterface
5434547678 LCC: Don't require liblfortran on lcc versions that don't have it
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8214
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/Fortran/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/FortranOnly/CMakeLists.txt | 17 |
2 files changed, 11 insertions, 8 deletions
diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt index 0fede25..30ab16b 100644 --- a/Tests/Fortran/CMakeLists.txt +++ b/Tests/Fortran/CMakeLists.txt @@ -49,7 +49,7 @@ function(test_fortran_c_interface_module) FortranCInterface_VERIFY() FortranCInterface_VERIFY(CXX) if(CMAKE_Fortran_COMPILER_SUPPORTS_F90) - if(NOT CMAKE_Fortran_COMPILER_ID MATCHES "SunPro|PathScale|Absoft|Fujitsu") + if(NOT CMAKE_Fortran_COMPILER_ID MATCHES "SunPro|PathScale|Absoft|Fujitsu|LCC") set(module_expected 1) endif() if(FortranCInterface_MODULE_FOUND OR module_expected) diff --git a/Tests/FortranOnly/CMakeLists.txt b/Tests/FortranOnly/CMakeLists.txt index fc71a18..d749fe1 100644 --- a/Tests/FortranOnly/CMakeLists.txt +++ b/Tests/FortranOnly/CMakeLists.txt @@ -152,13 +152,16 @@ if(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON AND set_property(SOURCE preprocess3.f PROPERTY Fortran_PREPROCESS ON) endif() -# Test that neither the compiler nor CMake performs unnecessary preprocessing. -add_library(no_preprocess_target_lower STATIC no_preprocess_target_lower.f) -target_compile_options(no_preprocess_target_lower PRIVATE -DINTEGER=nonsense) -set_property(TARGET no_preprocess_target_lower PROPERTY Fortran_PREPROCESS OFF) -add_library(no_preprocess_source_lower STATIC no_preprocess_source_lower.f) -target_compile_options(no_preprocess_source_lower PRIVATE -DINTEGER=nonsense) -set_property(SOURCE no_preprocess_source_lower.f PROPERTY Fortran_PREPROCESS OFF) +# LCC < 1.24 has no way to disable Fortran preprocessor +if(NOT CMAKE_Fortran_COMPILER_ID STREQUAL "LCC" OR CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL "1.24.00") + # Test that neither the compiler nor CMake performs unnecessary preprocessing. + add_library(no_preprocess_target_lower STATIC no_preprocess_target_lower.f) + target_compile_options(no_preprocess_target_lower PRIVATE -DINTEGER=nonsense) + set_property(TARGET no_preprocess_target_lower PROPERTY Fortran_PREPROCESS OFF) + add_library(no_preprocess_source_lower STATIC no_preprocess_source_lower.f) + target_compile_options(no_preprocess_source_lower PRIVATE -DINTEGER=nonsense) + set_property(SOURCE no_preprocess_source_lower.f PROPERTY Fortran_PREPROCESS OFF) +endif() # Test that we can explicitly not preprocess a target or source. # This will not work on certain compilers due to either missing a |