42 lines
1.1 KiB
CMake
42 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 )
|
|
# web options
|
|
endfunction()
|
|
|
|
#[===========================[ Target Generation ]===========================]
|
|
function( web_generate )
|
|
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
|
|
)
|
|
|
|
common_compiler_flags()
|
|
endfunction()
|