Skip to content

Commit

Permalink
fix ui-wasm build
Browse files Browse the repository at this point in the history
only calling make/ninja will not build correctly - call emmake make instead. otherwise some native codepaths in opencmw will be selected instead of the emscripten ones

update emscripten and remove std::ranges::distance
  • Loading branch information
Alexander Busse committed Jul 18, 2023
1 parent f21a0dc commit ea4a047
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions emmake_make.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
#
# this is a script for ExternalProject_add ui-wasm
#

emmake make $@

5 changes: 0 additions & 5 deletions src/ui/emscripten_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
// so implement them here for now

namespace std {
namespace ranges {
auto distance(auto r) {
return std::distance(std::begin(r), std::end(r));
}
} // namespace ranges

template<class I1, class I2, class Cmp>
constexpr auto lexicographical_compare_three_way(I1 f1, I1 l1, I2 f2, I2 l2, Cmp comp)
Expand Down

0 comments on commit ea4a047

Please sign in to comment.