From aadbf53a2ac92050e632423dc385eba10af9bbee Mon Sep 17 00:00:00 2001 From: Ykkrosh Date: Fri, 10 Sep 2010 20:15:49 +0000 Subject: [PATCH] Add nvtt to build system This was SVN commit r8093. --- build/premake/extern_libs.lua | 13 ++++++++++++- build/premake/premake.lua | 4 ++++ build/workspaces/update-workspaces.sh | 18 ++++++++++++++++-- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/build/premake/extern_libs.lua b/build/premake/extern_libs.lua index f1a4616e6a..09b896567f 100644 --- a/build/premake/extern_libs.lua +++ b/build/premake/extern_libs.lua @@ -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" }, diff --git a/build/premake/premake.lua b/build/premake/premake.lua index 54149271bc..87c82f66ae 100644 --- a/build/premake/premake.lua +++ b/build/premake/premake.lua @@ -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. diff --git a/build/workspaces/update-workspaces.sh b/build/workspaces/update-workspaces.sh index 547a01e609..08dd002479 100755 --- a/build/workspaces/update-workspaces.sh +++ b/build/workspaces/update-workspaces.sh @@ -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