Skip to content

Commit

Permalink
Fix bug where ENABLE_SHARED was ignored, added guards for TPL exporting
Browse files Browse the repository at this point in the history
  • Loading branch information
ldowen committed Sep 11, 2024
1 parent 60f864e commit 29a11f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmake/spheral/SpheralAddLibs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ function(spheral_add_cxx_library package_name _cxx_obj_list)
add_library(Spheral_${package_name} INTERFACE)
target_link_libraries(Spheral_${package_name} INTERFACE ${_cxx_obj_list})
else()
# Build static spheral C++ library
# Build static or shared spheral C++ library
blt_add_library(NAME Spheral_${package_name}
HEADERS ${${package_name}_headers}
SOURCES ${${package_name}_sources}
DEPENDS_ON ${_cxx_obj_list} ${SPHERAL_CXX_DEPENDS} ${SPHERAL_BLT_DEPENDS}
SHARED FALSE)
SHARED ${ENABLE_SHARED})
endif()
target_include_directories(Spheral_${package_name} SYSTEM PRIVATE ${SPHERAL_SUBMOD_INCLUDES})
if(ENABLE_CUDA)
Expand Down
4 changes: 3 additions & 1 deletion cmake/spheral_cxx-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ if(NOT SPHERAL_FOUND)
set(SPHERAL_FP_TPLS "@SPHERAL_FP_TPLS@")
set(SPHERAL_FP_DIRS "@SPHERAL_FP_DIRS@")
foreach(tpl dir IN ZIP_LISTS SPHERAL_FP_TPLS SPHERAL_FP_DIRS)
find_package(${tpl} REQUIRED QUIET NO_DEFAULT_PATH PATHS ${dir})
if(NOT TARGET ${tpl})
find_package(${tpl} REQUIRED QUIET NO_DEFAULT_PATH PATHS ${dir})
endif()
endforeach()
if(NOT TARGET chai)
if (@USE_EXTERNAL_CHAI@)
Expand Down

0 comments on commit 29a11f1

Please sign in to comment.