File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed
pycode/memilio-simulation Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -38,8 +38,13 @@ if(MEMILIO_USE_BUNDLED_SPDLOG)
3838 if (NOT spdlog_POPULATED)
3939 FetchContent_Populate(spdlog)
4040
41- # Force static spdlog (wheels stay self-contained)
42- set (SPDLOG_BUILD_SHARED OFF CACHE BOOL "Build spdlog as a static library" FORCE)
41+ # Use spdlogs own shared/static switch (SPDLOG_BUILD_SHARED). Default to
42+ # the project setting unless we explicitly want a static lib (e.g. wheels).
43+ if (MEMILIO_PREFER_STATIC_SPDLOG)
44+ set (SPDLOG_BUILD_SHARED OFF CACHE BOOL "Build spdlog as a shared library" FORCE)
45+ elseif (NOT DEFINED SPDLOG_BUILD_SHARED)
46+ set (SPDLOG_BUILD_SHARED ${BUILD_SHARED_LIBS} CACHE BOOL "Build spdlog as a shared library" FORCE)
47+ endif ()
4348
4449 add_subdirectory (${spdlog_SOURCE_DIR} ${spdlog_BINARY_DIR} EXCLUDE_FROM_ALL )
4550 endif ()
Original file line number Diff line number Diff line change @@ -173,3 +173,19 @@ if(TARGET jsoncpp_lib)
173173 DESTINATION lib
174174 )
175175endif ()
176+
177+ if (TARGET spdlog)
178+ get_target_property (_SPDLOG_LIB_TYPE spdlog TYPE )
179+
180+ if (_SPDLOG_LIB_TYPE STREQUAL "SHARED_LIBRARY" )
181+ set_target_properties (spdlog PROPERTIES
182+ INSTALL_RPATH "$ORIGIN"
183+ )
184+ install (FILES
185+ $<TARGET_FILE:spdlog>
186+ $<TARGET_SONAME_FILE:spdlog>
187+ $<TARGET_LINKER_FILE:spdlog>
188+ DESTINATION lib
189+ )
190+ endif ()
191+ endif ()
You can’t perform that action at this time.
0 commit comments