project_files/hwc/CMakeLists.txt
changeset 11666 7d483d400f8d
parent 11664 71bdf987e41f
child 11684 8f5db41471f4
--- a/project_files/hwc/CMakeLists.txt	Thu Apr 21 13:10:15 2016 -0400
+++ b/project_files/hwc/CMakeLists.txt	Thu Apr 21 14:16:47 2016 -0400
@@ -57,15 +57,20 @@
 list(APPEND engine_sources_pas ${CMAKE_SOURCE_DIR}/hedgewars/pas2cRedo.pas)
 
 
+set(pas2c_args -n hwengine
+               -i ${CMAKE_SOURCE_DIR}/hedgewars
+               -o ${CMAKE_CURRENT_BINARY_DIR}
+               -a ${CMAKE_CURRENT_BINARY_DIR}
+               -d ENDIAN_LITTLE
+               -d DEBUGFILE)
+if(BUILD_ENGINE_JS)
+    set(pas2c_args ${pas2c_args} -d WEBGL)
+endif()
+
 #invoke pas2c on main module, it will call all the others
 add_custom_command(OUTPUT ${engine_sources}
                    COMMAND "${EXECUTABLE_OUTPUT_PATH}/pas2c${CMAKE_EXECUTABLE_SUFFIX}"
-                   ARGS -n "hwengine"
-                        -i "${CMAKE_SOURCE_DIR}/hedgewars"
-                        -o "${CMAKE_CURRENT_BINARY_DIR}"
-                        -a "${CMAKE_CURRENT_BINARY_DIR}"
-                        -d "ENDIAN_LITTLE"
-                        -d "DEBUGFILE"
+                   ARGS ${pas2c_args}
                    DEPENDS pas2c                     #converter tool
                            ${engine_sources_pas}     #original pascal file
                   )