project_files/hwc/CMakeLists.txt
changeset 11659 870f22de388b
parent 11405 fac466eb0c4d
child 11664 71bdf987e41f
--- a/project_files/hwc/CMakeLists.txt	Tue Apr 19 12:04:21 2016 -0400
+++ b/project_files/hwc/CMakeLists.txt	Wed Apr 20 14:46:04 2016 -0400
@@ -6,6 +6,9 @@
 find_package(SDL2_net REQUIRED)
 find_package(SDL2_image REQUIRED)
 find_package(SDL2_ttf REQUIRED)
+if(BUILD_ENGINE_JS)
+    find_package(Emscripten REQUIRED)
+endif()
 
 #compile our rtl implementation
 include_directories(${GLEW_INCLUDE_DIR})
@@ -78,6 +81,11 @@
 add_definitions(-DPAS2C)
 add_definitions(-Werror=incompatible-pointer-types)
 
+if(BUILD_ENGINE_JS)
+    #hijack the c compiler with emscripten
+    set(CMAKE_C_COMPILER ${EMSCRIPTEN_EXECUTABLE})
+endif()
+
 add_executable(hwengine WIN32 ${engine_sources})
 
 target_link_libraries(hwengine  fpcrtl