Переглянути джерело

Add release monolithic libraries to installer (#17231)

* Fix issue include path for codegen

When the build path was outside the source folder, the include paths were based on the engine root.

Signed-off-by: Alex Peterson <[email protected]>

* include monolithic in installer

Signed-off-by: Alex Peterson <[email protected]>

* Fix unused var errors

Signed-off-by: Alex Peterson <[email protected]>

* use absolute install path

Signed-off-by: Alex Peterson <[email protected]>

* fix missing space

Signed-off-by: Alex Peterson <[email protected]>

* disable signing

Signed-off-by: Alex Peterson <[email protected]>

* fix autgen referencing build folder

Signed-off-by: Alex Peterson <[email protected]>

* Place autogen files in CORE

CPack will fail if it finds duplicate content in CORE and DEFAULT/MONOLITHIC, which can happen if we copy in the Monolithic files into CORE.

Signed-off-by: Alex Peterson <[email protected]>

* restore CPACK_UPLOAD_URL

Signed-off-by: Alex Peterson <[email protected]>

* comment fixes

Signed-off-by: Alex Peterson <[email protected]>

* Include monolithic in Linux packages

Signed-off-by: Alex Peterson <[email protected]>

* fix linux install path

Signed-off-by: Alex Peterson <[email protected]>

* revert linux package changes, rename mono job

Signed-off-by: Alex Peterson <[email protected]>

---------

Signed-off-by: Alex Peterson <[email protected]>
# Conflicts:
#	scripts/build/Platform/Windows/build_config.json
Alex Peterson 1 рік тому
батько
коміт
ce400d3953

+ 7 - 1
Gems/ScriptAutomation/Code/Source/ScriptAutomationSystemComponent.cpp

@@ -326,9 +326,10 @@ namespace AZ::ScriptAutomation
     void ScriptAutomationSystemComponent::ExecuteScript(const char* scriptFilePath)
     {
         AZ::Data::Asset<AZ::ScriptAsset> scriptAsset = LoadScriptAssetFromPath(scriptFilePath, *m_scriptContext.get());
-        [[maybe_unused]] AZStd::string localScriptFilePath = scriptFilePath;
+        AZStd::string localScriptFilePath = scriptFilePath;
         if (!scriptAsset)
         {
+#if AZ_ENABLE_TRACING
             // Push an error operation on the back of the queue instead of reporting it immediately so it doesn't get lost
             // in front of a bunch of queued m_scriptOperations.
             QueueScriptOperation([localScriptFilePath]()
@@ -336,17 +337,21 @@ namespace AZ::ScriptAutomation
                     AZ_Error("ScriptAutomation", false, "Script: Could not find or load script asset '%s'.", localScriptFilePath.c_str());
                 }
             );
+#endif // AZ_ENABLE_TRACING
             return;
         }
 
+#if AZ_ENABLE_TRACING
         QueueScriptOperation([localScriptFilePath]()
             {
                 AZ_Printf("ScriptAutomation", "Running script '%s'...\n", localScriptFilePath.c_str());
             }
         );
+#endif // AZ_ENABLE_TRACING
 
         if (!m_scriptContext->Execute(scriptAsset->m_data.GetScriptBuffer().data(), localScriptFilePath.c_str(), scriptAsset->m_data.GetScriptBuffer().size()))
         {
+#if AZ_ENABLE_TRACING
             // Push an error operation on the back of the queue instead of reporting it immediately so it doesn't get lost
             // in front of a bunch of queued m_scriptOperations.
             QueueScriptOperation([localScriptFilePath]()
@@ -354,6 +359,7 @@ namespace AZ::ScriptAutomation
                     AZ_Error("ScriptAutomation", false, "Script: Error running script '%s'.", localScriptFilePath.c_str());
                 }
             );
+#endif // AZ_ENABLE_TRACING
         }
     }
 

+ 22 - 7
cmake/Platform/Common/Install_common.cmake

@@ -89,14 +89,19 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME absolute_tar
                 # is per-permutation, we need to install such headers per permutation. For the other cases, we can install
                 # under the default component since they are shared across permutations/configs.
                 cmake_path(IS_PREFIX CMAKE_BINARY_DIR ${include_directory} NORMALIZE include_directory_child_of_build)
-                if(NOT include_directory_child_of_build)
-                    set(include_directory_component ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME})
-                else()
-                    set(include_directory_component ${LY_INSTALL_PERMUTATION_COMPONENT})
-                endif()
+
+                # In order to combine profile and release monolithic, we use the CORE component
+                # because CPack will fail if it finds duplicated content in CORE and DEFAULT/MONOLITHIC
+                set(include_directory_component ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME})
 
                 unset(rel_include_dir)
-                cmake_path(RELATIVE_PATH include_directory BASE_DIRECTORY ${LY_ROOT_FOLDER} OUTPUT_VARIABLE rel_include_dir)
+                if(include_directory_child_of_build)
+                    # We need to use the path relative to the binary folder otherwise you will get an invalid 
+                    # relative path if the build folder is outside the engine root.
+                    cmake_path(RELATIVE_PATH include_directory BASE_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_VARIABLE rel_include_dir)
+                else()
+                    cmake_path(RELATIVE_PATH include_directory BASE_DIRECTORY ${LY_ROOT_FOLDER} OUTPUT_VARIABLE rel_include_dir)
+                endif()
                 cmake_path(APPEND rel_include_dir "..")
                 cmake_path(NORMAL_PATH rel_include_dir OUTPUT_VARIABLE destination_dir)
 
@@ -196,7 +201,17 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME absolute_tar
         string(GENEX_STRIP ${include} include_genex_expr)
         if(include_genex_expr STREQUAL include) # only for cases where there are no generation expressions
             # Make the include path relative to the source dir where the target will be declared
-            cmake_path(RELATIVE_PATH include BASE_DIRECTORY ${absolute_target_source_dir} OUTPUT_VARIABLE target_include)
+            cmake_path(IS_PREFIX CMAKE_BINARY_DIR ${include} NORMALIZE include_directory_child_of_build)
+            if(include_directory_child_of_build)
+                # Some autogen files are placed in the build folder so remove the build folder prefix
+                # and use it to calculate the relative path  
+                cmake_path(RELATIVE_PATH include BASE_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_VARIABLE rel_include)
+                cmake_path(SET base_path ${LY_ROOT_FOLDER})
+                cmake_path(APPEND base_path ${rel_include} OUTPUT_VARIABLE absolute_include)
+                cmake_path(RELATIVE_PATH absolute_include BASE_DIRECTORY ${absolute_target_source_dir} OUTPUT_VARIABLE target_include)
+            else()
+                cmake_path(RELATIVE_PATH include BASE_DIRECTORY ${absolute_target_source_dir} OUTPUT_VARIABLE target_include)
+            endif()
             list(APPEND INCLUDE_DIRECTORIES_PLACEHOLDER "${PLACEHOLDER_INDENT}${target_include}")
         endif()
     endforeach()

+ 13 - 1
scripts/build/Platform/Windows/build_config.json

@@ -449,12 +449,24 @@
         "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo"
     }
   },
+  "install_mono_release": {
+    "TAGS": [],
+    "COMMAND": "build_windows.cmd",
+    "PARAMETERS": {
+      "CONFIGURATION": "release",
+      "OUTPUT_DIRECTORY": "build\\windows_mono",
+      "CMAKE_OPTIONS": "-DCMAKE_SYSTEM_VERSION=10.0 -DLY_MONOLITHIC_GAME=TRUE -DLY_DISABLE_TEST_MODULES=TRUE",
+      "CMAKE_TARGET": "INSTALL",
+      "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo"
+    }
+  },
   "installer_pipe": { 
     "TAGS": [
       "periodic-clean-weekly-internal",
       "nightly-installer"
     ],
     "steps": [
+      "install_mono_release",
       "installer",
       "installer_test"
     ]
@@ -469,7 +481,7 @@
         "CONFIGURATION": "profile",
         "OUTPUT_DIRECTORY": "build\\windows",
         "CMAKE_OPTIONS": "-DCMAKE_SYSTEM_VERSION=10.0 -DLY_DISABLE_TEST_MODULES=TRUE -DO3DE_INSTALL_ENGINE_NAME=o3de-sdk -DLY_INSTALLER_WIX_ROOT=\"!WIX! \"",
-        "EXTRA_CMAKE_OPTIONS": "-DLY_INSTALLER_AUTO_GEN_TAG=TRUE -DLY_INSTALLER_DOWNLOAD_URL=!INSTALLER_DOWNLOAD_URL! -DLY_INSTALLER_LICENSE_URL=!INSTALLER_DOWNLOAD_URL!/license",
+        "EXTRA_CMAKE_OPTIONS": "-DLY_INSTALLER_AUTO_GEN_TAG=TRUE -DLY_INSTALLER_DOWNLOAD_URL=!INSTALLER_DOWNLOAD_URL! -DLY_INSTALLER_LICENSE_URL=!INSTALLER_DOWNLOAD_URL!/license -DCPACK_INSTALLED_DIRECTORIES=\"!WORKSPACE!/o3de/install;/CORE\"",
         "CMAKE_TARGET": "ALL_BUILD",
         "CPACK_OPTIONS": "-D CPACK_UPLOAD_URL=\"!CPACK_UPLOAD_URL!\"",
         "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo"