From 442aa1e4228a89cf8ad4693cd8407f8b855b40d3 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Sat, 13 Jul 2024 22:49:56 +0900 Subject: [PATCH] Attempt to fix conan build --- CMakeLists.txt | 11 ++++++----- conanfile.py | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 007f44c..5665d85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,12 @@ endif() add_library(UDPC ${UDPC_SOURCES}) +# Enforce linking with libstdc++ even with C targets. +# Doesn't affect conan, so conanfile.py was also modified for this. +set_target_properties(UDPC PROPERTIES + INTERFACE_LINK_LIBRARIES "stdc++" +) + set_target_properties(UDPC PROPERTIES VERSION ${UDPC_VERSION} SOVERSION ${UDPC_SOVERSION}) target_compile_features(UDPC PUBLIC cxx_std_11) @@ -42,11 +48,6 @@ find_package(libsodium REQUIRED) target_compile_definitions(UDPC PUBLIC UDPC_LIBSODIUM_ENABLED) target_link_libraries(UDPC PUBLIC libsodium::libsodium) -# Enforce linking with libstdc++ even with C targets. -# Doesn't affect conan, so conanfile.py was also modified for this. -set_target_properties(UDPC PROPERTIES - INTERFACE_LINK_LIBRARIES "stdc++" -) if(CMAKE_BUILD_TYPE MATCHES "Debug") set(UDPC_UnitTest_SOURCES diff --git a/conanfile.py b/conanfile.py index e28a1a9..233edc7 100644 --- a/conanfile.py +++ b/conanfile.py @@ -53,5 +53,5 @@ class udpcRecipe(ConanFile): cmake.install() def package_info(self): - self.cpp_info.libs = ["UDPC"] - self.cpp_info.system_libs = ["stdc++"] + self.cpp_info.libs.append("UDPC") + self.cpp_info.system_libs.append("stdc++")