From 28e31473a8f99bd5d4abb374918bb6a18ffd7083 Mon Sep 17 00:00:00 2001 From: Johnathon Slightham Date: Fri, 20 Feb 2026 21:29:36 -0500 Subject: [PATCH] Fix windows build --- CMakeLists.txt | 12 ++++++++++-- conanfile.py | 5 +++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a5eda60..95a9210 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,9 +58,17 @@ install(TARGETS c_control ) # C++ API Library -add_library(control SHARED +if(WIN32) + add_library(control SHARED + ${COMMON_SOURCES} + ) + target_compile_definitions(control PRIVATE CONTROL_EXPORTS) + set_target_properties(control PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) +else() + add_library(control SHARED ${COMMON_SOURCES} -) + ) +endif() target_include_directories(control PUBLIC include) target_link_libraries(control diff --git a/conanfile.py b/conanfile.py index 00d3a3a..4de6bf2 100644 --- a/conanfile.py +++ b/conanfile.py @@ -7,13 +7,13 @@ from conan.tools.files import copy class MyLibraryConan(ConanFile): name = "libcontrol" - version = "1.0.0" + version = "1.0.2" settings = "os", "compiler", "build_type", "arch" options = {"shared": [True, False], "fPIC": [True, False]} default_options = {"shared": True, "fPIC": True} - exports_sources = "CMakeLists.txt", "src/*", "include/*" + exports_sources = "CMakeLists.txt", "src/*", "include/*", "control.def" def layout(self): cmake_layout(self) @@ -36,6 +36,7 @@ class MyLibraryConan(ConanFile): def package_info(self): self.cpp_info.libs = ["control"] + self.cpp_info.includedirs = ["include"] def requirements(self): self.requires("flatbuffers/24.12.23")