diff options
author | Uwe Klotz <uklotz@mixxx.org> | 2020-01-11 19:49:26 +0100 |
---|---|---|
committer | Uwe Klotz <uklotz@mixxx.org> | 2020-01-12 13:50:36 +0100 |
commit | 526af54134eaea5871993c893e3a92d0bd7bacb1 (patch) | |
tree | 611e81dffb3306747a3a2e384fbba13b569568cd /build/features.py | |
parent | 3340864aa493f74c15f895ba22c706d886a7cb78 (diff) |
Fix the googletest/benchmark SCons build
Diffstat (limited to 'build/features.py')
-rw-r--r-- | build/features.py | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/build/features.py b/build/features.py index 8ca0039285..f6292f3afd 100644 --- a/build/features.py +++ b/build/features.py @@ -648,30 +648,35 @@ class TestSuite(Feature): # Clone our main environment so we don't change any settings in the # Mixxx environment - test_env = build.env.Clone() + env = build.env.Clone() + SCons.Export('env') + SCons.Export('build') # -pthread tells GCC to do the right thing regardless of system if build.toolchain_is_gnu: - test_env.Append(CCFLAGS='-pthread') - test_env.Append(LINKFLAGS='-pthread') - - test_env.Append(CPPPATH="#lib/googletest-1.8.x/googletest/include") - gtest_dir = test_env.Dir("lib/googletest-1.8.x/googletest") + env.Append(CCFLAGS='-pthread') + env.Append(LINKFLAGS='-pthread') - env = test_env - SCons.Export('env') - SCons.Export('build') + # Build gtest + env.Append(CPPPATH="#lib/googletest-1.8.x/googletest/include") + gtest_dir = env.Dir("lib/googletest-1.8.x/googletest") env.SConscript(env.File('SConscript', gtest_dir)) + build.env.Append(LIBPATH=gtest_dir) + build.env.Append(LIBS=['gtest']) - # build and configure gmock - test_env.Append(CPPPATH="#lib/googletest-1.8.x/googlemock/include") - gmock_dir = test_env.Dir("lib/googletest-1.8.x/googlemock") + # Build gmock + env.Append(CPPPATH="#lib/googletest-1.8.x/googlemock/include") + gmock_dir = env.Dir("lib/googletest-1.8.x/googlemock") env.SConscript(env.File('SConscript', gmock_dir)) + build.env.Append(LIBPATH=gmock_dir) + build.env.Append(LIBS=['gmock']) # Build the benchmark library - test_env.Append(CPPPATH="#lib/benchmark/include") - benchmark_dir = test_env.Dir("lib/benchmark") + env.Append(CPPPATH="#lib/benchmark/include") + benchmark_dir = env.Dir("lib/benchmark") env.SConscript(env.File('SConscript', benchmark_dir)) + build.env.Append(LIBPATH=benchmark_dir) + build.env.Append(LIBS=['benchmark']) return [] |