From 61d9cf34cde4ba658b9150bafc47da00b1e69abd Mon Sep 17 00:00:00 2001 From: sigman Date: Thu, 29 Jun 2017 20:07:00 +0300 Subject: [PATCH] [SObjectizer] Patch static/dynamic linkage flags --- ports/sobjectizer/CONTROL | 2 +- ports/sobjectizer/portfile.cmake | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ports/sobjectizer/CONTROL b/ports/sobjectizer/CONTROL index 3ec628460e..09780452b2 100644 --- a/ports/sobjectizer/CONTROL +++ b/ports/sobjectizer/CONTROL @@ -1,3 +1,3 @@ Source: sobjectizer -Version: 5.5.19 +Version: 5.5.19-2 Description: SObjectizer is a C++ in-process message dispatching framework with implementation of Actor Model, Publish-Subscribe Model and CSP-like channels. diff --git a/ports/sobjectizer/portfile.cmake b/ports/sobjectizer/portfile.cmake index cbc6a9e126..7849817d81 100644 --- a/ports/sobjectizer/portfile.cmake +++ b/ports/sobjectizer/portfile.cmake @@ -36,6 +36,16 @@ vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +# patch SO_5_STATIC_LIB in headers with actual value +set(DECLSPEC_FILE ${CURRENT_PACKAGES_DIR}/include/so_5/h/declspec.hpp) +file(READ ${DECLSPEC_FILE} DECLSPEC_H) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + string(REPLACE "defined( SO_5_STATIC_LIB )" "1" DECLSPEC_H "${DECLSPEC_H}") +else() + string(REPLACE "defined( SO_5_STATIC_LIB )" "0" DECLSPEC_H "${DECLSPEC_H}") +endif() +file(WRITE ${DECLSPEC_FILE} "${DECLSPEC_H}") + # Handle copyright file(COPY ${SOURCE_PATH}/../LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/sobjectizer) file(RENAME ${CURRENT_PACKAGES_DIR}/share/sobjectizer/LICENSE ${CURRENT_PACKAGES_DIR}/share/sobjectizer/copyright)