mirror of
https://github.com/godotengine/godot-cpp.git
synced 2025-12-31 01:48:45 +03:00
- add -sUSE_PTHREADS=1 to link flags - add =1 to sSIDE_MODULE=1 in compile flags to match scons.
41 lines
1.1 KiB
CMake
41 lines
1.1 KiB
CMake
#[=======================================================================[.rst:
|
|
Web
|
|
---
|
|
|
|
This file contains functions for options and configuration for targeting the
|
|
Web platform
|
|
|
|
]=======================================================================]
|
|
|
|
# Emscripten requires this hack for use of the SHARED option
|
|
set(CMAKE_PROJECT_godot-cpp_INCLUDE cmake/emsdkHack.cmake)
|
|
|
|
#[==============================[ Web Options ]==============================]
|
|
function(web_options)
|
|
endfunction()
|
|
|
|
#[===========================[ Target Generation ]===========================]
|
|
function(web_generate)
|
|
target_compile_definitions(godot-cpp PUBLIC WEB_ENABLED UNIX_ENABLED)
|
|
|
|
target_compile_options(
|
|
godot-cpp
|
|
PUBLIC #
|
|
-sSIDE_MODULE=1
|
|
-sSUPPORT_LONGJMP=wasm
|
|
$<${THREADS_ENABLED}:-sUSE_PTHREADS=1>
|
|
)
|
|
|
|
target_link_options(
|
|
godot-cpp
|
|
INTERFACE #
|
|
-sWASM_BIGINT
|
|
-sSUPPORT_LONGJMP=wasm
|
|
-fvisibility=hidden
|
|
-shared
|
|
$<${THREADS_ENABLED}:-sUSE_PTHREADS=1>
|
|
)
|
|
|
|
common_compiler_flags()
|
|
endfunction()
|