diff options
| author | Phil Christensen <philc@microsoft.com> | 2019-02-27 11:56:29 -0800 |
|---|---|---|
| committer | Phil Christensen <philc@microsoft.com> | 2019-02-27 11:56:29 -0800 |
| commit | 2cc7fa27e57f1129d1f37ccb009563509ca25720 (patch) | |
| tree | 3c75e423b71e54f6f65ec085c5d3d190d9d0d1a9 /ports/xeus/static-lib.patch | |
| parent | 3830517ec7519b823f5d8c404710889c6bd00278 (diff) | |
| parent | 2dfa568d186e4f0d199040929f9b3e44f27c8943 (diff) | |
| download | vcpkg-2cc7fa27e57f1129d1f37ccb009563509ca25720.tar.gz vcpkg-2cc7fa27e57f1129d1f37ccb009563509ca25720.zip | |
Merge branch 'master' of https://github.com/microsoft/vcpkg into dev/philc/5254
Diffstat (limited to 'ports/xeus/static-lib.patch')
| -rw-r--r-- | ports/xeus/static-lib.patch | 63 |
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 |
