Skip to content

Commit

Permalink
Merge pull request #281 from stackjohn/build_shared_lib_fix
Browse files Browse the repository at this point in the history
Ensure NetCDF and OpenMP are included when building shared lib
  • Loading branch information
AlysonStahl-NOAA authored Oct 25, 2024
2 parents 2c9b676 + b61543a commit d5f8a95
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions wgrib2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ set_target_properties(wgrib2_exe PROPERTIES OUTPUT_NAME wgrib2)

if(USE_NETCDF)
target_link_libraries(obj_lib PUBLIC NetCDF::NetCDF_C)
if(BUILD_SHARED_LIB)
target_link_libraries(wgrib2_lib PUBLIC NetCDF::NetCDF_C)
endif()
target_link_libraries(wgrib2_exe PUBLIC NetCDF::NetCDF_C)
endif()

Expand All @@ -111,6 +114,9 @@ endif()

if(USE_OPENMP)
target_link_libraries(obj_lib PUBLIC OpenMP::OpenMP_C)
if(BUILD_SHARED_LIB)
target_link_libraries(wgrib2_lib PUBLIC OpenMP::OpenMP_C)
endif()
endif()

if(USE_IPOLATES)
Expand Down

0 comments on commit d5f8a95

Please sign in to comment.