mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-12-27 10:20:14 +00:00
CMake: Add support for building with emscripten (#2948)
This commit is contained in:
parent
c3ca047419
commit
df15a4a3cb
@ -39,6 +39,8 @@ option(SPIRV_ALLOW_TIMERS "Allow timers via clock_gettime on supported platforms
|
||||
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
||||
add_definitions(-DSPIRV_LINUX)
|
||||
set(SPIRV_TIMER_ENABLED ${SPIRV_ALLOW_TIMERS})
|
||||
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Emscripten")
|
||||
add_definitions(-DSPIRV_EMSCRIPTEN)
|
||||
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
|
||||
add_definitions(-DSPIRV_WINDOWS)
|
||||
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "source/print.h"
|
||||
|
||||
#if defined(SPIRV_ANDROID) || defined(SPIRV_LINUX) || defined(SPIRV_MAC) || \
|
||||
defined(SPIRV_FREEBSD)
|
||||
defined(SPIRV_FREEBSD) || defined(SPIRV_EMSCRIPTEN)
|
||||
namespace spvtools {
|
||||
|
||||
clr::reset::operator const char*() { return "\x1b[0m"; }
|
||||
|
Loading…
Reference in New Issue
Block a user