jes/wscript

32 lines
1.0 KiB
Python

import platform
import re
def options(opt):
opt.load("compiler_c compiler_cxx")
def configure(conf):
conf.load("compiler_c compiler_cxx")
conf.check(header_name = "getopt.h")
def build(bld):
bld(features = "c cprogram cxx cxxprogram",
target = "jes",
source = bld.path.ant_glob(["src/**/*.cc", "src/**/*.c"]),
cxxflags = ["-Wall", "-std=gnu++14"],
lib = ["dl", "GL"])
test_libs = []
if re.search(r'linux', platform.platform(), re.IGNORECASE):
test_libs += ["pthread"]
test_sources = bld.path.ant_glob("src/**/*.cc")
test_sources = [s for s in test_sources if not s.abspath().endswith("src/jes.cc")]
test_sources += bld.path.ant_glob("test/src/**/*.cc")
test_sources += ["gtest-1.7.0/src/gtest-all.cc",
"gtest-1.7.0/src/gtest_main.cc"]
bld(features = "cxx cxxprogram",
target = "tests",
source = test_sources,
includes = ["gtest-1.7.0/include", "gtest-1.7.0", "src"],
lib = test_libs,
cxxflags = ["-Wall", "-std=gnu++14"])