diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index df646993..b2bc31a8 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -46,7 +46,7 @@ jobs: - name: Setup emsdk uses: mymindstorm/setup-emsdk@v12 with: - version: 3.1.25 + version: 3.1.41 actions-cache-folder: 'emsdk-cache' - name: Install gcc-12 diff --git a/CMakeLists.txt b/CMakeLists.txt index 059d432e..811b5cd7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ add_subdirectory(src/ui) ExternalProject_Add( ui-wasm SOURCE_DIR ${CMAKE_SOURCE_DIR}/src/ui PREFIX ${PREFIX_DIR}/ui-wasm - CONFIGURE_COMMAND ${EMCMAKE_COMMAND} ${CMAKE_COMMAND} -G ${CMAKE_GENERATOR} -S ${CMAKE_SOURCE_DIR}/src/ui -B ${BUILD_DIR}/ui-wasm -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} -DCMAKE_MAKE_PROGRAM:FILEPATH=${CMAKE_MAKE_PROGRAM} + CONFIGURE_COMMAND ${EMCMAKE_COMMAND} ${CMAKE_COMMAND} -G "Unix Makefiles" -S ${CMAKE_SOURCE_DIR}/src/ui -B ${BUILD_DIR}/ui-wasm -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} -DCMAKE_MAKE_PROGRAM=${CMAKE_SOURCE_DIR}/emmake_make.sh BUILD_COMMAND cmake --build ${BUILD_DIR}/ui-wasm BINARY_DIR ${BUILD_DIR}/ui-wasm BUILD_ALWAYS 1 diff --git a/emmake_make.sh b/emmake_make.sh new file mode 100755 index 00000000..c2043151 --- /dev/null +++ b/emmake_make.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# +# this is a script for ExternalProject_add ui-wasm +# + +emmake make $@ + diff --git a/src/ui/emscripten_compat.h b/src/ui/emscripten_compat.h index e00e8c24..19c6ba24 100644 --- a/src/ui/emscripten_compat.h +++ b/src/ui/emscripten_compat.h @@ -4,12 +4,15 @@ // These functions are missing from emscripten's libcpp but are used by plf_colony.h // so implement them here for now +#ifndef HAS_STD_RANGES_DISTANCE +#if defined(__cpp_lib_ranges) && __cpp_lib_ranges >= 201911L +#define HAS_STD_RANGES_DISTANCE 1 +#else +#define HAS_STD_RANGES_DISTANCE 0 +#endif +#endif + namespace std { -namespace ranges { -auto distance(auto r) { - return std::distance(std::begin(r), std::end(r)); -} -} // namespace ranges template constexpr auto lexicographical_compare_three_way(I1 f1, I1 l1, I2 f2, I2 l2, Cmp comp)