SConscript (12922:a4f51f3405ac) SConscript (13098:e5f37a4dbbd0)
1# Copyright 2018 Google, Inc.
2#
3# Redistribution and use in source and binary forms, with or without
4# modification, are permitted provided that the following conditions are
5# met: redistributions of source code must retain the above copyright
6# notice, this list of conditions and the following disclaimer;
7# redistributions in binary form must reproduce the above copyright
8# notice, this list of conditions and the following disclaimer in the

--- 65 unchanged lines hidden (view full) ---

74 # Turn off extra warnings and Werror for the tests.
75 to_remove = ['-Wall', '-Wundef', '-Wextra', '-Werror']
76 env['CCFLAGS'] = \
77 filter(lambda f: f not in to_remove, env['CCFLAGS'])
78
79 env.Append(CPPPATH=test_dir.Dir('include'))
80 env.Append(CPPPATH=ext_dir)
81
1# Copyright 2018 Google, Inc.
2#
3# Redistribution and use in source and binary forms, with or without
4# modification, are permitted provided that the following conditions are
5# met: redistributions of source code must retain the above copyright
6# notice, this list of conditions and the following disclaimer;
7# redistributions in binary form must reproduce the above copyright
8# notice, this list of conditions and the following disclaimer in the

--- 65 unchanged lines hidden (view full) ---

74 # Turn off extra warnings and Werror for the tests.
75 to_remove = ['-Wall', '-Wundef', '-Wextra', '-Werror']
76 env['CCFLAGS'] = \
77 filter(lambda f: f not in to_remove, env['CCFLAGS'])
78
79 env.Append(CPPPATH=test_dir.Dir('include'))
80 env.Append(CPPPATH=ext_dir)
81
82 shared_lib_path = env['SHARED_LIB'][0].abspath
83 sl_dir, sl_base = os.path.split(shared_lib_path)
84 env.Append(LIBPATH=[sl_dir], LIBS=[sl_base])
85
82 super(SystemCTestBin, cls).declare_all(env)
83
84 def declare(self, env):
86 super(SystemCTestBin, cls).declare_all(env)
87
88 def declare(self, env):
89 env = env.Clone()
85 sources = list(self.sources)
86 for f in self.filters:
87 sources = Source.all.apply_filter(f)
88 objs = self.srcs_to_objs(env, sources)
90 sources = list(self.sources)
91 for f in self.filters:
92 sources = Source.all.apply_filter(f)
93 objs = self.srcs_to_objs(env, sources)
89 objs = objs + env['SHARED_LIB'] + env['MAIN_OBJS']
94 objs = objs + env['MAIN_OBJS']
95 relpath = os.path.relpath(
96 env['SHARED_LIB'][0].dir.abspath,
97 self.path(env).dir.abspath)
98 env.Append(LINKFLAGS=Split('-z origin'))
99 env.Append(RPATH=env.Literal(os.path.join('\\$$ORIGIN', relpath)))
90 return super(SystemCTestBin, self).declare(env, objs)
91
92 tests = []
93 def new_test(dirname, name):
94 test = SystemCTest(dirname, name)
95 tests.append(test)
96 return test
97

--- 66 unchanged lines hidden ---
100 return super(SystemCTestBin, self).declare(env, objs)
101
102 tests = []
103 def new_test(dirname, name):
104 test = SystemCTest(dirname, name)
105 tests.append(test)
106 return test
107

--- 66 unchanged lines hidden ---