Skip to content

Commit

Permalink
Merge pull request #6070 from gassmoeller/fix_only_release_cmake_setup
Browse files Browse the repository at this point in the history
Fix plugin cmake for release only
  • Loading branch information
tjhei authored Oct 11, 2024
2 parents eae267a + 14c5daa commit bb42d81
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions cmake/AspectConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,23 @@ macro(ASPECT_SETUP_PLUGIN _target)

if(${ASPECT_BUILD_RELEASE} MATCHES "ON")
message(STATUS " setting up RELEASE variant")
add_library(${_target}.release SHARED $<TARGET_PROPERTY:${_target},SOURCES>)
deal_ii_setup_target(${_target}.release RELEASE)
set_target_properties(${_target}.release PROPERTIES SUFFIX ".so")

list(APPEND _target_libs ${_target}.release)
# If we also build a debug build we need to set up a
# new target. If we do not also build in debug mode
# reuse the target name the user already set. In
# both cases make sure the library ends in .release.so
if(${ASPECT_BUILD_DEBUG} MATCHES "ON")
set(_release_target_name ${_target}.release)
add_library(${_release_target_name} SHARED $<TARGET_PROPERTY:${_target},SOURCES>)
deal_ii_setup_target(${_release_target_name} RELEASE)
set_target_properties(${_release_target_name} PROPERTIES SUFFIX ".so")
else()
set(_release_target_name ${_target})
deal_ii_setup_target(${_release_target_name} RELEASE)
set_target_properties(${_release_target_name} PROPERTIES SUFFIX ".release.so")
endif()

list(APPEND _target_libs ${_release_target_name})
endif()

foreach(_T ${_target_libs})
Expand All @@ -84,4 +96,16 @@ macro(ASPECT_SETUP_PLUGIN _target)
TARGET ${_target} POST_BUILD
COMMAND ln -sf ${Aspect_DIR}/aspect .)

if(${ASPECT_BUILD_DEBUG} MATCHES "ON")
add_custom_command(
TARGET ${_target} POST_BUILD
COMMAND ln -sf ${Aspect_DIR}/aspect-debug .)
endif()

if(${ASPECT_BUILD_RELEASE} MATCHES "ON")
add_custom_command(
TARGET ${_target} POST_BUILD
COMMAND ln -sf ${Aspect_DIR}/aspect-release .)
endif()

endmacro()

0 comments on commit bb42d81

Please sign in to comment.