From 7f19c453f6b98f1c333d5d53a5d8deccbb6b8411 Mon Sep 17 00:00:00 2001 From: Walter Schell Date: Sat, 16 Jan 2021 09:46:38 -0500 Subject: [PATCH 1/2] Got rid of caching emscripten env --- .github/workflows/build-emscripten.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-emscripten.yml b/.github/workflows/build-emscripten.yml index be4eb6d..d037854 100644 --- a/.github/workflows/build-emscripten.yml +++ b/.github/workflows/build-emscripten.yml @@ -11,20 +11,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: mymindstorm/setup-emsdk@v7 - with: - # Make sure to set a version number! - version: 1.38.40 - # This is the name of the cache folder. - # The cache folder will be placed in the build directory, - # so make sure it doesn't conflict with anything! - actions-cache-folder: 'emsdk-cache' - + - uses: actions/checkout@v2 - + - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{github.workspace}}/build + run: emcmake cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake # Use a bash shell so we can use the same syntax for environment variable From 11ca778bb1ecaf6f6681cd9612feb1276bc37762 Mon Sep 17 00:00:00 2001 From: Walter Schell Date: Sat, 16 Jan 2021 09:53:29 -0500 Subject: [PATCH 2/2] Remove libm from emcripten builds --- .github/workflows/build-emscripten.yml | 2 +- lua-5.4.0/CMakeLists.txt | 23 +++++++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-emscripten.yml b/.github/workflows/build-emscripten.yml index d037854..a7cc41d 100644 --- a/.github/workflows/build-emscripten.yml +++ b/.github/workflows/build-emscripten.yml @@ -33,5 +33,5 @@ jobs: working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " - run: emcmake cmake --build . --config $BUILD_TYPE + run: cmake --build . --config $BUILD_TYPE diff --git a/lua-5.4.0/CMakeLists.txt b/lua-5.4.0/CMakeLists.txt index 6524dc2..f0ec5d1 100644 --- a/lua-5.4.0/CMakeLists.txt +++ b/lua-5.4.0/CMakeLists.txt @@ -39,18 +39,21 @@ target_include_directories(lua_static PUBLIC "include") if(UNIX) set(LUA_DEFINITIONS) - find_library(LIBM m) - #TODO: Redo this with find_package - if(NOT LIBM) - message(FATAL_ERROR "libm not found and requred by lua") - endif() - target_link_libraries(lua_static INTERFACE ${LIBM}) + if(NOT EMSCRIPTEN) + find_library(LIBM m) + #TODO: Redo this with find_package + if(NOT LIBM) + message(FATAL_ERROR "libm not found and requred by lua") + endif() + target_link_libraries(lua_static INTERFACE ${LIBM}) - list(APPEND LUA_DEFINITIONS LUA_USE_POSIX) - if(LUA_SUPPORT_DL) - target_compile_definitions(lua_static PRIVATE "LUA_USE_DLOPEN") - target_link_libraries(lua_static INTERFACE dl) + list(APPEND LUA_DEFINITIONS LUA_USE_POSIX) + if(LUA_SUPPORT_DL) + target_compile_definitions(lua_static PRIVATE "LUA_USE_DLOPEN") + target_link_libraries(lua_static INTERFACE dl) + endif() endif() + target_compile_definitions(lua_static PUBLIC ${LUA_DEFINITIONS} )