mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-14 06:28:00 +08:00
[boost-filesystem] fix emscripten build (#29540)
* [boost-filesystem] fix emscripten build * add version * add version 2 * Update boost-build.json * Update boost-modular-build-helper.json
This commit is contained in:
parent
42d21b2c8a
commit
0551bc744c
32
ports/boost-build/0003-fix-emscripten.patch
Normal file
32
ports/boost-build/0003-fix-emscripten.patch
Normal file
@ -0,0 +1,32 @@
|
||||
diff --git a/src/tools/emscripten.jam b/src/tools/emscripten.jam
|
||||
index d6594c5e43..8b15d0af96 100644
|
||||
--- a/src/tools/emscripten.jam
|
||||
+++ b/src/tools/emscripten.jam
|
||||
@@ -6,6 +6,7 @@
|
||||
import feature ;
|
||||
import os ;
|
||||
import toolset ;
|
||||
+import generators ;
|
||||
import common ;
|
||||
import gcc ;
|
||||
import type ;
|
||||
@@ -37,6 +38,9 @@ rule init ( version ? : command * : options * )
|
||||
|
||||
feature.extend toolset : emscripten ;
|
||||
|
||||
+generators.override builtin.lib-generator : emscripten.prebuilt ;
|
||||
+generators.override emscripten.searched-lib-generator : searched-lib-generator ;
|
||||
+
|
||||
toolset.inherit-generators emscripten <toolset>emscripten
|
||||
: gcc
|
||||
: gcc.mingw.link gcc.mingw.link.dll gcc.compile.c.pch gcc.compile.c++.pch
|
||||
@@ -53,7 +57,7 @@ toolset.inherit-flags emscripten : gcc
|
||||
|
||||
type.set-generated-target-suffix EXE : <toolset>emscripten : "js" ;
|
||||
type.set-generated-target-suffix OBJ : <toolset>emscripten : "bc" ;
|
||||
-type.set-generated-target-suffix STATIC_LIB : <toolset>emscripten : "bc" ;
|
||||
+type.set-generated-target-suffix STATIC_LIB : <toolset>emscripten : "a" ;
|
||||
|
||||
toolset.flags emscripten.compile OPTIONS <flags> ;
|
||||
toolset.flags emscripten.compile OPTIONS <cflags> ;
|
||||
|
@ -14,6 +14,7 @@ vcpkg_from_github(
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
0002-fix-get-version.patch
|
||||
0003-fix-emscripten.patch
|
||||
)
|
||||
|
||||
vcpkg_download_distfile(ARCHIVE
|
||||
|
@ -2,7 +2,7 @@
|
||||
"$comment": "Automatically generated by scripts/boost/generate-ports.ps1",
|
||||
"name": "boost-build",
|
||||
"version": "1.81.0",
|
||||
"port-version": 1,
|
||||
"port-version": 2,
|
||||
"description": "Boost.Build",
|
||||
"homepage": "https://github.com/boostorg/build",
|
||||
"license": "BSL-1.0",
|
||||
|
@ -54,8 +54,8 @@ function(boost_modular_build)
|
||||
else()
|
||||
set(BOOST_LIB_PREFIX lib)
|
||||
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "wasm32")
|
||||
set(BOOST_LIB_RELEASE_SUFFIX .bc)
|
||||
set(BOOST_LIB_DEBUG_SUFFIX .bc)
|
||||
set(BOOST_LIB_RELEASE_SUFFIX .a)
|
||||
set(BOOST_LIB_DEBUG_SUFFIX .a)
|
||||
elseif(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
set(BOOST_LIB_RELEASE_SUFFIX .a)
|
||||
set(BOOST_LIB_DEBUG_SUFFIX .a)
|
||||
@ -147,30 +147,6 @@ function(boost_modular_build)
|
||||
"${CURRENT_PACKAGES_DIR}/debug/bin/*.pyd"
|
||||
)
|
||||
|
||||
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "wasm32")
|
||||
# install .bc files
|
||||
file(GLOB WASM_LIBS_RELEASE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/boost/build/*/${BOOST_LIB_PREFIX}*${BOOST_LIB_RELEASE_SUFFIX}")
|
||||
file(GLOB WASM_LIBS_DEBUG "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/boost/build/*/${BOOST_LIB_PREFIX}*${BOOST_LIB_DEBUG_SUFFIX}")
|
||||
file(COPY ${WASM_LIBS_RELEASE} DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
|
||||
file(COPY ${WASM_LIBS_DEBUG} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
|
||||
|
||||
# rename .bc to .a
|
||||
file(GLOB WASM_LIBS_RELEASE "${CURRENT_PACKAGES_DIR}/lib/*.bc")
|
||||
file(GLOB WASM_LIBS_DEBUG "${CURRENT_PACKAGES_DIR}/debug/lib/*.bc")
|
||||
foreach(LIB IN LISTS WASM_LIBS_RELEASE)
|
||||
get_filename_component(OLD_FILENAME ${LIB} NAME)
|
||||
get_filename_component(DIRECTORY_OF_LIB_FILE ${LIB} DIRECTORY)
|
||||
string(REPLACE ".bc" ".a" NEW_FILENAME ${OLD_FILENAME})
|
||||
file(RENAME ${LIB} ${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME})
|
||||
endforeach()
|
||||
foreach(LIB IN LISTS WASM_LIBS_DEBUG)
|
||||
get_filename_component(OLD_FILENAME ${LIB} NAME)
|
||||
get_filename_component(DIRECTORY_OF_LIB_FILE ${LIB} DIRECTORY)
|
||||
string(REPLACE ".bc" ".a" NEW_FILENAME ${OLD_FILENAME})
|
||||
file(RENAME ${LIB} ${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
file(GLOB INSTALLED_LIBS "${CURRENT_PACKAGES_DIR}/debug/lib/*.lib" "${CURRENT_PACKAGES_DIR}/lib/*.lib")
|
||||
foreach(LIB IN LISTS INSTALLED_LIBS)
|
||||
get_filename_component(OLD_FILENAME ${LIB} NAME)
|
||||
|
@ -2,7 +2,7 @@
|
||||
"$comment": "Automatically generated by scripts/boost/generate-ports.ps1",
|
||||
"name": "boost-modular-build-helper",
|
||||
"version": "1.81.0",
|
||||
"port-version": 2,
|
||||
"port-version": 3,
|
||||
"description": "Internal vcpkg port used to build Boost libraries",
|
||||
"license": "MIT",
|
||||
"dependencies": [
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "40cd5234db2baf10fb0a2b0ec8b40771910ca045",
|
||||
"version": "1.81.0",
|
||||
"port-version": 2
|
||||
},
|
||||
{
|
||||
"git-tree": "e4e7001fc4602b7fc61c55acf2c3b641e79c7de7",
|
||||
"version": "1.81.0",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "d47cef023f39ac9d5f3a043d35cba1a74710e1b3",
|
||||
"version": "1.81.0",
|
||||
"port-version": 3
|
||||
},
|
||||
{
|
||||
"git-tree": "99f9bc3d7c9ac2864942f3f8d80a3d8db4689794",
|
||||
"version": "1.81.0",
|
||||
|
@ -642,7 +642,7 @@
|
||||
},
|
||||
"boost-build": {
|
||||
"baseline": "1.81.0",
|
||||
"port-version": 1
|
||||
"port-version": 2
|
||||
},
|
||||
"boost-callable-traits": {
|
||||
"baseline": "1.81.0",
|
||||
@ -894,7 +894,7 @@
|
||||
},
|
||||
"boost-modular-build-helper": {
|
||||
"baseline": "1.81.0",
|
||||
"port-version": 2
|
||||
"port-version": 3
|
||||
},
|
||||
"boost-move": {
|
||||
"baseline": "1.81.0",
|
||||
|
Loading…
x
Reference in New Issue
Block a user