1
1
forked from 0ad/0ad

Add nvtt to build system

This was SVN commit r8093.
This commit is contained in:
Ykkrosh 2010-09-10 20:15:49 +00:00
parent 933fb2dc9f
commit aadbf53a2a
3 changed files with 32 additions and 3 deletions

View File

@ -15,7 +15,12 @@ local function add_extern_lib_paths(extern_lib)
-- Often, the headers in libraries/ are windows-specific (always, except
-- for cxxtest and fcollada). So don't add the include dir unless on
-- windows or processing one of those libs.
if OS == "windows" or extern_lib == "cxxtest" or extern_lib == "fcollada" or extern_lib == "valgrind" then
if OS == "windows" or
extern_lib == "cxxtest" or
extern_lib == "fcollada" or
extern_lib == "valgrind" or
(extern_lib == "nvtt" and not options["with-system-nvtt"])
then
tinsert(package.includepaths, libraries_dir .. extern_lib .. "/include")
-- Insert libs at pos=1 (i.e. the front of the list) so they take
-- precedence over system libraries
@ -157,6 +162,12 @@ extern_lib_defs = {
end
end,
},
nvtt = {
win_names = { "nvtt" },
unix_names = { "nvtt" },
defines = { "NVTT_SHARED=1" },
dbg_suffix = "", -- for performance we always use the Release-mode version
},
openal = {
win_names = { "openal32" },
unix_names = { "openal" },

View File

@ -6,6 +6,7 @@ addoption("icc", "Use Intel C++ Compiler (Linux only; should use either \"--cc i
addoption("outpath", "Location for generated project files")
addoption("without-tests", "Disable generation of test projects")
addoption("without-pch", "Disable generation and usage of precompiled headers")
addoption("with-system-nvtt", "Search standard paths for nvidia-texture-tools library, instead of using bundled copy")
addoption("bindir", "Directory for executables (typically '/usr/games'); default is to be relocatable")
addoption("datadir", "Directory for data files (typically '/usr/share/games/0ad'); default is ../data/ relative to executable")
addoption("libdir", "Directory for libraries (typically '/usr/lib/games/0ad'); default is ./ relative to executable")
@ -466,6 +467,7 @@ function setup_all_libs ()
"renderer"
}
extern_libs = {
"nvtt",
"opengl",
"sdl", -- key definitions
"spidermonkey", -- for graphics/scripting
@ -615,6 +617,8 @@ used_extern_libs = {
"enet",
"valgrind",
"nvtt",
}
-- Bundles static libs together with main.cpp and builds game executable.

View File

@ -2,10 +2,18 @@
die()
{
echo ERROR: $*
exit 1
echo ERROR: $*
exit 1
}
with_system_nvtt=false
for i in "$@"
do
case $i in
--with-system-nvtt ) with_system_nvtt=true ;;
esac
done
cd "$(dirname $0)"
# Now in build/workspaces/ (where we assume this script resides)
@ -14,7 +22,13 @@ echo
# Build/update bundled external libraries
(cd ../../libraries/fcollada/src && make) || die "FCollada build failed"
echo
(cd ../../libraries/spidermonkey-tip && ./build.sh) || die "SpiderMonkey build failed"
echo
if [ "$with_system_nvtt" = "false" ]; then
(cd ../../libraries/nvtt && ./build.sh) || die "NVTT build failed"
fi
echo
# Make sure workspaces/gcc exists.
mkdir -p gcc