2024-11-21 00:30:48 +00:00
|
|
|
#[=======================================================================[.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 )
|
|
|
|
|
2024-12-29 02:14:46 +00:00
|
|
|
#[==============================[ Web Options ]==============================]
|
2024-11-21 00:30:48 +00:00
|
|
|
function( web_options )
|
|
|
|
# web options
|
|
|
|
endfunction()
|
|
|
|
|
2024-12-29 02:14:46 +00:00
|
|
|
#[===========================[ Target Generation ]===========================]
|
2024-12-11 00:10:21 +00:00
|
|
|
function( web_generate )
|
2024-11-21 00:30:48 +00:00
|
|
|
target_compile_definitions(${TARGET_NAME}
|
|
|
|
PUBLIC
|
|
|
|
WEB_ENABLED
|
|
|
|
UNIX_ENABLED
|
|
|
|
)
|
|
|
|
|
|
|
|
target_compile_options( ${TARGET_NAME}
|
|
|
|
PUBLIC
|
|
|
|
-sSIDE_MODULE
|
|
|
|
-sSUPPORT_LONGJMP=wasm
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_options( ${TARGET_NAME}
|
|
|
|
INTERFACE
|
|
|
|
-sWASM_BIGINT
|
|
|
|
-sSUPPORT_LONGJMP=wasm
|
|
|
|
-fvisibility=hidden
|
|
|
|
-shared
|
|
|
|
)
|
|
|
|
|
2024-12-11 00:10:21 +00:00
|
|
|
common_compiler_flags()
|
2024-11-21 00:30:48 +00:00
|
|
|
endfunction()
|