mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-27 18:31:15 +08:00
[msix] Initial commit of 1.0
This commit is contained in:
parent
f9ee8fd6b5
commit
7955320bf3
1
ports/msix/CMakeLists.txt
Normal file
1
ports/msix/CMakeLists.txt
Normal file
@ -0,0 +1 @@
|
||||
add_custom_target(LIBS)
|
5
ports/msix/CONTROL
Normal file
5
ports/msix/CONTROL
Normal file
@ -0,0 +1,5 @@
|
||||
Source: msix
|
||||
Version: 1.0
|
||||
Build-Depends: xerces-c, zlib
|
||||
Description: The MSIX Packaging SDK project is an effort to enable developers on a variety of platforms to pack and unpack packages for the purposes of distribution from either the Microsoft Store, or their own content distribution networks.
|
||||
The MSIX Packaging APIs that a client app would use to interact with .msix/.appx packages are a subset of those documented here. See sample/ExtractContentsSample/ExtractContentsSample.cpp for additional details.
|
35
ports/msix/install-cmake.patch
Normal file
35
ports/msix/install-cmake.patch
Normal file
@ -0,0 +1,35 @@
|
||||
diff --git a/src/msix/CMakeLists.txt b/src/msix/CMakeLists.txt
|
||||
index 586c140..41a24ae 100644
|
||||
--- a/src/msix/CMakeLists.txt
|
||||
+++ b/src/msix/CMakeLists.txt
|
||||
@@ -129,6 +129,17 @@ set(LIB_SOURCES
|
||||
# Define the library
|
||||
add_library(${LIBRARY_NAME} SHARED ${LIB_SOURCES} ${LIB_PUBLIC_HEADERS} ${LIB_PRIVATE_HEADERS})
|
||||
|
||||
+if(INSTALL_LIBMSIX)
|
||||
+ install(TARGETS ${LIBRARY_NAME}
|
||||
+ RUNTIME DESTINATION bin
|
||||
+ LIBRARY DESTINATION lib
|
||||
+ ARCHIVE DESTINATION lib
|
||||
+ )
|
||||
+ if(INSTALL_HEADERS)
|
||||
+ install(FILES ${LIB_PUBLIC_HEADERS} DESTINATION include)
|
||||
+ endif()
|
||||
+endif()
|
||||
+
|
||||
# specify that this library is to be built with C++14
|
||||
set_property(TARGET ${LIBRARY_NAME} PROPERTY CXX_STANDARD 14)
|
||||
|
||||
@@ -149,8 +160,10 @@ include_directories(
|
||||
${CMAKE_PROJECT_ROOT}/lib/xerces/src
|
||||
)
|
||||
|
||||
-target_link_libraries(${PROJECT_NAME} PRIVATE zlibstatic)
|
||||
-target_link_libraries(${PROJECT_NAME} PRIVATE xerces-c)
|
||||
+find_package(ZLIB REQUIRED)
|
||||
+find_package(XercesC REQUIRED)
|
||||
+target_link_libraries(${PROJECT_NAME} PRIVATE ZLIB::ZLIB)
|
||||
+target_link_libraries(${PROJECT_NAME} PRIVATE XercesC::XercesC)
|
||||
|
||||
IF(AOSP)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE -latomic)
|
46
ports/msix/portfile.cmake
Normal file
46
ports/msix/portfile.cmake
Normal file
@ -0,0 +1,46 @@
|
||||
include(vcpkg_common_functions)
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
message("msix only supports dynamic library linkage")
|
||||
set(VCPKG_LIBRARY_LINKAGE "dynamic")
|
||||
endif()
|
||||
if(VCPKG_CRT_LINKAGE STREQUAL "static")
|
||||
message(FATAL_ERROR "msix only supports dynamic crt linkage")
|
||||
endif()
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO Microsoft/msix-packaging
|
||||
REF v1.0
|
||||
SHA512 11abf60da3414ce59f4347df8b2872ad6aa8a3c1e077f6e0be5c66ce90f14340cec5e58c30fb42ed17a10d5296dc0718bb8cddd665bdc20359bf7f0be4b0b4dc
|
||||
HEAD_REF master
|
||||
)
|
||||
|
||||
file(REMOVE_RECURSE ${SOURCE_PATH}/lib)
|
||||
file(MAKE_DIRECTORY ${SOURCE_PATH}/lib)
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}/lib)
|
||||
|
||||
vcpkg_apply_patches(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PATCHES ${CMAKE_CURRENT_LIST_DIR}/install-cmake.patch
|
||||
)
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_Git=ON
|
||||
-DWIN32=ON
|
||||
-DINSTALL_LIBMSIX=ON
|
||||
OPTIONS_RELEASE
|
||||
-DINSTALL_HEADERS=ON
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
file(INSTALL
|
||||
${SOURCE_PATH}/LICENSE
|
||||
DESTINATION ${CURRENT_PACKAGES_DIR}/share/msix RENAME copyright)
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
@ -52,7 +52,7 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/xercesc/NLS)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/xercesc/util/MsgLoaders/ICU/resources)
|
||||
|
||||
# Handle copyright
|
||||
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/xerces-c)
|
||||
file(COPY ${SOURCE_PATH}/LICENSE ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/xerces-c)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/xerces-c/LICENSE ${CURRENT_PACKAGES_DIR}/share/xerces-c/copyright)
|
||||
|
||||
vcpkg_copy_pdbs()
|
4
ports/xerces-c/usage
Normal file
4
ports/xerces-c/usage
Normal file
@ -0,0 +1,4 @@
|
||||
The package xerces-c is compatible with built-in CMake targets:
|
||||
|
||||
find_package(XercesC REQUIRED)
|
||||
target_link_libraries(main PRIVATE XercesC::XercesC)
|
Loading…
x
Reference in New Issue
Block a user