diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt index 51900e92..39b8217c 100644 --- a/3rdparty/CMakeLists.txt +++ b/3rdparty/CMakeLists.txt @@ -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 diff --git a/package/web/package.sh b/package/web/package.sh index ce5a5a85..3cdb20db 100755 --- a/package/web/package.sh +++ b/package/web/package.sh @@ -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 \