6 changed files with 72 additions and 14 deletions
@ -0,0 +1,17 @@
|
||||
# This function defines a target that points to an Emscripten system library. |
||||
# |
||||
# Arguments: |
||||
# LIB_NAME: a human-readable library name. |
||||
# TARGET_NAME: the library target name |
||||
# ...ARGN: Emscripten flags. |
||||
# |
||||
# Example: |
||||
# emscripten_system_library("SDL2_image" SDL2::SDL2_image USE_SDL_IMAGE=2 "SDL2_IMAGE_FORMATS='[\"png\"]'") |
||||
function(emscripten_system_library LIB_NAME TARGET_NAME) |
||||
add_library(${TARGET_NAME} INTERFACE IMPORTED GLOBAL) |
||||
foreach(arg ${ARGN}) |
||||
target_compile_options(${TARGET_NAME} INTERFACE "SHELL:-s ${arg}") |
||||
target_link_options(${TARGET_NAME} INTERFACE "SHELL:-s ${arg}") |
||||
endforeach() |
||||
message("-- 📚 ${LIB_NAME}: Emscripten system library via ${ARGN}") |
||||
endfunction() |
||||
@ -0,0 +1,10 @@
|
||||
set(BUILD_TESTING OFF) |
||||
set(DISABLE_ZERO_TIER ON) |
||||
set(DEVILUTIONX_SYSTEM_SDL_AUDIOLIB OFF) |
||||
set(DEVILUTIONX_SYSTEM_LIBSODIUM OFF) |
||||
set(DEVILUTIONX_SYSTEM_LIBFMT OFF) |
||||
|
||||
# Emscripten ports do have a bzip2 but it fails to link with this error: |
||||
# warning: _BZ2_bzDecompress may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library |
||||
# error: undefined symbol: BZ2_bzDecompressEnd (referenced by top-level compiled C/C++ code) |
||||
set(DEVILUTIONX_SYSTEM_BZIP2 OFF) |
||||
Loading…
Reference in new issue