@@ -47,6 +47,7 @@ set(PLATFORM_LINUX FALSE CACHE INTERNAL "")
4747set (PLATFORM_MACOS FALSE CACHE INTERNAL "" )
4848set (PLATFORM_IOS FALSE CACHE INTERNAL "" )
4949set (PLATFORM_TVOS FALSE CACHE INTERNAL "" )
50+ set (PLATFORM_WEB FALSE CACHE INTERNAL "" )
5051set (PLATFORM_EMSCRIPTEN FALSE CACHE INTERNAL "" )
5152set (D3D11_SUPPORTED FALSE CACHE INTERNAL "D3D11 is not supported" )
5253set (D3D12_SUPPORTED FALSE CACHE INTERNAL "D3D12 is not supported" )
@@ -141,8 +142,9 @@ else()
141142 set (PLATFORM_TVOS TRUE CACHE INTERNAL "Target platform: tvOS" )
142143 message ("Target platform: tvOS " ${ARCH} )
143144 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Emscripten" )
144- set (PLATFORM_EMSCRIPTEN TRUE CACHE INTERNAL "Target platform: Emscripten" )
145- message ("Target platform: Emscripten " ${ARCH} )
145+ set (PLATFORM_WEB TRUE CACHE INTERNAL "Target platform: Web" )
146+ set (PLATFORM_EMSCRIPTEN TRUE CACHE INTERNAL "Build with Emscritpen" )
147+ message ("Target platform: Web " ${ARCH} )
146148 else ()
147149 message (FATAL_ERROR "Unsupported platform" )
148150 endif ()
@@ -210,11 +212,11 @@ elseif(PLATFORM_IOS)
210212 target_compile_definitions (Diligent-PublicBuildSettings INTERFACE PLATFORM_IOS=1 PLATFORM_APPLE=1)
211213elseif (PLATFORM_TVOS)
212214 target_compile_definitions (Diligent-PublicBuildSettings INTERFACE PLATFORM_TVOS=1 PLATFORM_APPLE=1)
213- elseif (PLATFORM_EMSCRIPTEN )
214- set (GLES_SUPPORTED TRUE CACHE INTERNAL "OpenGLES is supported on Emscripten platform" )
215- set (WEBGPU_SUPPORTED TRUE CACHE INTERNAL "WebGPU is supported on Emscripten platform" )
216- set (ARCHIVER_SUPPORTED TRUE CACHE INTERNAL "Archiver is supported on Emscripten platform" )
217- target_compile_definitions (Diligent-PublicBuildSettings INTERFACE PLATFORM_EMSCRIPTEN=1)
215+ elseif (PLATFORM_WEB )
216+ set (GLES_SUPPORTED TRUE CACHE INTERNAL "OpenGLES is supported on Web platform" )
217+ set (WEBGPU_SUPPORTED TRUE CACHE INTERNAL "WebGPU is supported on Web platform" )
218+ set (ARCHIVER_SUPPORTED TRUE CACHE INTERNAL "Archiver is supported on Web platform" )
219+ target_compile_definitions (Diligent-PublicBuildSettings INTERFACE PLATFORM_WEB=1 PLATFORM_EMSCRIPTEN=1)
218220else ()
219221 message (FATAL_ERROR "No PLATFORM_XXX variable defined. Make sure that 'DiligentCore' folder is processed first" )
220222endif ()
@@ -268,7 +270,7 @@ if(PLATFORM_APPLE)
268270 endif ()
269271endif ()
270272
271- if (PLATFORM_WIN32 OR PLATFORM_LINUX OR PLATFORM_MACOS OR PLATFORM_EMSCRIPTEN )
273+ if (PLATFORM_WIN32 OR PLATFORM_LINUX OR PLATFORM_MACOS OR PLATFORM_WEB )
272274 option (DILIGENT_BUILD_TESTS "Build Diligent Engine tests" OFF )
273275 if (DILIGENT_BUILD_TESTS)
274276 set (DILIGENT_BUILD_CORE_TESTS TRUE CACHE INTERNAL "Build Core tests" )
@@ -299,7 +301,7 @@ option(DILIGENT_NO_DIRECT3D12 "Disable Direct3D12 backend" OFF)
299301option (DILIGENT_NO_OPENGL "Disable OpenGL/GLES backend" OFF )
300302option (DILIGENT_NO_VULKAN "Disable Vulkan backend" OFF )
301303option (DILIGENT_NO_METAL "Disable Metal backend" OFF )
302- if (PLATFORM_EMSCRIPTEN )
304+ if (PLATFORM_WEB )
303305 option (DILIGENT_NO_WEBGPU "Disable WebGPU backend" OFF )
304306else ()
305307 option (DILIGENT_NO_WEBGPU "Disable WebGPU backend" ON )
@@ -370,7 +372,7 @@ endif()
370372
371373add_library (Diligent-BuildSettings INTERFACE )
372374
373- if (PLATFORM_EMSCRIPTEN )
375+ if (PLATFORM_WEB )
374376 target_compile_options (Diligent-BuildSettings INTERFACE
375377 "-pthread"
376378 "-mbulk-memory"
0 commit comments