Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export compile definitions for dependent targets #16834

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions cmake/config/Config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@ set(DEAL_II_LINKER_FLAGS_DEBUG "@DEAL_II_LINKER_FLAGS_DEBUG@")
# _additionally_ used for release targets:
set(DEAL_II_LINKER_FLAGS_RELEASE "@DEAL_II_LINKER_FLAGS_RELEASE@")

# used for all targets:
set(DEAL_II_DEFINITIONS "@DEAL_II_DEFINITIONS@")

# _additionally_ used for debug targets:
set(DEAL_II_DEFINITIONS_DEBUG "@DEAL_II_DEFINITIONS_DEBUG@")

# _additionally_ used for release targets:
set(DEAL_II_DEFINITIONS_RELEASE "@DEAL_II_DEFINITIONS_RELEASE@")
#
# MPI runtime:
#
Expand Down
4 changes: 4 additions & 0 deletions cmake/macros/macro_deal_ii_setup_target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ macro(deal_ii_setup_target _target)
"${DEAL_II_WARNING_FLAGS} ${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${_build}}"
)

target_compile_definitions(${_target} PRIVATE
${DEAL_II_DEFINITIONS} ${DEAL_II_DEFINITIONS_${_build}}
)

get_property(_type TARGET ${_target} PROPERTY TYPE)
if(NOT "${_type}" STREQUAL "OBJECT_LIBRARY")
target_link_flags(${_target} PRIVATE
Expand Down
4 changes: 4 additions & 0 deletions cmake/macros/macro_insource_setup_target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ function(insource_setup_target _target _build)
"${DEAL_II_WARNING_FLAGS} ${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${_build}}"
)

target_compile_definitions(${_target} PRIVATE
${DEAL_II_DEFINITIONS} ${DEAL_II_DEFINITIONS_${_build}}
)

get_property(_type TARGET ${_target} PROPERTY TYPE)
if(NOT "${_type}" STREQUAL "OBJECT_LIBRARY")
target_link_flags(${_target} PRIVATE
Expand Down