Pārlūkot izejas kodu

Add pre-js script to process request parameters as app's arguments.
Fix #1747. [ci only: Web]

Yao Wei Tjong 姚伟忠 8 gadi atpakaļ
vecāks
revīzija
4399c04d3a
1 mainītis faili ar 6 papildinājumiem un 0 dzēšanām
  1. 6 0
      CMake/Modules/UrhoCommon.cmake

+ 6 - 0
CMake/Modules/UrhoCommon.cmake

@@ -1477,6 +1477,12 @@ macro (setup_main_executable)
                         install (FILES ${SHARED_JS} ${SHARED_RESOURCE_JS}.data DESTINATION ${DEST_BUNDLE_DIR})
                         install (FILES ${SHARED_JS} ${SHARED_RESOURCE_JS}.data DESTINATION ${DEST_BUNDLE_DIR})
                     endif ()
                     endif ()
                 endif ()
                 endif ()
+                # If not using EMRUN then we need to include the emrun_prejs.js manually in order to process the request parameters as arguments correctly
+                if (NOT URHO3D_TESTING)
+                    set (EMRUN_PREJS ${EMSCRIPTEN_ROOT_PATH}/src/emrun_prejs.js)
+                    list (APPEND SOURCE_FILES ${EMRUN_PREJS})
+                    set_source_files_properties (${EMRUN_PREJS} PROPERTIES EMCC_OPTION pre-js)
+                endif ()
             endif ()
             endif ()
         endif ()
         endif ()
     endif ()
     endif ()