Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[activemq-cpp] Fix static build #12005

Merged
merged 2 commits into from
Jun 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ports/activemq-cpp/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: activemq-cpp
Version: 3.9.5-2
Version: 3.9.5-3
Build-Depends: apr
Description: Apache ActiveMQ is the most popular and powerful open source messaging and Integration Patterns server.
Supports: !(uwp|linux|osx)
36 changes: 36 additions & 0 deletions ports/activemq-cpp/fix-crt-linkage.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
diff --git a/vs2010-build/activemq-cpp.vcxproj b/vs2010-build/activemq-cpp.vcxproj
index 54b4822..6b35511 100644
--- a/vs2010-build/activemq-cpp.vcxproj
+++ b/vs2010-build/activemq-cpp.vcxproj
@@ -2578,6 +2578,7 @@
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<FunctionLevelLinking>true</FunctionLevelLinking>
<CreateHotpatchableImage>false</CreateHotpatchableImage>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
@@ -2687,6 +2688,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<CreateHotpatchableImage>false</CreateHotpatchableImage>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>
@@ -2794,6 +2796,7 @@
<AdditionalIncludeDirectories>../src/main;$(APR_DIST)\$(PlatformName)\include;$(OPENSSL_DIST)\$(PlatformName)\include;$(PLATFORM_SDK)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CreateHotpatchableImage>false</CreateHotpatchableImage>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>
@@ -2906,6 +2909,7 @@
<AdditionalIncludeDirectories>../src/main;$(APR_DIST)\$(PlatformName)\include;$(OPENSSL_DIST)\$(PlatformName)\include;$(PLATFORM_SDK)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CreateHotpatchableImage>false</CreateHotpatchableImage>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>
95 changes: 59 additions & 36 deletions ports/activemq-cpp/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,30 @@ vcpkg_download_distfile(ARCHIVE
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
PATCHES ${CMAKE_CURRENT_LIST_DIR}/FunctionLevelLinkingOn.diff
PATCHES
FunctionLevelLinkingOn.diff
fix-crt-linkage.patch
)

set(RELEASE_CONF "ReleaseDLL")
set(DEBUG_CONF "DebugDLL")
set(ACTIVEMQCPP_MSVC_PROJ ${SOURCE_PATH}/vs2010-build/activemq-cpp.vcxproj)

string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ACTIVEMQCPP_SHARED_LIB)

if (ACTIVEMQCPP_SHARED_LIB)
set(RELEASE_CONF "ReleaseDLL")
set(DEBUG_CONF "DebugDLL")

set(ACTIVEMQCPP_LIB_PREFFIX )
set(ACTIVEMQCPP_LIB_SUFFIX d)
vcpkg_replace_string(${ACTIVEMQCPP_MSVC_PROJ} ";apr-1.lib" ";libapr-1.lib")
else()
set(RELEASE_CONF "Release")
set(DEBUG_CONF "Debug")

set(ACTIVEMQCPP_LIB_PREFFIX lib)
set(ACTIVEMQCPP_LIB_SUFFIX )
vcpkg_replace_string(${ACTIVEMQCPP_MSVC_PROJ} ";libapr-1.lib" ";apr-1.lib")
endif()

if (VCPKG_TARGET_ARCHITECTURE MATCHES "x86")
set(BUILD_ARCH "Win32")
Expand All @@ -27,9 +46,8 @@ else()
message(FATAL_ERROR "Unsupported architecture: ${VCPKG_TARGET_ARCHITECTURE}")
endif()


vcpkg_build_msbuild(
PROJECT_PATH ${SOURCE_PATH}/vs2010-build/activemq-cpp.vcxproj
PROJECT_PATH ${ACTIVEMQCPP_MSVC_PROJ}
RELEASE_CONFIGURATION ${RELEASE_CONF}
DEBUG_CONFIGURATION ${DEBUG_CONF}
PLATFORM ${BUILD_ARCH}
Expand All @@ -38,39 +56,44 @@ vcpkg_build_msbuild(

vcpkg_copy_pdbs()

file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
file(COPY
${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${RELEASE_CONF}/${ACTIVEMQCPP_LIB_PREFFIX}activemq-cpp.lib
DESTINATION ${CURRENT_PACKAGES_DIR}/lib
)

if (ACTIVEMQCPP_SHARED_LIB)
file(COPY
${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${RELEASE_CONF}/activemq-cpp.dll
DESTINATION ${CURRENT_PACKAGES_DIR}/bin
)
file(COPY
${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${RELEASE_CONF}/activemq-cpp.pdb
DESTINATION ${CURRENT_PACKAGES_DIR}/bin
)
endif()
endif()

file(
COPY
${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${RELEASE_CONF}/activemq-cpp.lib
DESTINATION ${CURRENT_PACKAGES_DIR}/lib
)
file(
COPY
${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${RELEASE_CONF}/activemq-cpp.dll
DESTINATION ${CURRENT_PACKAGES_DIR}/bin
)
file(
COPY
${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${RELEASE_CONF}/activemq-cpp.pdb
DESTINATION ${CURRENT_PACKAGES_DIR}/bin
)
file(
COPY
${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${DEBUG_CONF}/activemq-cppd.lib
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib
)
file(
COPY
${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${DEBUG_CONF}/activemq-cppd.dll
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin
)
file(
COPY
${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${DEBUG_CONF}/activemq-cppd.pdb
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin
)
if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(COPY
${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${DEBUG_CONF}/${ACTIVEMQCPP_LIB_PREFFIX}activemq-cpp${ACTIVEMQCPP_LIB_SUFFIX}.lib
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib
)

if (ACTIVEMQCPP_SHARED_LIB)
file(COPY
${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${DEBUG_CONF}/activemq-cpp${ACTIVEMQCPP_LIB_SUFFIX}.dll
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin
)
file(COPY
${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${DEBUG_CONF}/activemq-cpp${ACTIVEMQCPP_LIB_SUFFIX}.pdb
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin
)
endif()
endif()

file(COPY ${SOURCE_PATH}/src/main/activemq DESTINATION ${CURRENT_PACKAGES_DIR}/include FILES_MATCHING PATTERN *.h)
file(COPY ${SOURCE_PATH}/src/main/cms DESTINATION ${CURRENT_PACKAGES_DIR}/include FILES_MATCHING PATTERN *.h)
file(COPY ${SOURCE_PATH}/src/main/decaf DESTINATION ${CURRENT_PACKAGES_DIR}/include FILES_MATCHING PATTERN *.h)

file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
1 change: 0 additions & 1 deletion scripts/ci.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
7zip:x64-linux=fail
7zip:x64-osx=fail
7zip:x64-uwp=fail
activemq-cpp:x64-windows-static=fail
activemq-cpp:x64-linux=fail
activemq-cpp:x64-osx=fail
akali:x64-uwp=fail
Expand Down