Skip to content

Commit df15a4a

Browse files
Kangzs-perron
authored andcommitted
CMake: Add support for building with emscripten (KhronosGroup#2948)
1 parent c3ca047 commit df15a4a

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ option(SPIRV_ALLOW_TIMERS "Allow timers via clock_gettime on supported platforms
3939
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
4040
add_definitions(-DSPIRV_LINUX)
4141
set(SPIRV_TIMER_ENABLED ${SPIRV_ALLOW_TIMERS})
42+
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Emscripten")
43+
add_definitions(-DSPIRV_EMSCRIPTEN)
4244
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
4345
add_definitions(-DSPIRV_WINDOWS)
4446
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")

source/print.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include "source/print.h"
1616

1717
#if defined(SPIRV_ANDROID) || defined(SPIRV_LINUX) || defined(SPIRV_MAC) || \
18-
defined(SPIRV_FREEBSD)
18+
defined(SPIRV_FREEBSD) || defined(SPIRV_EMSCRIPTEN)
1919
namespace spvtools {
2020

2121
clr::reset::operator const char*() { return "\x1b[0m"; }

0 commit comments

Comments
 (0)