diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d9c622..bc2ab47 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) @@ -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 $<$,$,$>: -Wall -Wextra -Wpedantic -Wno-unused> $<$: /W4>) set(OPENDDS_TARGETS diff --git a/src/dds_manager.cpp b/src/dds_manager.cpp index aaf6171..c21de75 100644 --- a/src/dds_manager.cpp +++ b/src/dds_manager.cpp @@ -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 + #include +#endif + std::map g_transportInstances; //------------------------------------------------------------------------------