Set up build/packaging infra for web builds #1

Merged
lisyarus merged 9 commits from yulya3102/psemek:web into master 2026-07-03 08:40:27 +00:00
2 changed files with 9 additions and 1 deletions
Showing only changes of commit 8f32d814c8 - Show all commits

View file

@ -2,7 +2,14 @@ if(CMAKE_SYSTEM_NAME STREQUAL Emscripten)
set(BOOST_INCLUDE_LIBRARIES random stacktrace math)
set(BOOST_ENABLE_COMPATIBILITY_TARGETS 1)
add_compile_options(-fdeclspec) # math doesn't build otherwise
add_subdirectory(boost EXCLUDE_FROM_ALL)
# Use out-of-tree sources for boost, since we can't use pre-built
# libraries for the web build
if(BOOST_SOURCE_ROOT)
add_subdirectory(${BOOST_SOURCE_ROOT} boost EXCLUDE_FROM_ALL)
else()
message(FATAL_ERROR "For web builds BOOST_SOURCE_ROOT must be provided")
endif()
# TODO: make this available via find_package so we wouldn't have to
# special-case it in every library

View file

@ -13,6 +13,7 @@ rm -rf ./*
# Use emsdk wrapper for cmake - it sets some env variables to select the
# right toolchain.
emcmake cmake \
-DBOOST_SOURCE_ROOT=$(realpath ../source)/psemek/3rdparty/boost \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DPSEMEK_PACKAGE_MODE=ON \
-DPSEMEK_PACKAGE_HOST=OFF \