Skip to content

Commit

Permalink
Some more details for making it work on Ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
eboasson committed Oct 24, 2023
1 parent 3969351 commit 2e99dc6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Expand Up @@ -327,6 +327,11 @@ set(generated_options_md "${CMAKE_CURRENT_SOURCE_DIR}/docs/manual/options.md
set(generated_options_rst "${CMAKE_CURRENT_SOURCE_DIR}/docs/manual/config/config_file_reference.rst")
set(generated_defconfig_src "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ddsi/defconfig.c")

if(BUILD_SHARED_LIBS OR NOT DEFINED BUILD_SHARED_LIBS)
else()
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()

add_subdirectory(compat)
add_subdirectory(src)
if(BUILD_EXAMPLES)
Expand Down
8 changes: 6 additions & 2 deletions src/psmx_iox/CMakeLists.txt
Expand Up @@ -10,26 +10,30 @@
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#
set(CMAKE_CXX_STANDARD 17)
include(GenerateExportHeader)

message(STATUS "Building Iceoryx PSMX plugin")

if(BUILD_SHARED_LIBS OR NOT DEFINED BUILD_SHARED_LIBS)
add_library(psmx_iox SHARED "src/psmx_iox_impl.cpp")
add_library(psmx_iox SHARED "src/psmx_iox_impl.cpp" "include/psmx_iox_impl.hpp")
else()
add_library(psmx_iox OBJECT "src/psmx_iox_impl.cpp")
add_library(psmx_iox OBJECT "src/psmx_iox_impl.cpp" "include/psmx_iox_impl.hpp")
set_property(GLOBAL APPEND PROPERTY cdds_plugin_list psmx_iox)
set_property(GLOBAL PROPERTY psmx_iox_symbols iox_create_psmx)
endif()

set_target_properties(psmx_iox PROPERTIES VERSION ${PROJECT_VERSION})
generate_export_header(psmx_iox BASE_NAME DDS_PSMX_IOX EXPORT_FILE_NAME "${CMAKE_CURRENT_BINARY_DIR}/include/psmx_iox_export.h")

target_include_directories(psmx_iox PRIVATE
"$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src/ddsrt/include>"
"$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src/core/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../ddsrt/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../core/ddsc/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../core/ddsi/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>")

target_link_libraries(psmx_iox PRIVATE iceoryx_hoofs::iceoryx_hoofs iceoryx_posh::iceoryx_posh)
if(BUILD_SHARED_LIBS OR NOT DEFINED BUILD_SHARED_LIBS)
target_link_libraries(psmx_iox PRIVATE ddsc)
Expand Down
3 changes: 2 additions & 1 deletion src/psmx_iox/include/psmx_iox_impl.hpp
Expand Up @@ -17,8 +17,9 @@ extern "C" {
#include "dds/dds.h"
#include "dds/ddsc/dds_loaned_sample.h"
#include "dds/ddsc/dds_psmx.h"
#include "psmx_iox_export.h"

DDS_EXPORT dds_return_t iox_create_psmx (struct dds_psmx **psmx, dds_psmx_instance_id_t instance_id, const char *config);
DDS_PSMX_IOX_EXPORT dds_return_t iox_create_psmx (struct dds_psmx **psmx, dds_psmx_instance_id_t instance_id, const char *config);

#if defined (__cplusplus)
}
Expand Down

0 comments on commit 2e99dc6

Please sign in to comment.