Skip to content

Commit

Permalink
Always use GZ_ prefixed export base
Browse files Browse the repository at this point in the history
Signed-off-by: methylDragon <methylDragon@gmail.com>
  • Loading branch information
methylDragon committed May 4, 2022
1 parent d0c212a commit 20748d4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 27 deletions.
18 changes: 7 additions & 11 deletions cmake/Export.hh.in
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@
#endif


#ifndef IGN_DEPRECATED
// TODO(CH3): Remove on ticktock
// NOTE(CH3): This has no docstring since we'll make GZ_DEPRECATED the default
#define IGN_DEPRECATED(version) GZ_DEPRECATED_ALL_VERSIONS
#endif

#ifndef GZ_DEPRECATED
/// For @lib_name@ developers: Use this macro to indicate that a
/// function or class has been deprecated and should no longer be used. A
Expand All @@ -73,10 +67,6 @@
// TICKTOCK IGNITION ========================================================
// TODO(CH3): Remove on ticktock, supports defining IGNITION macros if we're
// a lib is using GZ_ prefixed export macros
#define _@export_base@_USING_GZ_EXPORT_BASE @_using_gz_export_base@
#if _USING_GZ_EXPORT_BASE


#ifndef @_ign_export_base@_VISIBLE
/// For @lib_name@ developers: Apply this macro to @lib_name@
/// functions and classes which consumers of this library will need to be able
Expand All @@ -97,5 +87,11 @@
#endif


#endif // _@export_base@_USING_GZ_EXPORT_BASE
#ifndef IGN_DEPRECATED
// TODO(CH3): Remove on ticktock
// NOTE(CH3): This has no docstring since we'll make GZ_DEPRECATED the default
#define IGN_DEPRECATED(version) GZ_DEPRECATED_ALL_VERSIONS
#endif


#endif // @export_base@_EXPORT_HH_
17 changes: 1 addition & 16 deletions cmake/IgnUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1182,18 +1182,10 @@ function(ign_add_component component_name)

#------------------------------------
# Create the target for this component, and configure it to be installed

# Support "gz-"
if(${PROJECT_LIBRARY_TARGET_NAME} MATCHES "^gz-")
set(EXPORT_PREFIX "GZ")
else()
set(EXPORT_PREFIX "IGNITION")
endif()

_ign_add_library_or_component(
LIB_NAME ${component_target_name}
INCLUDE_DIR "${PROJECT_INCLUDE_DIR}/${include_subdir}"
EXPORT_BASE ${EXPORT_PREFIX}_${IGN_DESIGNATION_UPPER}_${component_name_upper}
EXPORT_BASE GZ_${IGN_DESIGNATION_UPPER}_${component_name_upper}
SOURCES ${sources}
${interface_option})

Expand Down Expand Up @@ -1394,7 +1386,6 @@ macro(_ign_add_library_or_component)
# - export_base
# - lib_name
#
# - _using_gz_export_base
# - _ign_export_base

#------------------------------------
Expand Down Expand Up @@ -1499,12 +1490,6 @@ macro(_ign_add_library_or_component)
# TODO(CH3): Remove this on ticktock
# This is to allow IGNITION_ prefixed export macros to generate in Export.hh
# _using_gz_export_base is used in Export.hh.in's configuration!
if(${export_base} MATCHES "^GZ_")
set(_using_gz_export_base 1)
else()
set(_using_gz_export_base 0)
endif()

string(REGEX REPLACE "^GZ_" "IGNITION_" _ign_export_base ${export_base})

configure_file(
Expand Down

0 comments on commit 20748d4

Please sign in to comment.