diff --git a/bootstrap.py b/bootstrap.py old mode 100644 new mode 100755 index 5a55c467..f417ea17 --- a/bootstrap.py +++ b/bootstrap.py @@ -33,27 +33,35 @@ def replace_extension(f, e): parser = argparse.ArgumentParser() parser.add_argument('--debug', action='store_true', help='compile with debug flags') parser.add_argument('--cxx', metavar='', help='compiler name to use (default: g++)', default='g++') -parser.add_argument('--ci', action='store_true', help='compile under TeamCity CI (internal use only)') +parser.add_argument('--ci', action='store_true', help=argparse.SUPPRESS) +parser.add_argument('--lua-dir', metavar='', help='directory lua is in with include and lib subdirectories') args = parser.parse_args() # general variables include = [ '.', os.path.join('Catch', 'include')] depends = [] cxxflags = [ '-Wall', '-Wextra', '-pedantic', '-pedantic-errors', '-std=c++11' ] -ldflags = [ '-static' ] +ldflags = [] if args.debug: cxxflags.extend(['-g', '-O0']) else: cxxflags.extend(['-DNDEBUG', '-O3']) +if args.lua_dir: + include.extend([os.path.join(args.lua_dir, 'include')]) + ldflags.extend(library_includes([os.path.join(args.lua_dir, 'lib')])) + if args.ci: - ldflags.extend(libraries(['lua5.2', 'dl'])) + ldflags.extend(libraries(['lua5.2'])) ldflags.extend(library_includes(['lib'])) include.extend(['/usr/include/lua5.2', './lua-5.2.2/src', './include']) else: ldflags.extend(libraries(['lua'])) +if 'linux' in sys.platform: + ldflags.extend(libraries(['dl'])) + builddir = 'bin' objdir = 'obj' tests = os.path.join(builddir, 'tests')