Set export name when compiling with emscripten

This commit is contained in:
Martchus 2024-06-10 22:34:29 +02:00
parent ac049868c3
commit 27f4bf8d94
1 changed files with 5 additions and 0 deletions

View File

@ -611,6 +611,11 @@ if (GCOV_COVERAGE_ENABLED)
list(APPEND META_ADDITIONAL_LINK_FLAGS ${GCC_COVERAGE_FLAGS})
endif ()
# set export name when compiling with emscripten
if (CMAKE_C_COMPILER MATCHES ".*emcc$")
list(APPEND PRIVATE_LIBRARIES "-sEXPORT_NAME='${META_PROJECT_VARNAME_LOWER}'")
endif ()
# configure creation of install targets
if (NOT META_NO_INSTALL_TARGETS)
# install targets have not been disabled on project level check whether install targets are disabled by the user this