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

[libsigcpp] Fix usage in static build #18944

Merged
merged 5 commits into from
Jul 26, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 29 additions & 0 deletions ports/libsigcpp/fix-usage-in-static-build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f54e830..972d0dc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -53,6 +53,10 @@ set (PROJECT_SOURCE_DIR "${sigc++_SOURCE_DIR}/sigc++")
include_directories (${sigc++_SOURCE_DIR})
include_directories (${sigc++_BINARY_DIR})

+if(BUILD_SHARED_LIBS)
+ add_compile_options(-DBUILD_SHARED)
+endif()
+
configure_file (sigc++config.h.cmake sigc++config.h)

set (prefix ${CMAKE_INSTALL_PREFIX})
diff --git a/sigc++config.h.cmake b/sigc++config.h.cmake
index 74d348a..43a99c5 100644
--- a/sigc++config.h.cmake
+++ b/sigc++config.h.cmake
@@ -16,7 +16,9 @@
# if defined(_MSC_VER)
# define SIGC_MSC 1
# define SIGC_WIN32 1
+# ifdef BUILD_SHARED
NancyLi1013 marked this conversation as resolved.
Show resolved Hide resolved
# define SIGC_DLL 1
+# endif
# elif defined(__CYGWIN__)
# define SIGC_CONFIGURE 1
# elif defined(__MINGW32__)
7 changes: 6 additions & 1 deletion ports/libsigcpp/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ vcpkg_from_github(
PATCHES
disable_tests_enable_static_build.patch
version.patch
fix-usage-in-static-build.patch
)

vcpkg_configure_cmake(
Expand All @@ -17,5 +18,9 @@ vcpkg_copy_pdbs()
vcpkg_fixup_pkgconfig()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/sigc++-3 TARGET_PATH share/sigc++-3)

if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/sigc++-3.0/include/sigc++config.h" "ifdef BUILD_SHARED" "if 1")
endif()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
1 change: 1 addition & 0 deletions ports/libsigcpp/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "libsigcpp",
"version": "3.0.3",
"port-version": 1,
"description": "Typesafe callback framework for C++",
"homepage": "https://libsigcplusplus.github.io/libsigcplusplus/"
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3550,7 +3550,7 @@
},
"libsigcpp": {
"baseline": "3.0.3",
"port-version": 0
"port-version": 1
},
"libsigcpp-3": {
"baseline": "3.0.3",
Expand Down
5 changes: 5 additions & 0 deletions versions/l-/libsigcpp.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "462e27cfc4abccd4d3157b2ae8b22c4bb6b82c67",
"version": "3.0.3",
"port-version": 1
},
{
"git-tree": "398cf35cc5235b326dda845e568295841aecc461",
"version": "3.0.3",
Expand Down