add APPNAME and VERSION defines

This commit is contained in:
Josh Holtrop 2016-07-08 19:12:52 -04:00
parent 40b6518ea4
commit bd1f1bd655
3 changed files with 10 additions and 4 deletions

View File

@ -72,7 +72,7 @@ bool Window::create()
}
m_window = SDL_CreateWindow(
"jes",
APPNAME,
SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED,
INITIAL_WIDTH,

View File

@ -4,7 +4,7 @@
int main(int argc, char * argv[])
{
Runtime::init(argv[0], "jes");
Runtime::init(argv[0], APPNAME);
Window w;
if (!w.create())

10
wscript
View File

@ -2,6 +2,9 @@ import platform
import re
import os.path
APPNAME = "jes"
VERSION = "0.0.1"
def options(opt):
opt.load("compiler_c compiler_cxx")
@ -12,13 +15,15 @@ def configure(conf):
conf.check_cfg(package = "freetype2", args = "--cflags --libs")
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"]
bld(features = "c cprogram cxx cxxprogram",
target = "jes",
target = APPNAME,
source = bld.path.ant_glob(["src/**/*.cc", "src/**/*.c", "libs/glcxx/src/glcxx/*"]),
includes = includes,
defines = ['GLCXX_GL_INCLUDE="gl3w.h"'],
defines = ['GLCXX_GL_INCLUDE="gl3w.h"'] + defines,
cxxflags = ["-Wall", "-std=gnu++14"],
lib = ["dl", "GL"],
uselib = ["SDL2", "FREETYPE2"])
@ -36,5 +41,6 @@ def build(bld):
target = "tests",
source = test_sources,
includes = test_includes,
defines = defines,
lib = test_libs,
cxxflags = ["-Wall", "-std=gnu++14"])