Navigation Menu

Skip to content

Commit

Permalink
- Added $(ORXFLAGS) as extra environment driven compile flags in prem…
Browse files Browse the repository at this point in the history
…ake script

- Added pre-build step to retrieve the current build number (hg only, won't work with git or package)
- Updated setup.r to create placeholder orxBuild.h file if needed

--HG--
branch : version_system
  • Loading branch information
iarwain committed Jan 5, 2017
1 parent 310e5fa commit cf8d6e3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions .hgignore
Expand Up @@ -73,3 +73,4 @@ code/build/**
tools/orxCrypt/build/**
tools/orxFontGen/build/**
tutorial/build/**
code/include/base/orxBuild.h
6 changes: 6 additions & 0 deletions code/build/premake4.lua
Expand Up @@ -415,6 +415,7 @@ project "orxLIB"
configuration {}
targetdir ("../lib/dynamic")
kind ("SharedLib")
buildoptions {"$(ORXFLAGS)"}

configuration {"not xcode*", "*Core*"}
targetdir ("../lib/static")
Expand Down Expand Up @@ -450,6 +451,7 @@ project "orxLIB"

configuration {"linux"}
defines {"_GNU_SOURCE"}
prebuildcommands {"hg log -l 1 --template \"#define __orxVERSION_BUILD__ {rev}\" > " .. copybase .. "/include/base/orxBuild.h 2> /dev/null"}

configuration {"linux", "not *Core*"}
links
Expand Down Expand Up @@ -504,6 +506,7 @@ project "orxLIB"

configuration{"macosx"}
buildoptions{"-Wno-deprecated-declarations", "-Wno-empty-body"}
prebuildcommands {"hg log -l 1 --template \"#define __orxVERSION_BUILD__ {rev}\" > " .. copybase .. "/include/base/orxBuild.h 2> /dev/null"}

configuration {"macosx", "*Debug*"}
linkoptions {"-install_name @executable_path/liborxd.dylib"}
Expand Down Expand Up @@ -542,6 +545,9 @@ project "orxLIB"

-- Windows

configuration {"windows"}
prebuildcommands {"hg log -l 1 --template \"#define __orxVERSION_BUILD__ {rev}\" > " .. path.translate(copybase, "\\") .. "\\include\\base\\orxBuild.h 2> nul"}

configuration {"windows", "not *Core*"}
links
{
Expand Down
11 changes: 10 additions & 1 deletion code/build/rebol/setup.r
Expand Up @@ -18,8 +18,9 @@ hg: %.hg/
hg-hook: "update.orx"
git: %.git/
git-hooks: [%post-checkout %post-merge]
build-file: %code/include/base/orxBuild.h
platform-data: [
"windows" ['premake "windows" 'config ["gmake" "codelite" "vs2012" "vs2013" "vs2015"] ]
"windows" ['premake "windows" 'config ["gmake" "codelite" "vs2013" "vs2015"] ]
"mac" ['premake "mac" 'config ["gmake" "codelite" "xcode4" ] ]
"linux" ['premake "linux32" 'config ["gmake" "codelite" ] 'deps ["freeglut3-dev" "libsndfile1-dev" "libopenal-dev" "libxrandr-dev"]]
]
Expand Down Expand Up @@ -126,6 +127,14 @@ either req-ver = cur-ver [
]


; Build file placeholder
if not exists? build-file [
attempt [
write build-file {}
]
]


; Runs premake
premake-path: dirize rejoin [premake-root platform-info/premake]
premake: read premake-path
Expand Down
4 changes: 4 additions & 0 deletions code/include/base/orxVersion.h
Expand Up @@ -45,6 +45,10 @@

#include "base/orxType.h"

#ifndef __orxVERSION_BUILD__
#include "base/orxBuild.h"
#endif /* __orxVERSION_BUILD__ */


/** Version numbers
*/
Expand Down

0 comments on commit cf8d6e3

Please sign in to comment.