From 87bd809cd78de060faf60c152317d9da1f92719b Mon Sep 17 00:00:00 2001 From: Douglas Ayers Date: Tue, 3 Oct 2023 13:36:02 -0400 Subject: [PATCH 1/3] Added a option for using statically build opendds. --- CMakeLists.txt | 5 +++++ src/dds_manager.cpp | 6 ++++++ 2 files changed, 11 insertions(+) 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; //------------------------------------------------------------------------------ From d0ebb43ee4bd3e30e30ed5a31f6f17628dceaed4 Mon Sep 17 00:00:00 2001 From: Douglas Ayers Date: Mon, 9 Oct 2023 07:32:04 -0400 Subject: [PATCH 2/3] Now using ace flag for the static build. --- CMakeLists.txt | 4 ---- src/dds_manager.cpp | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bc2ab47..a035ce4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,10 +67,6 @@ 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 c21de75..1093b61 100644 --- a/src/dds_manager.cpp +++ b/src/dds_manager.cpp @@ -30,7 +30,7 @@ #include "std_qosC.h" //For using static open dds these files need to be in some cpp file -#if defined (OPENDDW_STATIC) +#if defined (ACE_AS_STATIC_LIBS) #include #include #endif From 82d68fa901a5fd0168c36e029ba4959c5f5e2824 Mon Sep 17 00:00:00 2001 From: Douglas Ayers Date: Mon, 9 Oct 2023 07:35:33 -0400 Subject: [PATCH 3/3] Removed unnecessary option completely. --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a035ce4..9d9c622 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,5 @@ 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)