Skip to content

Commit ffdca78

Browse files
committed
fixup! Python script needs to always create the multilib-optimised folder
1 parent c2f5ebc commit ffdca78

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

arm-software/embedded/arm-multilib/CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -396,10 +396,12 @@ add_custom_command(
396396
)
397397

398398
add_custom_target(multilib-yaml ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/multilib/multilib.yaml)
399-
install(
400-
FILES ${CMAKE_CURRENT_BINARY_DIR}/multilib/multilib.yaml
401-
DESTINATION .
402-
)
399+
if(NOT ENABLE_MULTILIB_HEADER_OPTIMISATION)
400+
install(
401+
FILES ${CMAKE_CURRENT_BINARY_DIR}/multilib/multilib.yaml
402+
DESTINATION .
403+
)
404+
endif()
403405

404406
# Extract common header files which spans across multilib variant directories.
405407
if(ENABLE_MULTILIB_HEADER_OPTIMISATION)

arm-software/embedded/arm-multilib/common-headers-generate.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ def collect_variant_include_paths(input_target_dir):
5252

5353

5454
def extract_common_headers_for_targets(args):
55+
if os.path.exists(args.multilib_optimised_dir):
56+
shutil.rmtree(args.multilib_optimised_dir)
57+
5558
for target in MULTILIB_TARGET_DIRS:
5659
input_target_dir = os.path.join(
5760
os.path.abspath(args.multilib_non_optimised_dir), target
@@ -70,10 +73,16 @@ def extract_common_headers_for_targets(args):
7073
variant_includes = collect_variant_include_paths(input_target_dir)
7174
if len(variant_includes) < 2:
7275
print(
73-
f"Skipping extracing the common headers for {target}: not enough variants to compare.At least two variants must be enabled for the multilib header optimisation phase to proceed."
76+
f"Skipping extracting the common headers for {target}: not enough variants to compare.At least two variants must be enabled for the multilib header optimisation phase to proceed."
7477
)
78+
# The script always creates the multilib-optimised folder, even when there's only one variant and no
79+
# optimization is applied. In that case, multilib-optimised will just contain a copy of the
80+
# single variant from the non-optimised multilib directory.
81+
if os.path.exists(args.multilib_non_optimised_dir):
82+
shutil.copytree(args.multilib_non_optimised_dir, args.multilib_optimised_dir)
7583
return
7684

85+
# Creating the common include headers for each target
7786
os.makedirs(output_include_dir, exist_ok=True)
7887

7988
# Step 1: compare first two variants and extract the common headers into the targets common include directory

0 commit comments

Comments
 (0)