From 6a342648ae50beb8457871862f14fc9baef6b74f Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Tue, 28 Jan 2020 15:54:20 +0000 Subject: COMPMID-3023: Conditionally build test framework when needed. Alters build system to build test framework only when at least one test suite is needed. Signed-off-by: Georgios Pinitas Change-Id: I97cfe55b7727210249478e321a9fd150b84f898f Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/2653 Tested-by: Arm Jenkins Reviewed-by: Giuseppe Rossini Reviewed-by: Giorgio Arena Comments-Addressed: Arm Jenkins --- tests/SConscript | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tests/SConscript b/tests/SConscript index a6668e1f98..5c95c551f4 100644 --- a/tests/SConscript +++ b/tests/SConscript @@ -26,8 +26,6 @@ Import('env') Import('vars') Import('install_bin') -SConscript('./framework/SConscript', duplicate=0) - # vars is imported from arm_compute: variables = [ BoolVariable("benchmark_examples", "Build benchmark examples programs", True), @@ -45,18 +43,31 @@ for v in variables: new_options.Add(v) vars.Add(v) -# Disable floating-point expression contraction (e.g. fused multiply-add operations) -env.Append(CXXFLAGS = ['-ffp-contract=off']) - # Clone the environment to make sure we're not polluting the arm_compute one: test_env = env.Clone() vars.Update(test_env) Help(new_options.GenerateHelpText(test_env)) +# Check if we need to build the test framework +build_test_framework = False +for opt in new_options.keys(): + option_value = test_env[opt] + if type(option_value) is bool and option_value: + build_test_framework = True + break + +if not build_test_framework: + Return() +else: + SConscript('./framework/SConscript', duplicate=0) + Import("arm_compute_test_framework") test_env.Append(LIBS = arm_compute_test_framework) +# Disable floating-point expression contraction (e.g. fused multiply-add operations) +test_env.Append(CXXFLAGS = ['-ffp-contract=off']) + # Remove -Wnoexcept from tests if 'g++' in test_env['CXX'] and '-Wnoexcept' in test_env['CXXFLAGS']: test_env['CXXFLAGS'].remove("-Wnoexcept") -- cgit v1.2.1