Skip to content

Commit

Permalink
Added a option for using statically build opendds.
Browse files Browse the repository at this point in the history
  • Loading branch information
Douglas Ayers committed Oct 3, 2023
1 parent 8753ddf commit 87bd809
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
cmake_minimum_required(VERSION 3.20)

option(OpenDDWStatic "OpenDDWStatic" OFF) #Build openddw to be compatible with a static build of opendds
project(OpenDDW VERSION 0.0.1 LANGUAGES CXX)

find_package(OpenDDS REQUIRED)
Expand Down Expand Up @@ -66,6 +67,10 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
)
endif()

if(OpenDDWStatic)
add_compile_definitions(OPENDDW_STATIC)
endif(OpenDDWStatic)

target_compile_options(OpenDDW PRIVATE $<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>: -Wall -Wextra -Wpedantic -Wno-unused> $<$<CXX_COMPILER_ID:MSVC>: /W4>)

set(OPENDDS_TARGETS
Expand Down
6 changes: 6 additions & 0 deletions src/dds_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
#include "platformIndependent.h"
#include "std_qosC.h"

//For using static open dds these files need to be in some cpp file
#if defined (OPENDDW_STATIC)
#include <dds/DCPS/RTPS/RtpsDiscovery.h>
#include <dds/DCPS/transport/rtps_udp/RtpsUdp.h>
#endif

std::map<int, int> g_transportInstances;

//------------------------------------------------------------------------------
Expand Down

0 comments on commit 87bd809

Please sign in to comment.