diff options
author | Nils Gladitz <nilsgladitz@gmail.com> | 2016-09-23 20:59:37 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-09-27 12:11:08 (GMT) |
commit | 144cc6f1f9020433cb4a94f072fc74f1202ce1f3 (patch) | |
tree | 5c51f0fdaa1e394456252ea998f6412e4c7826e4 /Tests | |
parent | a721830767c6a7819ed82cda5f910b732201f885 (diff) | |
download | CMake-144cc6f1f9020433cb4a94f072fc74f1202ce1f3.zip CMake-144cc6f1f9020433cb4a94f072fc74f1202ce1f3.tar.gz CMake-144cc6f1f9020433cb4a94f072fc74f1202ce1f3.tar.bz2 |
Ninja: Add source location as include directory for preprocessed files
Fortran INCLUDE statements are not handled by the preprocessor.
Since the location of the preprocessed file is distinct from the
original source file explicitly add the source file's directory
as an include path in the actual compile step (not the preprocessing step)
so INCLUDE can find it.
Closes: #16332
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/FortranModules/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/FortranModules/non_pp_include.f90 | 3 | ||||
-rw-r--r-- | Tests/FortranModules/test_non_pp_include_main.f90 | 5 |
3 files changed, 10 insertions, 0 deletions
diff --git a/Tests/FortranModules/CMakeLists.txt b/Tests/FortranModules/CMakeLists.txt index ff12771..3996600 100644 --- a/Tests/FortranModules/CMakeLists.txt +++ b/Tests/FortranModules/CMakeLists.txt @@ -52,6 +52,8 @@ add_definitions(-DFOO -DBAR=1) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) add_executable(test_preprocess test_preprocess.F90 test_preprocess_module.F90) +add_executable(test_non_pp_include test_non_pp_include_main.f90) + # Build the external project separately using a custom target. # Make sure it uses the same build configuration as this test. if(CMAKE_CONFIGURATION_TYPES) diff --git a/Tests/FortranModules/non_pp_include.f90 b/Tests/FortranModules/non_pp_include.f90 new file mode 100644 index 0000000..7eb1725 --- /dev/null +++ b/Tests/FortranModules/non_pp_include.f90 @@ -0,0 +1,3 @@ +SUBROUTINE NON_PP_INCLUDE_SUBROUTINE + PRINT *, "Hello World!" +END SUBROUTINE NON_PP_INCLUDE_SUBROUTINE diff --git a/Tests/FortranModules/test_non_pp_include_main.f90 b/Tests/FortranModules/test_non_pp_include_main.f90 new file mode 100644 index 0000000..8a04fbd --- /dev/null +++ b/Tests/FortranModules/test_non_pp_include_main.f90 @@ -0,0 +1,5 @@ +INCLUDE "non_pp_include.f90" + +PROGRAM MAINF90 + CALL NON_PP_INCLUDE_SUBROUTINE +END PROGRAM MAINF90 |