diff --git a/build/compile_script/ark.py b/build/compile_script/ark.py index 755f43d1110231cd292166cfb59c61f977d63eed..d2bce87827dde35f21c1c643215a700c50c87422 100644 --- a/build/compile_script/ark.py +++ b/build/compile_script/ark.py @@ -83,7 +83,7 @@ class ArkPy: "description": "Build for arkcompiler target of target-operating-system linux and " "target-central-processing-unit x64.", - "expression_to_args_gn": "target_os = \"linux\"\ntarget_cpu = \"x64\"\n", + "expression_to_args_gn": "target_os = \"linux\"\ntarget_cpu = \"x64\"\nuse_flto = true\n", "prefix_of_name_of_out_dir_of_second_level": "x64", }, "linux_x86": { @@ -91,7 +91,7 @@ class ArkPy: "description": "Build for arkcompiler target of target-operating-system linux and " "target-central-processing-unit x86.", - "expression_to_args_gn": "target_os = \"linux\"\ntarget_cpu = \"x86\"\n", + "expression_to_args_gn": "target_os = \"linux\"\ntarget_cpu = \"x86\"\nuse_flto = false\n", "prefix_of_name_of_out_dir_of_second_level": "x86", }, "ohos_arm": { @@ -99,7 +99,7 @@ class ArkPy: "description": "Build for arkcompiler target of target-operating-system ohos and " "target-central-processing-unit arm.", - "expression_to_args_gn": "target_os = \"ohos\"\ntarget_cpu = \"arm\"\n", + "expression_to_args_gn": "target_os = \"ohos\"\ntarget_cpu = \"arm\"\nuse_flto = true\n", "prefix_of_name_of_out_dir_of_second_level": "arm", }, "ohos_arm64": { @@ -107,7 +107,7 @@ class ArkPy: "description": "Build for arkcompiler target of target-operating-system ohos and " "target-central-processing-unit arm64.", - "expression_to_args_gn": "target_os = \"ohos\"\ntarget_cpu = \"arm64\"\n", + "expression_to_args_gn": "target_os = \"ohos\"\ntarget_cpu = \"arm64\"\nuse_flto = true\n", "prefix_of_name_of_out_dir_of_second_level": "arm64", }, "android_arm64": { @@ -115,7 +115,7 @@ class ArkPy: "description": "Build for arkcompiler target of target-operating-system android and " "target-central-processing-unit arm64.", - "expression_to_args_gn": "target_os = \"android\"\ntarget_cpu = \"arm64\"\n", + "expression_to_args_gn": "target_os = \"android\"\ntarget_cpu = \"arm64\"\nuse_flto = false\n", "prefix_of_name_of_out_dir_of_second_level": "android_arm64", }, "mingw_x86_64": { @@ -123,7 +123,7 @@ class ArkPy: "description": "Build for arkcompiler target of target-operating-system MinGW(Minimalist GNU on Windows) and " "target-central-processing-unit x86_64.", - "expression_to_args_gn": "target_os = \"mingw\"\ntarget_cpu = \"x86_64\"\n", + "expression_to_args_gn": "target_os = \"mingw\"\ntarget_cpu = \"x86_64\"\nuse_flto = true\n", "prefix_of_name_of_out_dir_of_second_level": "mingw_x86_64", }, }, diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn index 58e4a0b7c895cb6dab17f4252206e35e348637fe..ba452c8ab72ce6223da1167ea266d276dbfb2feb 100644 --- a/build/config/BUILDCONFIG.gn +++ b/build/config/BUILDCONFIG.gn @@ -27,6 +27,7 @@ declare_args() { # Debug build. Enabling official builds automatically sets is_debug to false. is_debug = false is_standard_system = false + use_flto = false } declare_args() {