Import('env') env = env.Clone() env.Append(RUSTCFLAGS = [ '-g', '-C', 'opt-level=s', ]) SConscript('SConscript.libcommon.rs', exports='env', duplicate=0) test_source_files = [ 'test/main.rs', # Must be listed first (see below). 'test/gps_test.rs', 'test/logger_test.rs', ] test_env = env.Clone() test_env.Append(RUSTCFLAGS = [ '-L', '$LIBPATH', '--test', ]) test = test_env.Rustc('gps-watch-test', test_source_files[0]) for f in test_source_files: Depends(test, f) Depends(test, 'libcommon.rlib') Default(test)