[sx] Add new port

This commit is contained in:
myd7349 2019-04-27 18:43:07 +08:00
parent 7864caa87a
commit 4048762e48
3 changed files with 58 additions and 0 deletions

3
ports/sx/CONTROL Normal file
View File

@ -0,0 +1,3 @@
Source: sx
Version: 2019-04-27
Description: Portable base library for C programmers, designed for performance and simplicity.

41
ports/sx/portfile.cmake Normal file
View File

@ -0,0 +1,41 @@
include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO septag/sx
REF 161d7d77a3bdcc8a55846e2dd1791773888fce24
SHA512 198476793c921d8859f5f5b9ffe8915a7bc4b1d9d518e6772b3d90ccd03a7f5debe5bde32d7d5164f64a0beda53c5dcd06849814e7df447bccb93aa13bbca8b0
HEAD_REF master
PATCHES
win32-sharedlib.patch
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" SX_SHARED_LIB)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
-DSX_BUILD_TESTS=OFF
-DSX_SHARED_LIB=${SX_SHARED_LIB}
)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT})
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/sx/config.h
"define SX_CONFIG_SHARED_LIB 0"
"define SX_CONFIG_SHARED_LIB 1"
)
endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
# Handle copyright
configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)
# CMake integration test
vcpkg_test_cmake(PACKAGE_NAME ${PORT})

View File

@ -0,0 +1,14 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 840692e..8a4eb9e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -226,7 +226,8 @@ install(
TARGETS sx
EXPORT sx-config
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(
EXPORT sx-config