ENH: Test included header in Fortran preprocessing
This extends the Fortran preprocessing test to include a header file through a preprocessor directive.
This commit is contained in:
parent
66f2edbe63
commit
ff32962a68
@ -127,6 +127,7 @@ if(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
|
|||||||
in_interface/module.f90)
|
in_interface/module.f90)
|
||||||
|
|
||||||
add_definitions(-DFOO -DBAR=1)
|
add_definitions(-DFOO -DBAR=1)
|
||||||
|
include_directories(${testf_SOURCE_DIR}/include)
|
||||||
add_executable(test_preprocess test_preprocess.F90)
|
add_executable(test_preprocess test_preprocess.F90)
|
||||||
|
|
||||||
set(TEST_MODULE_DEPENDS 1)
|
set(TEST_MODULE_DEPENDS 1)
|
||||||
|
5
Tests/Fortran/include/test_preprocess.h
Normal file
5
Tests/Fortran/include/test_preprocess.h
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#ifdef BAR
|
||||||
|
PRINT * , 'BAR was defined via ADD_DEFINITIONS'
|
||||||
|
#else
|
||||||
|
PRINT *, 'If you can read this something went wrong'
|
||||||
|
#endif
|
@ -46,10 +46,6 @@ PROGRAM PPTEST
|
|||||||
#endif
|
#endif
|
||||||
! 0 ; <empty>
|
! 0 ; <empty>
|
||||||
|
|
||||||
#ifdef BAR
|
#include "test_preprocess.h"
|
||||||
PRINT * , 'BAR was defined via ADD_DEFINITIONS'
|
|
||||||
#else
|
|
||||||
PRINT *, 'If you can read this something went wrong'
|
|
||||||
#endif
|
|
||||||
|
|
||||||
END PROGRAM
|
END PROGRAM
|
||||||
|
Loading…
x
Reference in New Issue
Block a user