Skip to content

Commit

Permalink
Test windows CI
Browse files Browse the repository at this point in the history
Signed-off-by: methylDragon <[email protected]>
  • Loading branch information
methylDragon committed Apr 23, 2022
1 parent 1924594 commit d33ea03
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 12 deletions.
68 changes: 68 additions & 0 deletions cmake/GzExport.hh.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Copyright (C) 2017 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

/*
* ==========================================================================
* This file was automatically generated by CMake; do not modify it directly.
* To modify this file, make changes to ign-cmake/cmake/Export.hh.in
* ==========================================================================
*/

#ifndef @export_base@_EXPORT_HH_
#define @export_base@_EXPORT_HH_

// The detail/Export.hh header is automatically generated by CMake, which only
// provides the system-dependent implementations of these macros, with no
// commentary or explanation, so we configure this public-facing header which
// leverages the auto-generated macros but provides commentary for them.
#include "@include_dir@/detail/Export.hh"

// TODO(CH3): Remove this and this file (GzExport.hh.in) on tock
// This is to allow for ignition- and gz- targets for the same lib to be found
// together. (To support aliasing and ign -> gz ticktocking
#include "@include_dir@/detail/GzExport.hh"


#ifndef @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
/// to call from their own programs or libraries.
#define @export_base@_VISIBLE \
DETAIL_@export_base@_VISIBLE
#endif


#ifndef @export_base@_HIDDEN
/// For @lib_name@ developers: Apply this macro to @lib_name@
/// functions and classes which must not be used by consumers of this library.
/// By default, this property is applied to all classes and functions which are
/// not tagged with @export_base@_VISIBLE, so this does not
/// generally need to be used.
#define @export_base@_HIDDEN \
DETAIL_@export_base@_HIDDEN
#endif


#ifndef IGN_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
/// version should be specified to provide context to the user about when the
/// function became deprecated.
#define IGN_DEPRECATED(version) IGN_DEPRECATED_ALL_VERSIONS
#endif

#endif
30 changes: 18 additions & 12 deletions cmake/IgnUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1033,13 +1033,6 @@ function(ign_create_core_library)

# Support "gz-"
if(${PROJECT_LIBRARY_TARGET_NAME} MATCHES "^gz-")
_ign_add_library_or_component(
LIB_NAME ${PROJECT_LIBRARY_TARGET_NAME}
INCLUDE_DIR "${PROJECT_INCLUDE_DIR}"
EXPORT_BASE GZ_${IGN_DESIGNATION_UPPER}
SOURCES ${sources}
${interface_option})

# For ticktocking: Export an "ignition-" target as well, allowing linking against
# the ignition- prefixed name
# TODO(CH3): To remove on tock
Expand Down Expand Up @@ -1072,6 +1065,15 @@ function(ign_create_core_library)
set(project_pkgconfig_core_lib "-l${IGN_PROJECT_NAME_LOWER}")
endif()

# Generate the gz- target
# NOTE(CH3): This call MUST be last so that the GzExport.hh.in can be generated and used!
_ign_add_library_or_component(
LIB_NAME ${PROJECT_LIBRARY_TARGET_NAME}
INCLUDE_DIR "${PROJECT_INCLUDE_DIR}"
EXPORT_BASE IGNITION_${IGN_DESIGNATION_UPPER} # IGNITION here is deliberate
SOURCES ${sources}
${interface_option}
GZ) # TODO(CH3): Remove GZ arg on tock
else()
_ign_add_library_or_component(
LIB_NAME ${PROJECT_LIBRARY_TARGET_NAME}
Expand Down Expand Up @@ -1463,7 +1465,6 @@ endmacro()
# INCLUDE_DIR <dir_name>
# EXPORT_BASE <export_base>
# SOURCES <sources>)
#
macro(_ign_add_library_or_component)

# NOTE: The following local variables are used in the Export.hh.in file, so if
Expand All @@ -1474,7 +1475,7 @@ macro(_ign_add_library_or_component)

#------------------------------------
# Define the expected arguments
set(options INTERFACE)
set(options INTERFACE GZ)
set(oneValueArgs LIB_NAME INCLUDE_DIR EXPORT_BASE)
set(multiValueArgs SOURCES)

Expand Down Expand Up @@ -1510,6 +1511,12 @@ macro(_ign_add_library_or_component)
_ign_add_library_or_component_arg_error(EXPORT_BASE)
endif()

# TODO(CH3): Remove on tock
# Also remove all uses of this variable on tock
if(_ign_add_library_GZ)
set(export_file_prefix "Gz")
endif()

# check that export_base has no invalid symbols
string(REPLACE "-" "_" export_base_replaced ${export_base})
if(NOT ${export_base} STREQUAL ${export_base_replaced})
Expand Down Expand Up @@ -1543,7 +1550,7 @@ macro(_ign_add_library_or_component)
set(binary_include_dir
"${CMAKE_BINARY_DIR}/include/${include_dir}")

set(implementation_file_name "${binary_include_dir}/detail/Export.hh")
set(implementation_file_name "${binary_include_dir}/detail/${export_file_prefix}Export.hh")

include(GenerateExportHeader)
# This macro will generate a header called detail/Export.hh which implements
Expand Down Expand Up @@ -1571,7 +1578,7 @@ macro(_ign_add_library_or_component)
# header provides commentary for the macros so that developers can know their
# purpose.
configure_file(
"${IGNITION_CMAKE_DIR}/Export.hh.in"
"${IGNITION_CMAKE_DIR}/${export_file_prefix}Export.hh.in"
"${binary_include_dir}/Export.hh")

# Configure the installation of the public-facing header.
Expand All @@ -1590,7 +1597,6 @@ macro(_ign_add_library_or_component)

#------------------------------------
# Configure the installation of the target

install(
TARGETS ${lib_name}
EXPORT ${lib_name}
Expand Down

0 comments on commit d33ea03

Please sign in to comment.