Skip to content

Commit 40aaa48

Browse files
authored
Merge branch 'main' into fix-path
2 parents 3586be0 + 1f2831f commit 40aaa48

27 files changed

+436
-155
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,21 @@ For more details check the package information [here](https://spack.readthedocs.
102102
[Spack]: https://spack.io
103103

104104

105+
#### Homebrew
106+
107+
The Fortran Package Manager (fpm) is available for the [homebrew](https://brew.sh/) package manager on MacOS via an additional tap.
108+
To install fpm via brew, include the new tap and install it using
109+
110+
```
111+
brew tap fortran-lang/fortran
112+
brew install fpm
113+
```
114+
115+
Binary distributions are available for MacOS 11 (Catalina) and 12 (Big Sur) for x86_64 architectures. For other platforms fpm will be built locally from source automatically.
116+
117+
Fpm should be available and functional after those steps.
118+
For more details checkout the tap [here](https://github.com/fortran-lang/homebrew-fortran).
119+
105120
#### Github Actions
106121

107122
To setup *fpm* within Github actions for automated testing, you can use the [fortran-lang/setup-fpm](https://github.com/marketplace/actions/setup-fpm) action.

ci/run_tests.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,5 +122,13 @@ pushd hello_fpm_path
122122
"$fpm" run
123123
popd
124124

125+
pushd preprocess_cpp
126+
"$fpm" build
127+
popd
128+
129+
pushd preprocess_hello
130+
"$fpm" build
131+
popd
132+
125133
# Cleanup
126134
rm -rf ./*/build
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
name = "preprocess_cpp"
22

3+
version = "1"
4+
35
[preprocess]
46
[preprocess.cpp]
7+
macros = ["TESTMACRO", "TESTMACRO2=3", "TESTMACRO3={version}"]

example_packages/preprocess_cpp/src/preprocess_cpp.f90

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,14 @@ subroutine say_hello
99
#ifndef TESTMACRO
1010
This breaks the build.
1111
#endif
12+
13+
#if TESTMACRO2 != 3
14+
This breaks the build.
15+
#endif
16+
17+
#if TESTMACRO3 != 1
18+
This breaks the build.
19+
#endif
20+
1221
end subroutine say_hello
1322
end module preprocess_cpp
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# preprocess_hello
2+
My cool new project!
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
program preprocess_hello
2+
use preprocess_hello_dependency, only: say_hello
3+
4+
implicit none
5+
call say_hello()
6+
end program preprocess_hello
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name = "preprocess_hello"
2+
3+
[preprocess]
4+
[preprocess.cpp]
5+
macros = ["FOO"]
6+
7+
[dependencies]
8+
preprocess_hello_dependency = { path = "../preprocess_hello_dependency" }
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# preprocess_hello_dependency
2+
My cool new project!
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
name = "preprocess_hello_dependency"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module preprocess_hello_dependency
2+
implicit none
3+
private
4+
5+
public :: say_hello
6+
contains
7+
subroutine say_hello
8+
9+
!> If this build fails, then it implies that macros are getting passed to the dependency.
10+
#ifdef FOO
11+
This breaks the build inside dependency. This implies that macros are getting passed to the dependeny.
12+
#endif
13+
print *, "Hello, preprocess_hello_dependency!"
14+
end subroutine say_hello
15+
end module preprocess_hello_dependency

0 commit comments

Comments
 (0)