aboutsummaryrefslogtreecommitdiff
path: root/ports/xeus/static-lib.patch
diff options
context:
space:
mode:
authorPhil Christensen <philc@microsoft.com>2019-02-28 14:36:23 -0800
committerPhil Christensen <philc@microsoft.com>2019-02-28 14:36:23 -0800
commit773c8267dfb506f41c204f61042f30b6143a8095 (patch)
tree5946d1526c3ad77a2df80786a1370d96389d931b /ports/xeus/static-lib.patch
parent6afbceb27fd2aa39c66f810a22f5d4ad97575110 (diff)
parent7859944528be28bee1fda9f325b78d6a7f02124e (diff)
downloadvcpkg-773c8267dfb506f41c204f61042f30b6143a8095.tar.gz
vcpkg-773c8267dfb506f41c204f61042f30b6143a8095.zip
Merge branch 'master' of https://github.com/microsoft/vcpkg into dev/philc/4564
Diffstat (limited to 'ports/xeus/static-lib.patch')
-rw-r--r--ports/xeus/static-lib.patch63
1 files changed, 63 insertions, 0 deletions
diff --git a/ports/xeus/static-lib.patch b/ports/xeus/static-lib.patch
new file mode 100644
index 000000000..e9ab41f01
--- /dev/null
+++ b/ports/xeus/static-lib.patch
@@ -0,0 +1,63 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 26118eb..ccda00b 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -141,7 +141,12 @@ set(XEUS_SOURCES
+ # Output
+ # ======
+
+-add_library(xeus SHARED ${XEUS_SOURCES} ${XEUS_HEADERS})
++option(BUILD_SHARED_LIBS "Build shared instead of static libraries." ON)
++if (BUILD_SHARED_LIBS)
++ add_library(xeus SHARED ${XEUS_SOURCES} ${XEUS_HEADERS})
++else ()
++ add_library(xeus STATIC ${XEUS_SOURCES} ${XEUS_HEADERS})
++endif ()
+
+ if (APPLE)
+ set_target_properties(xeus PROPERTIES
+@@ -166,9 +171,9 @@ target_link_libraries(xeus
+
+ OPTION(XEUS_USE_SHARED_CRYPTOPP "Used shared library for cryptopp" OFF)
+ if (XEUS_USE_SHARED_CRYPTOPP)
+- target_link_libraries(xeus PRIVATE cryptopp-shared)
++ target_link_libraries(xeus PUBLIC cryptopp-shared)
+ else ()
+- target_link_libraries(xeus PRIVATE cryptopp-static)
++ target_link_libraries(xeus PUBLIC cryptopp-static)
+ endif ()
+
+ if(NOT MSVC)
+@@ -226,6 +231,10 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU"
+ message(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
+ endif()
+
++if (NOT BUILD_SHARED_LIBS)
++ target_compile_definitions(xeus PUBLIC XEUS_STATIC_LIB)
++endif ()
++
+ if(MSVC)
+ target_compile_definitions(xeus PUBLIC -DNOMINMAX)
+ target_compile_options(xeus PUBLIC /DGUID_WINDOWS /MP /bigobj)
+diff --git a/include/xeus/xeus.hpp b/include/xeus/xeus.hpp
+index 99e1d79..522bb78 100644
+--- a/include/xeus/xeus.hpp
++++ b/include/xeus/xeus.hpp
+@@ -10,10 +10,14 @@
+ #define XEUS_EXPORT_HPP
+
+ #ifdef _WIN32
+- #ifdef XEUS_EXPORTS
+- #define XEUS_API __declspec(dllexport)
++ #ifdef XEUS_STATIC_LIB
++ #define XEUS_API
+ #else
+- #define XEUS_API __declspec(dllimport)
++ #ifdef XEUS_EXPORTS
++ #define XEUS_API __declspec(dllexport)
++ #else
++ #define XEUS_API __declspec(dllimport)
++ #endif
+ #endif
+ #else
+ #define XEUS_API