Remove libm from emcripten builds

This commit is contained in:
Walter Schell 2021-01-16 09:53:29 -05:00
parent 7f19c453f6
commit 11ca778bb1
2 changed files with 14 additions and 11 deletions

View File

@ -33,5 +33,5 @@ jobs:
working-directory: ${{github.workspace}}/build working-directory: ${{github.workspace}}/build
shell: bash shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>" # Execute the build. You can specify a specific target with "--target <NAME>"
run: emcmake cmake --build . --config $BUILD_TYPE run: cmake --build . --config $BUILD_TYPE

View File

@ -39,18 +39,21 @@ target_include_directories(lua_static PUBLIC "include")
if(UNIX) if(UNIX)
set(LUA_DEFINITIONS) set(LUA_DEFINITIONS)
find_library(LIBM m) if(NOT EMSCRIPTEN)
#TODO: Redo this with find_package find_library(LIBM m)
if(NOT LIBM) #TODO: Redo this with find_package
message(FATAL_ERROR "libm not found and requred by lua") if(NOT LIBM)
endif() message(FATAL_ERROR "libm not found and requred by lua")
target_link_libraries(lua_static INTERFACE ${LIBM}) endif()
target_link_libraries(lua_static INTERFACE ${LIBM})
list(APPEND LUA_DEFINITIONS LUA_USE_POSIX) list(APPEND LUA_DEFINITIONS LUA_USE_POSIX)
if(LUA_SUPPORT_DL) if(LUA_SUPPORT_DL)
target_compile_definitions(lua_static PRIVATE "LUA_USE_DLOPEN") target_compile_definitions(lua_static PRIVATE "LUA_USE_DLOPEN")
target_link_libraries(lua_static INTERFACE dl) target_link_libraries(lua_static INTERFACE dl)
endif()
endif() endif()
target_compile_definitions(lua_static target_compile_definitions(lua_static
PUBLIC ${LUA_DEFINITIONS} PUBLIC ${LUA_DEFINITIONS}
) )