[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:
Leonid Pospelov 2023-02-10 00:57:07 +06:00 committed by GitHub
parent 42d21b2c8a
commit 0551bc744c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 49 additions and 30 deletions

View 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> ;

View File

@ -14,6 +14,7 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
0002-fix-get-version.patch
0003-fix-emscripten.patch
)
vcpkg_download_distfile(ARCHIVE

View File

@ -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",

View File

@ -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)

View File

@ -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": [

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "40cd5234db2baf10fb0a2b0ec8b40771910ca045",
"version": "1.81.0",
"port-version": 2
},
{
"git-tree": "e4e7001fc4602b7fc61c55acf2c3b641e79c7de7",
"version": "1.81.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "d47cef023f39ac9d5f3a043d35cba1a74710e1b3",
"version": "1.81.0",
"port-version": 3
},
{
"git-tree": "99f9bc3d7c9ac2864942f3f8d80a3d8db4689794",
"version": "1.81.0",

View File

@ -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",