Use bundled Boost with Emscripten

This commit is contained in:
yulya3102 2025-01-27 00:52:38 +01:00
parent 6fc476f1f0
commit 08d77d6e93
5 changed files with 21 additions and 4 deletions

View file

@ -1,3 +1,12 @@
if(CMAKE_SYSTEM_NAME STREQUAL Emscripten)
set(BOOST_INCLUDE_LIBRARIES random stacktrace math)
set(BOOST_ENABLE_COMPATIBILITY_TARGETS 1)
add_subdirectory(boost EXCLUDE_FROM_ALL)
# TODO: make this available via find_package so we wouldn't have to
# special-case it in every library
endif()
file(GLOB_RECURSE RAPIDJSON_SOURCES "${CMAKE_CURRENT_LIST_DIR}/rapidjson/include/*")
add_library(rapidjson INTERFACE EXCLUDE_FROM_ALL "${RAPIDJSON_SOURCES}")
target_include_directories(rapidjson INTERFACE "${CMAKE_CURRENT_LIST_DIR}/rapidjson/include")

View file

@ -1,6 +1,8 @@
option(PSEMEK_ROBUST_PREDICATES "Use robust geometric predicates" OFF)
find_package(Boost REQUIRED)
if(NOT (CMAKE_SYSTEM_NAME STREQUAL Emscripten))
find_package(Boost REQUIRED)
endif()
if(PSEMEK_ROBUST_PREDICATES)
find_package(GMP REQUIRED)
endif()

View file

@ -1,4 +1,6 @@
find_package(Boost COMPONENTS random REQUIRED)
if(NOT (CMAKE_SYSTEM_NAME STREQUAL Emscripten))
find_package(Boost COMPONENTS random REQUIRED)
endif()
file(GLOB_RECURSE PSEMEK_PCG_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "include/*.hpp")
file(GLOB_RECURSE PSEMEK_PCG_SOURCES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "source/*.cpp")

View file

@ -1,4 +1,6 @@
find_package(Boost COMPONENTS random REQUIRED)
if(NOT (CMAKE_SYSTEM_NAME STREQUAL Emscripten))
find_package(Boost COMPONENTS random REQUIRED)
endif()
file(GLOB_RECURSE PSEMEK_RANDOM_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "include/*.hpp")
file(GLOB_RECURSE PSEMEK_RANDOM_SOURCES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "source/*.cpp")

View file

@ -1,4 +1,6 @@
find_package(Boost REQUIRED)
if(NOT (CMAKE_SYSTEM_NAME STREQUAL Emscripten))
find_package(Boost REQUIRED)
endif()
file(GLOB_RECURSE PSEMEK_UTIL_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "include/*.hpp")
file(GLOB_RECURSE PSEMEK_UTIL_SOURCES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "source/*.cpp")