Merge branch 'master' into d

switch from waf to rscons
This commit is contained in:
Josh Holtrop 2019-12-02 21:04:42 -05:00
commit 846d81b60e
7 changed files with 27 additions and 242 deletions

5
.gitignore vendored
View File

@ -1,6 +1,5 @@
/.lock-waf*
/.waf*
/.rsconscache
/.rscons*
/build/
/test/tmp/
/coverage/
/jes

View File

@ -1,7 +1,7 @@
.PHONY: all
all:
@rscons
./rscons build
.PHONY: clean
clean:
@rscons -c
./rscons clean

View File

@ -3,5 +3,5 @@ Rscons::Environment.new do |env|
"src/**/*.d",
"src/**/*.c"]
env["D_IMPORT_PATH"] += Dir["src/**/"]
env.Program("#{env.build_root}/jes", "${sources}")
env.Program("jes", "${sources}")
end

2
configure vendored
View File

@ -5,4 +5,4 @@ if [ ! -e libs/glcxx/src ]; then
exit 1
fi
exec ./waf configure "$@"
exec "$(dirname "$0")"/rscons configure "$@"

21
rscons Executable file

File diff suppressed because one or more lines are too long

169
waf vendored

File diff suppressed because one or more lines are too long

66
wscript
View File

@ -1,66 +0,0 @@
import platform
import re
import os.path
APPNAME = "jes"
VERSION = "0.0.1"
def options(opt):
opt.load("compiler_c compiler_cxx")
def configure(conf):
conf.load("compiler_c compiler_cxx")
conf.check(header_name = "getopt.h", global_define = False)
conf.check_cfg(package = "freetype2", uselib_store = "FreeType2", args = "--cflags --libs")
if platform.system() == "Linux":
conf.check(header_name = "X11/Xlib.h", global_define = False)
conf.check(lib = 'GL', global_define = False)
elif platform.system() == "Windows":
conf.check(header_name = "windows.h", global_define = False)
conf.check(lib = 'opengl32', global_define = False)
def build(bld):
defines = ['APPNAME="%s"' % APPNAME]
defines += ['VERSION="%s"' % VERSION]
includes = [p for p in bld.path.ant_glob("src/**", dir = True) if os.path.isdir(p.abspath())]
includes += ["libs/glcxx/include"]
libs = []
if platform.system() == "Linux":
defines += ["PLATFORM_LINUX"]
defines += ["JTK_X"]
libs += ["dl", "GL", "X11"]
elif platform.system() == "Windows":
defines += ["PLATFORM_WINDOWS"]
defines += ["JTK_WINDOWS"]
libs += ["opengl32"]
defines += ['GLCXX_GL_INCLUDE="gl3w.h"']
sources = bld.path.ant_glob(["src/**/*.cc", "src/**/*.c", "libs/glcxx/src/glcxx/*"])
bld(features = "c cprogram cxx cxxprogram",
target = APPNAME,
source = sources,
includes = includes,
defines = defines,
cxxflags = ["-Wall", "-std=gnu++14", "-O2", "-Wno-switch"],
lib = libs,
uselib = ["FreeType2"])
test_libs = libs + []
if platform.system() == "Linux":
test_libs += ["pthread"]
elif platform.system() == "Windows":
pass
import sys
test_sources = bld.path.ant_glob(["src/*/**/*.cc", "src/*/**/*.c", "libs/glcxx/src/glcxx/*"])
test_sources += bld.path.ant_glob("test/src/**/*.cc")
test_sources += ["libs/googletest/src/gtest-all.cc"]
test_includes = includes + ["libs/googletest/include", "libs/googletest"]
test_defines = defines + ["ENABLE_TESTING"]
bld(features = "cxx cxxprogram",
target = "tests",
source = test_sources,
includes = test_includes,
defines = test_defines,
lib = test_libs,
cxxflags = ["-Wall", "-std=gnu++14", "--coverage", "-Wno-switch", "-include", "iostream"],
linkflags = ["--coverage"],
uselib = ["FreeType2"])