Merge branch 'master' of github.com:martine/ninja
authorEvan Martin <martine@danga.com>
Thu, 8 Sep 2011 01:48:41 +0000 (18:48 -0700)
committerEvan Martin <martine@danga.com>
Thu, 8 Sep 2011 01:48:41 +0000 (18:48 -0700)
Conflicts:
configure.py

1  2 
configure.py

diff --cc configure.py
@@@ -159,29 -154,17 +159,29 @@@ n.build('ninja', 'link', objs, implicit
  n.newline()
  
  n.comment('Tests all build into ninja_test executable.')
 +
 +variables = []
 +test_cflags = None
 +test_ldflags = None
 +if options.with_gtest:
 +    path = options.with_gtest
 +    test_cflags = cflags + ['-I%s' % os.path.join(path, 'include')]
 +    test_libs = libs + [os.path.join(path, 'lib/.libs/lib%s.a' % lib)
 +                        for lib in ['gtest_main', 'gtest']]
 +else:
 +    test_libs = libs + ['-lgtest_main', '-lgtest']
 +
  objs = []
- for name in ['build_test', 'build_log_test', 'graph_test', 'ninja_test',
-              'parsers_test', 'subprocess_test', 'util_test', 'clean_test',
-              'test']:
+ for name in ['build_test', 'build_log_test', 'disk_interface_test',
+              'graph_test', 'ninja_test', 'parsers_test', 'subprocess_test',
+              'util_test', 'clean_test', 'test']:
 -    objs += cxx(name)
 -ldflags.append('-lgtest_main -lgtest')
 +    objs += cxx(name, variables=[('cflags', test_cflags)])
 +
  if platform != 'mingw':
 -    ldflags.append('-lpthread')
 +    libs.append('-lpthread')
  n.build('ninja_test', 'link', objs, implicit=ninja_lib,
 -        variables=[('libs', '-L$builddir -lninja'),
 -                   ('ldflags', ' '.join(ldflags))])
 +        variables=[('ldflags', test_ldflags),
 +                   ('libs', test_libs)])
  n.newline()
  
  n.comment('Perftest executable.')