vcpkg/ports/fbthrift/fix-sodium-target.patch

17 lines
555 B
Diff
Raw Normal View History

diff --git a/build/fbcode_builder/CMake/FindSodium.cmake b/build/fbcode_builder/CMake/FindSodium.cmake
index c664ccbe3..3c3f1245c 100644
--- a/build/fbcode_builder/CMake/FindSodium.cmake
+++ b/build/fbcode_builder/CMake/FindSodium.cmake
@@ -254,7 +254,10 @@ if(sodium_USE_STATIC_LIBS)
else()
set(_LIB_TYPE SHARED)
endif()
-add_library(sodium ${_LIB_TYPE} IMPORTED)
+
+if(NOT TARGET sodium)
+ add_library(sodium ${_LIB_TYPE} IMPORTED)
+endif()
set_target_properties(sodium PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${sodium_INCLUDE_DIR}"