Skip to content

Commit 44076f4

Browse files
committed
create simple test program
1 parent c480ca1 commit 44076f4

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
program hello_fpm
2+
use utils, only: say_hello
3+
integer :: ierr
4+
5+
call say_hello(ierr)
6+
stop ierr ! ierr==0 if DEPENDENCY_MACRO is defined
7+
8+
end program hello_fpm
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
name = "utils"
2+
3+
[preprocess]
4+
[preprocess.cpp]
5+
macros = ["X=1"]
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module utils
2+
3+
implicit none
4+
5+
contains
6+
7+
subroutine say_hello(ierr)
8+
integer, intent(out) :: ierr
9+
10+
ierr = -1
11+
#ifdef DEPENDENCY_MACRO
12+
ierr = 0
13+
#endif
14+
15+
print *, "Dependency macro ", merge(" IS","NOT",ierr==0)," defined"
16+
17+
end subroutine say_hello
18+
19+
end module utils
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name = "preprocess_cpp_deps"
2+
3+
[dependencies]
4+
utils = { path = "crate/utils" , preprocess.cpp="DEPENDENCY_MACRO" }

0 commit comments

Comments
 (0)