From 752f462fee8334166967742f391613306dcd9a6e Mon Sep 17 00:00:00 2001 From: Gunes Bayir Date: Tue, 6 Jan 2026 14:04:52 +0000 Subject: [PATCH] build: Remove redundant test framework build in SCons Test framework was being built even though it's not used. This patch changes the build system so that it's only built when the framework is used. Change-Id: Ia3fdc21180e85b3d131a5c6b352a2a5b379cd342 Signed-off-by: Gunes Bayir --- tests/SConscript | 7 ++++--- tests/framework/SConscript | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/SConscript b/tests/SConscript index bdaad04768..59ca904f95 100644 --- a/tests/SConscript +++ b/tests/SConscript @@ -1,7 +1,7 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright (c) 2017-2025 Arm Limited. +# Copyright (c) 2017-2026 Arm Limited. # # SPDX-License-Identifier: MIT # @@ -65,8 +65,9 @@ if not build_test_framework: else: SConscript('./framework/SConscript', duplicate=0) -Import("arm_compute_test_framework") -test_env.Append(LIBS = arm_compute_test_framework) +if test_env['validation_tests'] or test_env['benchmark_tests'] or test_env['benchmark_examples'] or test_env['profile']: + Import("arm_compute_test_framework") + test_env.Append(LIBS = arm_compute_test_framework) # Disable floating-point expression contraction (e.g. fused multiply-add operations) if not 'windows' in env['os']: diff --git a/tests/framework/SConscript b/tests/framework/SConscript index cca5169099..13a125247f 100644 --- a/tests/framework/SConscript +++ b/tests/framework/SConscript @@ -1,7 +1,7 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright (c) 2017-2022, 2024 Arm Limited. +# Copyright (c) 2017-2022, 2024, 2026 Arm Limited. # # SPDX-License-Identifier: MIT # @@ -95,7 +95,8 @@ if framework_env['HOST_OS'] == 'posix': #Set up directory for temp files. To prevent permission issue, the temp files are in the same directory with output files framework_env['TEMPFILEDIR'] = framework_env['build_dir'] -arm_compute_test_framework = framework_env.StaticLibrary('arm_compute_test_framework', files) +if framework_env['validation_tests'] or framework_env['benchmark_tests'] or framework_env['benchmark_examples'] or framework_env['profile']: + arm_compute_test_framework = framework_env.StaticLibrary('arm_compute_test_framework', files) -Default(arm_compute_test_framework) -Export('arm_compute_test_framework') + Default(arm_compute_test_framework) + Export('arm_compute_test_framework')