Skip to content

Commit

Permalink
Define *_STATIC_DEFINE if not BUILD_SHARED_LIBS
Browse files Browse the repository at this point in the history
Port of gazebosim/sdformat#394 to ign-cmake2.
This publicly defines the *_STATIC_DEFINE symbol for
a library target if BUILD_SHARED_LIBS is Off.

Signed-off-by: Steve Peters <[email protected]>
  • Loading branch information
scpeters committed Dec 29, 2021
1 parent 7eb246d commit 9666346
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmake/IgnUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1416,6 +1416,10 @@ macro(_ign_add_library_or_component)
set(install_include_dir
"${IGN_INCLUDE_INSTALL_DIR_FULL}/${include_dir}")

if (NOT BUILD_SHARED_LIBS)
target_compile_definitions(${lib_name} PUBLIC ${export_base}_STATIC_DEFINE)
endif()

# Configure the installation of the automatically generated file.
install(
FILES "${implementation_file_name}"
Expand Down

0 comments on commit 9666346

Please sign in to comment.