瀏覽代碼

Remove the self-executable HTML shell-file hack.
Related to commit 9fd287bde6e4f6f6a5c39393603afc56c6b030cc.
Revert db908c2be5a3e7551b17a5aa7ace8cff33ebf607.

Yao Wei Tjong 姚伟忠 6 年之前
父節點
當前提交
2bcb0f1b2f
共有 1 個文件被更改,包括 1 次插入17 次删除
  1. 1 17
      CMake/Modules/UrhoCommon.cmake

+ 1 - 17
CMake/Modules/UrhoCommon.cmake

@@ -1528,16 +1528,9 @@ macro (setup_executable)
     # Need to check if the destination variable is defined first because this macro could be called by downstream project that does not wish to install anything
     if (NOT ARG_PRIVATE)
         if (WEB AND DEST_BUNDLE_DIR)
-            set (EXTS data html.map js wasm)
-            if (SELF_EXECUTABLE_SHELL)
-                # Install it as program so it gets the correct file permission
-                install (PROGRAMS $<TARGET_FILE:${TARGET_NAME}> DESTINATION ${DEST_BUNDLE_DIR})
-            else ()
-                list (APPEND EXTS html)
-            endif ()
             set (LOCATION $<TARGET_FILE_DIR:${TARGET_NAME}>)
             unset (FILES)
-            foreach (EXT ${EXTS})
+            foreach (EXT data html html.map js wasm)
                 list (APPEND FILES ${LOCATION}/${TARGET_NAME}.${EXT})
             endforeach ()
             install (FILES ${FILES} DESTINATION ${DEST_BUNDLE_DIR} OPTIONAL)
@@ -1652,10 +1645,6 @@ macro (setup_main_executable)
                     get_property (EMCC_OPTION SOURCE ${FILE} PROPERTY EMCC_OPTION)
                     if (EMCC_OPTION STREQUAL shell-file)
                         list (APPEND TARGET_PROPERTIES SUFFIX .html)
-                        # Check if the shell-file is self-executable
-                        file (READ ${FILE} SHEBANG LIMIT 3)     # Workaround CMake's funny way of file I/O operation
-                        string (COMPARE EQUAL ${SHEBANG} "#!\n" SELF_EXECUTABLE_SHELL)
-                        set (HAS_SHELL_FILE 1)
                         break ()
                     endif ()
                 endforeach ()
@@ -1664,7 +1653,6 @@ macro (setup_main_executable)
                     if (URHO3D_TESTING OR EMSCRIPTEN_AUTO_SHELL)
                         add_html_shell ()
                         list (APPEND TARGET_PROPERTIES SUFFIX .html)
-                        set (SELF_EXECUTABLE_SHELL 1)
                         set (HAS_SHELL_FILE 1)
                     endif ()
                 endif ()
@@ -1847,10 +1835,6 @@ macro (_setup_target)
                 list (APPEND LINK_FLAGS "--${EMCC_OPTION} \"${FILE}\"${EMCC_FILE_ALIAS}${EMCC_EXCLUDE_FILE}${USE_PRELOAD_CACHE}")
             endif ()
         endforeach ()
-        # If it is a self-executable shell-file then change the file permission of the output file accordingly
-        if (SELF_EXECUTABLE_SHELL AND NOT CMAKE_HOST_WIN32)
-            add_custom_command (TARGET ${TARGET_NAME} POST_BUILD COMMAND chmod +x $<TARGET_FILE:${TARGET_NAME}>)
-        endif ()
     endif ()
     # Set additional linker dependencies (only work for Makefile-based generator according to CMake documentation)
     if (LINK_DEPENDS)