Skip to content

Commit

Permalink
Update cmake setup (#6)
Browse files Browse the repository at this point in the history
* run conda on pr/push

* remove pybind11 submodule

* Link gfortran only for Linux builds. Not required for macos

---------

Co-authored-by: Alex Soklev <[email protected]>
  • Loading branch information
tcmetzger and makepath-alex authored Mar 18, 2024
1 parent e6ed1d6 commit 02bc961
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
pull_request:
branches:
- main
- master
push:
branches:
- main
- master

jobs:
build:
Expand Down
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ project(rte-rrtmgp)
# Add a custom target that always runs
add_custom_target(compile-rte-rrtmgp ALL)

set(LINUX FALSE)
if (UNIX AND NOT APPLE)
set(LINUX TRUE)
endif()

# Custom command for the compile-rte-rrtmgp target
add_custom_command(
TARGET compile-rte-rrtmgp
Expand Down Expand Up @@ -40,10 +45,13 @@ target_link_directories(${TARGET_NAME} PUBLIC
)

target_link_libraries(${TARGET_NAME} PUBLIC
gfortran
rrtmgp
rte
)

if ($LINUX)
target_link_libraries(${TARGET_NAME} PUBLIC gfortran)
endif()

# The install directory is the output (wheel) directory
install(TARGETS pyrte DESTINATION pyrte)

0 comments on commit 02bc961

Please sign in to comment.