aboutsummaryrefslogtreecommitdiff
path: root/cmake/Platform/Emscripten_unix.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/Platform/Emscripten_unix.cmake')
-rw-r--r--cmake/Platform/Emscripten_unix.cmake12
1 files changed, 10 insertions, 2 deletions
diff --git a/cmake/Platform/Emscripten_unix.cmake b/cmake/Platform/Emscripten_unix.cmake
index 1e1d7fa9..5358138f 100644
--- a/cmake/Platform/Emscripten_unix.cmake
+++ b/cmake/Platform/Emscripten_unix.cmake
@@ -1,5 +1,13 @@
# On Unix platforms, we must specify the absolute path to emcc for cmake, having emcc in PATH will cause cmake to fail finding it.
# The user must set the EMSCRIPTEN variable to point to the Emscripten root folder.
-file(TO_CMAKE_PATH "$ENV{EMSCRIPTEN/}" EMCC_PATH)
-include(Emscripten.cmake)
+if ("$ENV{EMSCRIPTEN}" STREQUAL "")
+ message(ERROR "Environment variable EMSCRIPTEN has not been set! Please point it to Emscripten root directory!")
+endif()
+
+set(CMAKE_C_COMPILER "$ENV{EMSCRIPTEN}/emcc")
+set(CMAKE_CXX_COMPILER "$ENV{EMSCRIPTEN}/em++")
+set(CMAKE_AR "$ENV{EMSCRIPTEN}/emar")
+set(CMAKE_RANLIB "$ENV{EMSCRIPTEN}/emranlib")
+
+include($ENV{EMSCRIPTEN}/cmake/Platform/Emscripten.cmake)