diff --git a/CMakeLists.txt b/CMakeLists.txt index 04a98f6..007f44c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.7) project(UDPC) -set(UDPC_VERSION 1.1) +set(UDPC_VERSION 1.2) set(UDPC_SOVERSION 1) set(UDPC_SOURCES @@ -42,6 +42,12 @@ 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 src/CXX11_shared_spin_lock.cpp diff --git a/conan_usage_example/CMakeLists.txt b/conan_usage_example/CMakeLists.txt index 6fe669f..2f7a1f2 100644 --- a/conan_usage_example/CMakeLists.txt +++ b/conan_usage_example/CMakeLists.txt @@ -22,4 +22,4 @@ find_package(udpc CONFIG REQUIRED) add_executable(UDPC_NetworkTest ${UDPC_NetworkTest_SOURCES} ) -target_link_libraries(UDPC_NetworkTest udpc::udpc stdc++) +target_link_libraries(UDPC_NetworkTest PUBLIC udpc::udpc) diff --git a/conan_usage_example/conanfile.txt b/conan_usage_example/conanfile.txt index 0572e7d..bbe51fc 100644 --- a/conan_usage_example/conanfile.txt +++ b/conan_usage_example/conanfile.txt @@ -1,5 +1,5 @@ [requires] -udpc/1.1 +udpc/1.2 [generators] CMakeDeps diff --git a/conanfile.py b/conanfile.py index d5ef8f9..e28a1a9 100644 --- a/conanfile.py +++ b/conanfile.py @@ -5,7 +5,7 @@ import os class udpcRecipe(ConanFile): name = "udpc" - version = "1.1" + version = "1.2" package_type = "library" # Optional metadata @@ -54,4 +54,4 @@ class udpcRecipe(ConanFile): def package_info(self): self.cpp_info.libs = ["UDPC"] - + self.cpp_info.system_libs = ["stdc++"]