diff --git a/ports/boost-modular-build-helper/CMakeLists.txt b/ports/boost-modular-build-helper/CMakeLists.txt index a83813707c..a8f5141111 100644 --- a/ports/boost-modular-build-helper/CMakeLists.txt +++ b/ports/boost-modular-build-helper/CMakeLists.txt @@ -44,6 +44,8 @@ elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "mips64") list(APPEND B2_OPTIONS architecture=mips64) elseif("arm64" IN_LIST VCPKG_TARGET_ARCHITECTURE AND "x86_64" IN_LIST VCPKG_TARGET_ARCHITECTURE) list(APPEND B2_OPTIONS architecture=arm+x86) +elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "wasm32") + # do nothing else() list(APPEND B2_OPTIONS architecture=x86) endif() @@ -63,6 +65,8 @@ if(VCPKG_DETECTED_MSVC) else() math(EXPR USER_CONFIG_TOOLSET_VERSION "${VCPKG_DETECTED_MSVC_VERSION} / 10 - 50") endif() +elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "wasm32") + set(USER_CONFIG_TOOLSET emscripten) elseif(VCPKG_DETECTED_CMAKE_CXX_COMPILER_ID MATCHES "Clang") set(USER_CONFIG_TOOLSET clang) else() diff --git a/ports/boost-modular-build-helper/boost-modular-build.cmake b/ports/boost-modular-build-helper/boost-modular-build.cmake index 3fe2827be5..66ca39063a 100644 --- a/ports/boost-modular-build-helper/boost-modular-build.cmake +++ b/ports/boost-modular-build-helper/boost-modular-build.cmake @@ -53,7 +53,10 @@ function(boost_modular_build) endif() else() set(BOOST_LIB_PREFIX lib) - if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + if(VCPKG_TARGET_ARCHITECTURE STREQUAL "wasm32") + set(BOOST_LIB_RELEASE_SUFFIX .bc) + set(BOOST_LIB_DEBUG_SUFFIX .bc) + elseif(VCPKG_LIBRARY_LINKAGE STREQUAL "static") set(BOOST_LIB_RELEASE_SUFFIX .a) set(BOOST_LIB_DEBUG_SUFFIX .a) elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin") @@ -144,6 +147,30 @@ 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) diff --git a/ports/boost-modular-build-helper/vcpkg.json b/ports/boost-modular-build-helper/vcpkg.json index 09132e4b49..cf4a99cc11 100644 --- a/ports/boost-modular-build-helper/vcpkg.json +++ b/ports/boost-modular-build-helper/vcpkg.json @@ -2,7 +2,7 @@ "$comment": "Automatically generated by scripts/boost/generate-ports.ps1", "name": "boost-modular-build-helper", "version": "1.81.0", - "port-version": 1, + "port-version": 2, "description": "Internal vcpkg port used to build Boost libraries", "license": "MIT", "dependencies": [ diff --git a/versions/b-/boost-modular-build-helper.json b/versions/b-/boost-modular-build-helper.json index 42b0cc7dfe..2ed46951ce 100644 --- a/versions/b-/boost-modular-build-helper.json +++ b/versions/b-/boost-modular-build-helper.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "99f9bc3d7c9ac2864942f3f8d80a3d8db4689794", + "version": "1.81.0", + "port-version": 2 + }, { "git-tree": "6e28e9a445dc3442e89761e500fbb8bb5e175c00", "version": "1.81.0", diff --git a/versions/baseline.json b/versions/baseline.json index f7585bd103..a2bf277438 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -894,7 +894,7 @@ }, "boost-modular-build-helper": { "baseline": "1.81.0", - "port-version": 1 + "port-version": 2 }, "boost-move": { "baseline": "1.81.0",