From bd1f1bd655cf29ea0c038848152c6b3767dd9e06 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Fri, 8 Jul 2016 19:12:52 -0400 Subject: [PATCH] add APPNAME and VERSION defines --- src/gui/Window.cc | 2 +- src/jes.cc | 2 +- wscript | 10 ++++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/gui/Window.cc b/src/gui/Window.cc index eba7454..ddaa635 100644 --- a/src/gui/Window.cc +++ b/src/gui/Window.cc @@ -72,7 +72,7 @@ bool Window::create() } m_window = SDL_CreateWindow( - "jes", + APPNAME, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, INITIAL_WIDTH, diff --git a/src/jes.cc b/src/jes.cc index 2604865..a93b649 100644 --- a/src/jes.cc +++ b/src/jes.cc @@ -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()) diff --git a/wscript b/wscript index 964a11a..e27f275 100644 --- a/wscript +++ b/wscript @@ -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"])