Skip to content

Commit

Permalink
cmake (noah-owp-modular): ensure iso_c_bmi is available in manual build
Browse files Browse the repository at this point in the history
  • Loading branch information
program-- committed Feb 13, 2024
1 parent ed3e03c commit 4c10f10
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions extern/noah-owp-modular/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ target_include_directories(surfacebmi INTERFACE "${_SURFACEBMI_BINARY_DIR}/mod")
target_compile_definitions(surfacebmi PRIVATE BMI_ACTIVE)

if(NGEN_IS_MAIN_PROJECT)

# This ensures we can build NOAH-OWP-Modular with NGen support, but
# separate from NGen.
if(NOT TARGET iso_c_bmi)
add_subdirectory(
"${CMAKE_CURRENT_LIST_DIR}/../iso_c_fortran_bmi"
"${CMAKE_CURRENT_BINARY_DIR}/iso_c_fortran_bmi"
)
endif()

target_link_libraries(surfacebmi PUBLIC iso_c_bmi)
target_compile_definitions(surfacebmi PRIVATE NGEN_FORCING_ACTIVE NGEN_OUTPUT_ACTIVE NGEN_ACTIVE)
else()
Expand Down

0 comments on commit 4c10f10

Please sign in to comment.