diff options
author | makise-homura <akemi_homura@kurisa.ch> | 2023-02-16 00:55:31 (GMT) |
---|---|---|
committer | makise-homura <akemi_homura@kurisa.ch> | 2023-02-16 00:55:31 (GMT) |
commit | 9f9d121ddb75e480660976555791e2cf3b61b1c9 (patch) | |
tree | 2d996a137c4b69b708046a70169c9e857ca63dce /Tests | |
parent | ea5f1f33fd5986a7858fa064cd747e09d372c63d (diff) | |
download | CMake-9f9d121ddb75e480660976555791e2cf3b61b1c9.zip CMake-9f9d121ddb75e480660976555791e2cf3b61b1c9.tar.gz CMake-9f9d121ddb75e480660976555791e2cf3b61b1c9.tar.bz2 |
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.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/FortranOnly/CMakeLists.txt | 17 |
1 files changed, 10 insertions, 7 deletions
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 |