2005-10-17 03:11:12 +02:00
|
|
|
addoption("atlas", "Include Atlas scenario editor packages")
|
2006-12-06 01:06:05 +01:00
|
|
|
addoption("collada", "Include COLLADA packages (requires FCollada library)")
|
2009-11-16 22:23:43 +01:00
|
|
|
addoption("coverage", "Enable code coverage data collection (GCC only)")
|
2009-03-22 18:57:11 +01:00
|
|
|
addoption("aoe3ed", "Include AoE3Ed")
|
2007-01-04 04:22:23 +01:00
|
|
|
addoption("icc", "Use Intel C++ Compiler (Linux only; should use either \"--cc icc\" or --without-pch too, and then set CXX=icpc before calling make)")
|
2006-04-20 03:20:24 +02:00
|
|
|
addoption("outpath", "Location for generated project files")
|
2006-06-09 00:33:59 +02:00
|
|
|
addoption("without-tests", "Disable generation of test projects")
|
2006-11-12 20:46:47 +01:00
|
|
|
addoption("without-pch", "Disable generation and usage of precompiled headers")
|
2005-10-17 03:11:12 +02:00
|
|
|
|
2009-03-24 22:40:10 +01:00
|
|
|
use_dcdt = false -- disable it since it's a non-Free library
|
|
|
|
|
2006-04-20 03:20:24 +02:00
|
|
|
dofile("functions.lua")
|
2006-06-07 06:34:48 +02:00
|
|
|
dofile("extern_libs.lua")
|
2004-06-02 12:47:27 +02:00
|
|
|
|
2010-04-15 22:15:16 +02:00
|
|
|
-- detect CPU architecture (simplistic, currently only supports x86 and amd64)
|
2008-06-30 19:34:18 +02:00
|
|
|
arch = "x86"
|
|
|
|
if OS == "windows" then
|
|
|
|
if os.getenv("PROCESSOR_ARCHITECTURE") == "amd64" or os.getenv("PROCESSOR_ARCHITEW6432") == "amd64" then
|
|
|
|
arch = "amd64"
|
|
|
|
end
|
|
|
|
else
|
2009-07-17 23:28:03 +02:00
|
|
|
arch = os.getenv("HOSTTYPE")
|
|
|
|
if arch == "x86_64" then
|
2008-06-30 19:34:18 +02:00
|
|
|
arch = "amd64"
|
2010-04-15 22:15:16 +02:00
|
|
|
else
|
2009-09-11 18:43:07 +02:00
|
|
|
os.execute("gcc -dumpmachine > .gccmachine.tmp")
|
|
|
|
local f = io.open(".gccmachine.tmp", "r")
|
|
|
|
local machine = f:read("*line")
|
|
|
|
f:close()
|
|
|
|
if string.find(machine, "x86_64") == 1 then
|
|
|
|
arch = "amd64"
|
|
|
|
elseif string.find(machine, "i.86") == 1 then
|
|
|
|
arch = "x86"
|
|
|
|
else
|
|
|
|
print("WARNING: Cannot determine architecture from GCC, assuming x86")
|
|
|
|
end
|
|
|
|
end
|
2008-06-30 19:34:18 +02:00
|
|
|
end
|
|
|
|
|
2004-06-02 12:47:27 +02:00
|
|
|
-- Set up the Project
|
2004-12-02 19:22:46 +01:00
|
|
|
project.name = "pyrogenesis"
|
2006-04-20 03:20:24 +02:00
|
|
|
project.bindir = "../../binaries/system"
|
|
|
|
project.libdir = "../../binaries/system"
|
|
|
|
project.debugdir = "../../binaries/system"
|
|
|
|
if not options["outpath"] then
|
|
|
|
error("You must specify the 'outpath' parameter")
|
|
|
|
end
|
|
|
|
project.path = options["outpath"]
|
2004-07-27 02:47:15 +02:00
|
|
|
project.configs = { "Debug", "Release", "Testing" }
|
2004-06-02 12:47:27 +02:00
|
|
|
|
2006-06-02 06:07:18 +02:00
|
|
|
if OS == "windows" then
|
2006-04-20 03:20:24 +02:00
|
|
|
project.nasmpath = "../../build/bin/nasm.exe"
|
2006-06-09 00:28:23 +02:00
|
|
|
project.cxxtestpath = "../../build/bin/cxxtestgen.exe"
|
2007-05-31 03:47:17 +02:00
|
|
|
has_broken_pch = false
|
2006-06-08 00:19:42 +02:00
|
|
|
else
|
2006-09-30 20:47:24 +02:00
|
|
|
project.cxxtestpath = "../../build/bin/cxxtestgen.pl"
|
2009-07-12 17:20:09 +02:00
|
|
|
if OS == "linux" and arch == "amd64" then
|
2009-07-12 17:16:03 +02:00
|
|
|
-- Hack for amd64 linux - tell nasm to product 64-bit elf.
|
|
|
|
project.nasmformat = "elf64"
|
|
|
|
end
|
2007-05-31 03:47:17 +02:00
|
|
|
|
|
|
|
-- GCC bug (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10591) - PCH breaks anonymous namespaces
|
|
|
|
-- Fixed in 4.2.0, but we have to disable PCH for earlier versions, else
|
|
|
|
-- it conflicts annoyingly with wx 2.8 headers.
|
|
|
|
-- It's too late to do this test by the time we start compiling the PCH file, so
|
|
|
|
-- do the test in this build script instead (which is kind of ugly - please fix if
|
|
|
|
-- you have a better idea)
|
2007-06-01 02:34:36 +02:00
|
|
|
if not options["icc"] then
|
|
|
|
os.execute("gcc -dumpversion > .gccver.tmp")
|
2009-09-11 18:43:07 +02:00
|
|
|
local f = io.open(".gccver.tmp", "r")
|
2007-06-01 02:34:36 +02:00
|
|
|
major, dot, minor = f:read(1, 1, 1)
|
2009-09-11 18:43:07 +02:00
|
|
|
f:close()
|
2007-06-01 02:34:36 +02:00
|
|
|
major = 0+major -- coerce to number
|
|
|
|
minor = 0+minor
|
|
|
|
has_broken_pch = (major < 4 or (major == 4 and minor < 2))
|
2009-03-22 18:57:11 +01:00
|
|
|
if has_broken_pch then
|
|
|
|
print("WARNING: Detected GCC <4.2 -- disabling PCH for Atlas (will increase build times)")
|
|
|
|
end
|
2007-06-01 02:34:36 +02:00
|
|
|
end
|
2006-04-20 03:20:24 +02:00
|
|
|
end
|
|
|
|
|
2006-06-02 06:07:18 +02:00
|
|
|
source_root = "../../../source/" -- default for most projects - overridden by local in others
|
|
|
|
|
|
|
|
-- Rationale: packages should not have any additional include paths except for
|
|
|
|
-- those required by external libraries. Instead, we should always write the
|
|
|
|
-- full relative path, e.g. #include "maths/Vector3d.h". This avoids confusion
|
2006-06-03 07:08:32 +02:00
|
|
|
-- ("which file is meant?") and avoids enormous include path lists.
|
2006-06-02 06:07:18 +02:00
|
|
|
|
|
|
|
|
2006-06-07 06:34:48 +02:00
|
|
|
-- packages: engine static libs, main exe, atlas, atlas frontends, test.
|
|
|
|
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
-- package helper functions
|
|
|
|
--------------------------------------------------------------------------------
|
2006-06-02 06:07:18 +02:00
|
|
|
|
2006-06-07 03:40:24 +02:00
|
|
|
function package_set_target(package_name)
|
2006-06-02 06:07:18 +02:00
|
|
|
|
|
|
|
-- Note: On Windows, ".exe" is added on the end, on unices the name is used directly
|
|
|
|
package.config["Debug" ].target = package_name.."_dbg"
|
|
|
|
package.config["Testing"].target = package_name.."_test"
|
|
|
|
package.config["Release"].target = package_name
|
|
|
|
|
|
|
|
local obj_dir_prefix = "obj/"..package_name.."_"
|
|
|
|
package.config["Debug" ].objdir = obj_dir_prefix.."Debug"
|
|
|
|
package.config["Testing"].objdir = obj_dir_prefix.."Test"
|
|
|
|
package.config["Release"].objdir = obj_dir_prefix.."Release"
|
2006-06-07 03:40:24 +02:00
|
|
|
end
|
2006-06-02 06:07:18 +02:00
|
|
|
|
2006-06-07 06:34:48 +02:00
|
|
|
|
2006-06-07 03:40:24 +02:00
|
|
|
function package_set_build_flags()
|
2006-06-02 06:07:18 +02:00
|
|
|
|
2007-01-02 19:11:00 +01:00
|
|
|
package.buildflags = { "with-symbols", "no-edit-and-continue" }
|
|
|
|
if not options["icc"] then
|
2009-08-06 21:41:18 +02:00
|
|
|
-- adds the -Wall compiler flag
|
2007-01-02 19:11:00 +01:00
|
|
|
tinsert(package.buildflags, "extra-warnings") -- this causes far too many warnings/remarks on ICC
|
|
|
|
end
|
2006-06-02 06:07:18 +02:00
|
|
|
|
|
|
|
-- PremakeWiki says with-symbols and optimize are automatically set for
|
|
|
|
-- Debug and Release builds, respectively. doesn't happen though, so do it manually.
|
|
|
|
|
2009-12-28 17:45:42 +01:00
|
|
|
package.config["Debug"].defines = { "DEBUG" }
|
|
|
|
|
2006-06-02 06:07:18 +02:00
|
|
|
package.config["Testing"].buildflags = { "no-runtime-checks" }
|
|
|
|
package.config["Testing"].defines = { "TESTING" }
|
|
|
|
|
2007-03-01 23:34:38 +01:00
|
|
|
package.config["Release"].buildflags = { "no-runtime-checks", "optimize-speed" }
|
2006-06-02 06:07:18 +02:00
|
|
|
package.config["Release"].defines = { "NDEBUG" }
|
|
|
|
|
2008-05-13 21:34:16 +02:00
|
|
|
-- required for the lowlevel library. must be set from all packages that use it, otherwise it assumes it is
|
|
|
|
-- being used as a DLL (which is currently not the case in 0ad)
|
|
|
|
tinsert(package.defines, "LIB_STATIC_LINK")
|
|
|
|
|
2006-06-02 06:07:18 +02:00
|
|
|
-- various platform-specific build flags
|
|
|
|
if OS == "windows" then
|
|
|
|
|
|
|
|
-- use native wchar_t type (not typedef to unsigned short)
|
2006-06-07 03:40:24 +02:00
|
|
|
tinsert(package.buildflags, "native-wchar_t")
|
2007-06-09 04:40:48 +02:00
|
|
|
|
2006-06-02 06:07:18 +02:00
|
|
|
else -- *nix
|
2007-01-02 19:11:00 +01:00
|
|
|
if options["icc"] then
|
|
|
|
tinsert(package.buildoptions, {
|
|
|
|
"-w1",
|
2007-01-03 16:45:13 +01:00
|
|
|
-- "-Wabi",
|
2007-01-02 19:11:00 +01:00
|
|
|
-- "-Wp64", -- complains about OBJECT_TO_JSVAL which is annoying
|
|
|
|
"-Wpointer-arith",
|
|
|
|
"-Wreturn-type",
|
|
|
|
-- "-Wshadow",
|
|
|
|
"-Wuninitialized",
|
|
|
|
"-Wunknown-pragmas",
|
|
|
|
"-Wunused-function",
|
2007-09-03 01:41:06 +02:00
|
|
|
"-wd1292", -- avoid lots of 'attribute "__nonnull__" ignored'
|
2007-01-02 19:11:00 +01:00
|
|
|
})
|
|
|
|
tinsert(package.config["Debug"].buildoptions, {
|
|
|
|
"-O0", -- ICC defaults to -O2
|
|
|
|
})
|
2007-09-03 14:56:45 +02:00
|
|
|
if OS == "macosx" then
|
|
|
|
tinsert(package.linkoptions, {"-multiply_defined","suppress"})
|
|
|
|
end
|
2007-01-02 19:11:00 +01:00
|
|
|
else
|
|
|
|
tinsert(package.buildoptions, {
|
2009-07-28 19:01:30 +02:00
|
|
|
-- enable most of the standard warnings
|
|
|
|
"-Wno-switch", -- enumeration value not handled in switch (this is sometimes useful, but results in lots of noise)
|
|
|
|
"-Wno-reorder", -- order of initialization list in constructors (lots of noise)
|
|
|
|
"-Wno-invalid-offsetof", -- offsetof on non-POD types (see comment in renderer/PatchRData.cpp)
|
|
|
|
|
|
|
|
"-Wextra",
|
|
|
|
"-Wno-missing-field-initializers", -- (this is common in external headers we can't fix)
|
|
|
|
|
|
|
|
-- add some other useful warnings that need to be enabled explicitly
|
|
|
|
"-Wunused-parameter",
|
|
|
|
"-Wredundant-decls", -- (useful for finding some multiply-included header files)
|
|
|
|
-- "-Wformat=2", -- (useful sometimes, but a bit noisy, so skip it by default)
|
|
|
|
-- "-Wcast-qual", -- (useful for checking const-correctness, but a bit noisy, so skip it by default)
|
2010-03-31 22:40:45 +02:00
|
|
|
"-Wnon-virtual-dtor", -- (sometimes noisy but finds real bugs)
|
2009-07-28 19:01:30 +02:00
|
|
|
|
|
|
|
-- enable security features (stack checking etc) that shouldn't have
|
|
|
|
-- a significant effect on performance and can catch bugs
|
|
|
|
"-fstack-protector-all",
|
|
|
|
"-D_FORTIFY_SOURCE=2",
|
|
|
|
|
|
|
|
-- always enable strict aliasing (useful in debug builds because of the warnings)
|
|
|
|
"-fstrict-aliasing",
|
2009-07-18 21:55:27 +02:00
|
|
|
|
2007-01-02 19:11:00 +01:00
|
|
|
-- do something (?) so that ccache can handle compilation with PCH enabled
|
|
|
|
"-fpch-preprocess",
|
2008-07-01 23:43:08 +02:00
|
|
|
|
|
|
|
-- enable SSE intrinsics
|
|
|
|
"-msse",
|
|
|
|
|
2009-11-20 13:56:11 +01:00
|
|
|
-- don't omit frame pointers (for now), because performance will be impacted
|
|
|
|
-- negatively by the way this breaks profilers more than it will be impacted
|
|
|
|
-- positively by the optimisation
|
|
|
|
"-fno-omit-frame-pointer",
|
2007-01-02 19:11:00 +01:00
|
|
|
})
|
2009-07-28 19:01:30 +02:00
|
|
|
if OS == "linux" then
|
|
|
|
tinsert(package.linkoptions, {
|
|
|
|
"-Wl,--no-undefined",
|
2009-08-06 21:41:18 +02:00
|
|
|
"-Wl,--as-needed",
|
2009-07-28 19:01:30 +02:00
|
|
|
})
|
|
|
|
end
|
2009-11-16 22:23:43 +01:00
|
|
|
if options["coverage"] then
|
|
|
|
tinsert(package.buildoptions, {"-fprofile-arcs", "-ftest-coverage"})
|
|
|
|
tinsert(package.links, "gcov")
|
|
|
|
end
|
2007-01-02 19:11:00 +01:00
|
|
|
end
|
2007-01-26 19:26:45 +01:00
|
|
|
|
2010-03-21 19:40:22 +01:00
|
|
|
if OS == "linux" then
|
|
|
|
-- To use our local SpiderMonkey library, it needs to be part of the runtime dynamic linker
|
|
|
|
-- path. So add the executable path with -rpath:
|
|
|
|
-- (TODO: is this a sane way to do it?)
|
|
|
|
tinsert(package.linkoptions, {"-Wl,-rpath='$$ORIGIN'"}) -- use Makefile escaping of '$'
|
|
|
|
end
|
2009-12-28 17:45:42 +01:00
|
|
|
|
2007-01-26 19:26:45 +01:00
|
|
|
tinsert(package.buildoptions, {
|
|
|
|
-- Hide symbols in dynamic shared objects by default, for efficiency and for equivalence with
|
|
|
|
-- Windows - they should be exported explicitly with __attribute__ ((visibility ("default")))
|
2009-06-26 23:09:56 +02:00
|
|
|
"-fvisibility=hidden",
|
2007-01-26 19:26:45 +01:00
|
|
|
})
|
|
|
|
|
2010-03-31 22:40:45 +02:00
|
|
|
-- X11 includes may be installed in one of a gadzillion of three places
|
|
|
|
-- Famous last words: "You can't include too much! ;-)"
|
|
|
|
package.includepaths = {
|
|
|
|
"/usr/X11R6/include/X11",
|
|
|
|
"/usr/X11R6/include",
|
|
|
|
"/usr/include/X11"
|
|
|
|
}
|
|
|
|
package.libpaths = {
|
|
|
|
"/usr/X11R6/lib"
|
|
|
|
}
|
|
|
|
|
2007-06-05 20:16:55 +02:00
|
|
|
if OS == "linux" and options["icc"] then
|
2010-03-31 22:40:45 +02:00
|
|
|
tinsert(package.libpaths, "/usr/i686-pc-linux-gnu/lib") -- needed for ICC to find libbfd
|
2007-05-17 05:37:49 +02:00
|
|
|
end
|
2007-09-03 14:56:45 +02:00
|
|
|
|
2006-06-02 06:07:18 +02:00
|
|
|
package.defines = {
|
2007-02-25 22:11:57 +01:00
|
|
|
-- "CONFIG_USE_MMGR",
|
2006-06-02 06:07:18 +02:00
|
|
|
}
|
2009-03-24 22:40:10 +01:00
|
|
|
if use_dcdt then
|
|
|
|
tinsert(package.defines, "USE_DCDT")
|
|
|
|
end
|
2006-06-02 06:07:18 +02:00
|
|
|
end
|
2006-06-07 03:40:24 +02:00
|
|
|
end
|
|
|
|
|
2006-06-07 06:34:48 +02:00
|
|
|
|
2006-06-07 03:40:24 +02:00
|
|
|
-- create a package and set the attributes that are common to all packages.
|
|
|
|
function package_create(package_name, target_type)
|
|
|
|
|
|
|
|
-- Note: don't store in local variable. A global variable needs to
|
|
|
|
-- be set for Premake's use; it is implicitly used in e.g. matchfiles()
|
|
|
|
package = newpackage()
|
|
|
|
package.path = project.path
|
|
|
|
package.language = "c++"
|
|
|
|
package.name = package_name
|
|
|
|
package.kind = target_type
|
|
|
|
|
2006-11-12 04:39:40 +01:00
|
|
|
package.includepaths = {}
|
|
|
|
|
2006-06-07 03:40:24 +02:00
|
|
|
package_set_target(package_name)
|
|
|
|
package_set_build_flags()
|
2006-06-02 06:07:18 +02:00
|
|
|
|
2006-04-20 03:20:24 +02:00
|
|
|
return package
|
2005-09-13 05:51:48 +02:00
|
|
|
end
|
|
|
|
|
2005-10-17 03:11:12 +02:00
|
|
|
|
2006-06-23 19:41:55 +02:00
|
|
|
-- extra_params: table including zero or more of the following:
|
|
|
|
-- * no_default_pch: (any type) prevents adding the PCH include dir.
|
|
|
|
-- see setup_static_lib_package() for explanation of this scheme and rationale.
|
|
|
|
-- * extra_files: table of filenames (relative to source_root) to add to project
|
|
|
|
-- * extra_links: table of library names to add to link step
|
2006-06-07 03:40:24 +02:00
|
|
|
function package_add_contents(source_root, rel_source_dirs, rel_include_dirs, extra_params)
|
2004-12-28 00:27:26 +01:00
|
|
|
|
2006-06-02 06:07:18 +02:00
|
|
|
-- We don't want the VC project to be deeply nested (once for each
|
|
|
|
-- folder in source_root). Therefore, remove the source_root
|
|
|
|
-- directory from the filenames (where those
|
|
|
|
-- names are used by Premake to construct the project tree), but set
|
|
|
|
-- 'trimprefix' (with Premake altered to recognise that) so the project
|
|
|
|
-- will still point to the correct filenames.
|
|
|
|
package.trimprefix = source_root
|
|
|
|
package.files = sourcesfromdirs(source_root, rel_source_dirs)
|
|
|
|
|
2006-06-03 07:08:32 +02:00
|
|
|
-- Put the project-specific PCH directory at the start of the
|
|
|
|
-- include path, so '#include "precompiled.h"' will look in
|
|
|
|
-- there first
|
|
|
|
if not extra_params["no_default_pch"] then
|
2006-06-07 03:40:24 +02:00
|
|
|
tinsert(package.includepaths, source_root .. "pch/" .. package.name)
|
2006-06-03 07:08:32 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
-- next is source root dir, for absolute (nonrelative) includes
|
|
|
|
-- (e.g. "lib/precompiled.h")
|
2006-06-07 03:40:24 +02:00
|
|
|
tinsert(package.includepaths, source_root)
|
2006-06-03 07:08:32 +02:00
|
|
|
|
2009-07-21 19:38:27 +02:00
|
|
|
for i,v in pairs(rel_include_dirs) do
|
2006-06-07 03:40:24 +02:00
|
|
|
tinsert(package.includepaths, source_root .. v)
|
2006-06-02 06:07:18 +02:00
|
|
|
end
|
2004-12-28 00:27:26 +01:00
|
|
|
|
2006-06-07 03:40:24 +02:00
|
|
|
|
|
|
|
if extra_params["extra_files"] then
|
2009-07-21 19:38:27 +02:00
|
|
|
for i,v in pairs(extra_params["extra_files"]) do
|
2006-06-07 03:40:24 +02:00
|
|
|
tinsert(package.files, source_root .. v)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
if extra_params["extra_links"] then
|
|
|
|
listconcat(package.links, extra_params["extra_links"])
|
2006-06-02 06:07:18 +02:00
|
|
|
end
|
2004-12-28 00:27:26 +01:00
|
|
|
|
2006-06-02 06:07:18 +02:00
|
|
|
end
|
2005-07-02 23:42:55 +02:00
|
|
|
|
2006-11-12 20:46:47 +01:00
|
|
|
-- Detect and set up PCH for the current package
|
|
|
|
function package_setup_pch(pch_dir, header, source)
|
|
|
|
if OS == "windows" or not options["without-pch"] then
|
|
|
|
package.pchheader = header -- "precompiled.h"
|
|
|
|
package.pchsource = source -- "precompiled.cpp"
|
|
|
|
if pch_dir then
|
|
|
|
tinsert(package.files, {
|
|
|
|
pch_dir..header,
|
|
|
|
pch_dir..source
|
|
|
|
})
|
|
|
|
end
|
2009-07-21 19:38:27 +02:00
|
|
|
for i,v in pairs(project.configs) do
|
2006-12-09 15:39:52 +01:00
|
|
|
tinsert(package.config[v].defines, "USING_PCH")
|
2006-11-12 20:46:47 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2004-12-28 00:27:26 +01:00
|
|
|
|
2006-06-02 06:07:18 +02:00
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
-- engine static libraries
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
-- the engine is split up into several static libraries. this eases separate
|
2006-06-07 03:40:24 +02:00
|
|
|
-- distribution of those components, reduces dependencies a bit, and can
|
2006-06-02 06:07:18 +02:00
|
|
|
-- also speed up builds.
|
2006-06-07 06:34:48 +02:00
|
|
|
-- more to the point, it is necessary to efficiently support a separate
|
|
|
|
-- test executable that also includes much of the game code.
|
2006-06-02 06:07:18 +02:00
|
|
|
|
2006-06-23 19:41:55 +02:00
|
|
|
-- names of all static libs created. automatically added to the
|
|
|
|
-- main app project later (see explanation at end of this file)
|
2006-06-07 03:40:24 +02:00
|
|
|
static_lib_names = {}
|
|
|
|
|
2006-06-23 19:41:55 +02:00
|
|
|
-- set up one of the static libraries into which the main engine code is split.
|
|
|
|
-- extra_params: see package_add_contents().
|
2006-06-02 06:07:18 +02:00
|
|
|
-- note: rel_source_dirs and rel_include_dirs are relative to global source_root.
|
2006-12-06 01:06:05 +01:00
|
|
|
function setup_static_lib_package (package_name, rel_source_dirs, extern_libs, extra_params)
|
2006-06-02 06:07:18 +02:00
|
|
|
|
2006-06-07 03:40:24 +02:00
|
|
|
package_create(package_name, "lib")
|
|
|
|
package_add_contents(source_root, rel_source_dirs, {}, extra_params)
|
|
|
|
package_add_extern_libs(extern_libs)
|
|
|
|
|
2009-08-07 17:21:39 +02:00
|
|
|
if not extra_params["no_default_link"] then
|
|
|
|
tinsert(static_lib_names, package_name)
|
|
|
|
end
|
2006-06-03 07:08:32 +02:00
|
|
|
|
2007-06-09 04:40:48 +02:00
|
|
|
if OS == "windows" then
|
|
|
|
tinsert(package.buildflags, "no-rtti")
|
|
|
|
end
|
|
|
|
|
2006-11-12 20:46:47 +01:00
|
|
|
-- Precompiled Headers
|
|
|
|
-- rationale: we need one PCH per static lib, since one global header would
|
|
|
|
-- increase dependencies. To that end, we can either include them as
|
|
|
|
-- "packagedir/precompiled.h", or add "source/PCH/packagedir" to the
|
|
|
|
-- include path and put the PCH there. The latter is better because
|
|
|
|
-- many packages contain several dirs and it's unclear where there the
|
|
|
|
-- PCH should be stored. This way is also a bit easier to use in that
|
|
|
|
-- source files always include "precompiled.h".
|
|
|
|
-- Notes:
|
|
|
|
-- * Visual Assist manages to use the project include path and can
|
|
|
|
-- correctly open these files from the IDE.
|
|
|
|
-- * precompiled.cpp (needed to "Create" the PCH) also goes in
|
|
|
|
-- the abovementioned dir.
|
2009-08-07 17:21:39 +02:00
|
|
|
if not extra_params["no_default_pch"] then
|
|
|
|
pch_dir = source_root.."pch/"..package_name.."/"
|
|
|
|
package_setup_pch(pch_dir, "precompiled.h", "precompiled.cpp")
|
|
|
|
end
|
2006-06-02 06:07:18 +02:00
|
|
|
end
|
2005-07-02 23:42:55 +02:00
|
|
|
|
2006-06-02 06:07:18 +02:00
|
|
|
-- this is where the source tree is chopped up into static libs.
|
2006-06-07 03:40:24 +02:00
|
|
|
-- can be changed very easily; just copy+paste a new setup_static_lib_package,
|
|
|
|
-- or remove existing ones. static libs are automagically added to
|
|
|
|
-- main_exe link step.
|
2006-06-02 06:07:18 +02:00
|
|
|
function setup_all_libs ()
|
2006-06-07 03:40:24 +02:00
|
|
|
|
2006-06-02 06:07:18 +02:00
|
|
|
-- relative to global source_root.
|
|
|
|
local source_dirs = {}
|
|
|
|
-- names of external libraries used (see libraries_dir comment)
|
|
|
|
local extern_libs = {}
|
2004-12-28 00:27:26 +01:00
|
|
|
|
2007-10-09 09:27:45 +02:00
|
|
|
|
2006-08-26 22:26:17 +02:00
|
|
|
source_dirs = {
|
|
|
|
"network",
|
|
|
|
}
|
|
|
|
extern_libs = {
|
|
|
|
"spidermonkey",
|
2008-05-31 22:00:37 +02:00
|
|
|
"enet",
|
2006-08-26 22:26:17 +02:00
|
|
|
"boost", -- dragged in via server->simulation.h->random
|
|
|
|
}
|
|
|
|
setup_static_lib_package("network", source_dirs, extern_libs, {})
|
|
|
|
|
2010-01-09 20:20:14 +01:00
|
|
|
|
|
|
|
source_dirs = {
|
|
|
|
"simulation2",
|
|
|
|
"simulation2/components",
|
|
|
|
"simulation2/helpers",
|
|
|
|
"simulation2/scripting",
|
|
|
|
"simulation2/serialization",
|
|
|
|
"simulation2/system",
|
|
|
|
"simulation2/testcomponents",
|
|
|
|
}
|
|
|
|
extern_libs = {
|
|
|
|
"boost",
|
|
|
|
"spidermonkey",
|
|
|
|
}
|
|
|
|
setup_static_lib_package("simulation2", source_dirs, extern_libs, {})
|
|
|
|
|
|
|
|
|
|
|
|
source_dirs = {
|
|
|
|
"scriptinterface",
|
|
|
|
}
|
|
|
|
extern_libs = {
|
|
|
|
"boost",
|
|
|
|
"spidermonkey",
|
2010-03-26 11:31:47 +01:00
|
|
|
"valgrind",
|
2010-01-09 20:20:14 +01:00
|
|
|
}
|
|
|
|
setup_static_lib_package("scriptinterface", source_dirs, extern_libs, {})
|
|
|
|
|
|
|
|
|
2005-08-13 19:07:05 +02:00
|
|
|
source_dirs = {
|
2004-12-05 18:59:29 +01:00
|
|
|
"ps",
|
|
|
|
"ps/scripting",
|
|
|
|
"ps/Network",
|
2005-08-15 01:50:37 +02:00
|
|
|
"ps/GameSetup",
|
|
|
|
"ps/XML",
|
2004-12-05 18:59:29 +01:00
|
|
|
"simulation",
|
|
|
|
"simulation/scripting",
|
2006-06-02 06:07:18 +02:00
|
|
|
"sound",
|
|
|
|
"scripting",
|
|
|
|
"maths",
|
2008-05-31 22:00:37 +02:00
|
|
|
"maths/scripting",
|
2006-06-02 06:07:18 +02:00
|
|
|
}
|
2009-03-24 22:40:10 +01:00
|
|
|
if use_dcdt then
|
|
|
|
tinsert(source_dirs, "dcdt/se")
|
|
|
|
end
|
2006-06-02 06:07:18 +02:00
|
|
|
extern_libs = {
|
|
|
|
"spidermonkey",
|
2006-06-23 19:41:55 +02:00
|
|
|
"sdl", -- key definitions
|
2009-03-24 01:55:35 +01:00
|
|
|
"libxml2",
|
2006-06-07 03:40:24 +02:00
|
|
|
"opengl",
|
2006-06-02 06:07:18 +02:00
|
|
|
"zlib",
|
2008-05-31 22:00:37 +02:00
|
|
|
"boost",
|
|
|
|
"enet",
|
2006-06-02 06:07:18 +02:00
|
|
|
}
|
|
|
|
setup_static_lib_package("engine", source_dirs, extern_libs, {})
|
2004-11-15 14:38:07 +01:00
|
|
|
|
|
|
|
|
2006-06-02 06:07:18 +02:00
|
|
|
source_dirs = {
|
2004-12-05 18:59:29 +01:00
|
|
|
"graphics",
|
|
|
|
"graphics/scripting",
|
2006-06-02 06:07:18 +02:00
|
|
|
"renderer"
|
|
|
|
}
|
|
|
|
extern_libs = {
|
2006-06-07 03:40:24 +02:00
|
|
|
"opengl",
|
2006-06-23 19:41:55 +02:00
|
|
|
"sdl", -- key definitions
|
2006-06-02 06:07:18 +02:00
|
|
|
"spidermonkey", -- for graphics/scripting
|
|
|
|
"boost"
|
|
|
|
}
|
|
|
|
setup_static_lib_package("graphics", source_dirs, extern_libs, {})
|
2004-11-15 14:38:07 +01:00
|
|
|
|
|
|
|
|
2006-06-02 06:07:18 +02:00
|
|
|
-- internationalization = i18n
|
|
|
|
-- note: this package isn't large, but is separate because it may be
|
|
|
|
-- useful for other projects.
|
|
|
|
source_dirs = {
|
|
|
|
"i18n"
|
|
|
|
}
|
|
|
|
extern_libs = {
|
2007-02-01 02:34:17 +01:00
|
|
|
"spidermonkey",
|
|
|
|
"boost"
|
2006-06-02 06:07:18 +02:00
|
|
|
}
|
|
|
|
setup_static_lib_package("i18n", source_dirs, extern_libs, {})
|
2005-07-02 23:42:55 +02:00
|
|
|
|
2005-09-14 07:37:52 +02:00
|
|
|
|
2006-06-02 06:07:18 +02:00
|
|
|
source_dirs = {
|
2005-09-14 07:37:52 +02:00
|
|
|
"tools/atlas/GameInterface",
|
|
|
|
"tools/atlas/GameInterface/Handlers"
|
2006-04-20 03:20:24 +02:00
|
|
|
}
|
2006-06-02 06:07:18 +02:00
|
|
|
extern_libs = {
|
|
|
|
"boost",
|
2006-06-23 19:41:55 +02:00
|
|
|
"sdl", -- key definitions
|
2006-06-07 03:40:24 +02:00
|
|
|
"opengl",
|
2006-06-02 06:07:18 +02:00
|
|
|
"spidermonkey"
|
|
|
|
}
|
|
|
|
setup_static_lib_package("atlas", source_dirs, extern_libs, {})
|
2004-07-27 02:47:15 +02:00
|
|
|
|
2005-07-02 23:42:55 +02:00
|
|
|
|
2006-06-02 06:07:18 +02:00
|
|
|
source_dirs = {
|
|
|
|
"gui",
|
|
|
|
"gui/scripting"
|
|
|
|
}
|
2009-10-04 13:49:07 +02:00
|
|
|
if OS == "windows" then -- add JS files to allow VS find-in-solution and VA open-file-in-workspace
|
|
|
|
tinsert(source_dirs, "../binaries/data/mods/public/gui/test")
|
|
|
|
end
|
2006-06-02 06:07:18 +02:00
|
|
|
extern_libs = {
|
|
|
|
"spidermonkey",
|
2006-06-23 19:41:55 +02:00
|
|
|
"sdl", -- key definitions
|
2006-06-07 03:40:24 +02:00
|
|
|
"opengl",
|
2006-06-02 06:07:18 +02:00
|
|
|
"boost"
|
|
|
|
}
|
|
|
|
setup_static_lib_package("gui", source_dirs, extern_libs, {})
|
2005-07-02 23:42:55 +02:00
|
|
|
|
2006-06-02 06:07:18 +02:00
|
|
|
|
|
|
|
source_dirs = {
|
2004-12-28 00:27:26 +01:00
|
|
|
"lib",
|
2007-11-10 14:55:32 +01:00
|
|
|
"lib/allocators",
|
2007-12-29 17:20:23 +01:00
|
|
|
"lib/external_libraries",
|
2007-12-20 21:22:01 +01:00
|
|
|
"lib/file",
|
|
|
|
"lib/file/archive",
|
|
|
|
"lib/file/common",
|
|
|
|
"lib/file/io",
|
|
|
|
"lib/file/vfs",
|
2007-12-29 17:20:23 +01:00
|
|
|
"lib/posix",
|
2006-06-02 06:07:18 +02:00
|
|
|
"lib/res",
|
|
|
|
"lib/res/graphics",
|
2007-05-05 19:36:24 +02:00
|
|
|
"lib/res/sound",
|
2007-12-29 17:20:23 +01:00
|
|
|
"lib/sysdep",
|
|
|
|
"lib/tex"
|
2004-11-29 05:22:37 +01:00
|
|
|
}
|
2006-06-02 06:07:18 +02:00
|
|
|
extern_libs = {
|
2007-02-01 02:34:17 +01:00
|
|
|
"boost",
|
2006-06-23 19:41:55 +02:00
|
|
|
"sdl",
|
2006-06-07 03:40:24 +02:00
|
|
|
"opengl",
|
2006-06-02 06:07:18 +02:00
|
|
|
"libpng",
|
|
|
|
"zlib",
|
|
|
|
"openal",
|
|
|
|
"vorbis",
|
|
|
|
"libjpg",
|
2009-08-07 17:21:39 +02:00
|
|
|
"valgrind",
|
|
|
|
"cxxtest",
|
2006-06-02 06:07:18 +02:00
|
|
|
}
|
2008-06-29 12:30:33 +02:00
|
|
|
|
2008-06-30 19:34:18 +02:00
|
|
|
-- CPU architecture-specific
|
|
|
|
if arch == "amd64" then
|
|
|
|
tinsert(source_dirs, "lib/sysdep/arch/amd64");
|
|
|
|
tinsert(source_dirs, "lib/sysdep/arch/x86_x64");
|
|
|
|
else
|
|
|
|
tinsert(source_dirs, "lib/sysdep/arch/ia32");
|
|
|
|
tinsert(source_dirs, "lib/sysdep/arch/x86_x64");
|
|
|
|
end
|
|
|
|
|
2008-06-29 12:30:33 +02:00
|
|
|
-- OS-specific
|
2006-11-12 04:39:40 +01:00
|
|
|
sysdep_dirs = {
|
2008-06-30 19:34:18 +02:00
|
|
|
linux = { "lib/sysdep/os/linux", "lib/sysdep/os/unix", "lib/sysdep/os/unix/x" },
|
2006-06-02 06:07:18 +02:00
|
|
|
-- note: RC file must be added to main_exe package.
|
2008-06-30 20:19:14 +02:00
|
|
|
-- note: don't add "lib/sysdep/os/win/aken.cpp" because that must be compiled with the DDK.
|
2008-06-30 19:34:18 +02:00
|
|
|
windows = { "lib/sysdep/os/win", "lib/sysdep/os/win/wposix", "lib/sysdep/os/win/whrt" },
|
|
|
|
macosx = { "lib/sysdep/os/osx", "lib/sysdep/os/unix" },
|
2006-11-12 04:39:40 +01:00
|
|
|
}
|
2009-07-21 19:38:27 +02:00
|
|
|
for i,v in pairs(sysdep_dirs[OS]) do
|
2007-09-03 14:56:45 +02:00
|
|
|
tinsert(source_dirs, v);
|
|
|
|
end
|
2008-06-29 12:30:33 +02:00
|
|
|
|
|
|
|
-- runtime-library-specific
|
2008-07-01 22:18:05 +02:00
|
|
|
if options["target"] == "gnu" then
|
2008-06-29 12:30:33 +02:00
|
|
|
tinsert(source_dirs, "lib/sysdep/rtl/gcc");
|
|
|
|
else
|
|
|
|
tinsert(source_dirs, "lib/sysdep/rtl/msc");
|
|
|
|
end
|
|
|
|
|
2007-09-03 14:56:45 +02:00
|
|
|
setup_static_lib_package("lowlevel", source_dirs, extern_libs, {})
|
2009-08-07 17:21:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
-- CxxTest mock function support
|
|
|
|
extern_libs = {
|
2009-08-07 19:43:44 +02:00
|
|
|
"boost",
|
2009-08-07 17:21:39 +02:00
|
|
|
"cxxtest",
|
|
|
|
}
|
|
|
|
-- 'real' implementations, to be linked against the main executable
|
|
|
|
setup_static_lib_package("mocks_real", {}, extern_libs, { no_default_link = 1, no_default_pch = 1 })
|
|
|
|
listconcat(package.files, matchfiles(source_root.."mocks/*.h", source_root.."mocks/*_real.cpp"))
|
|
|
|
-- 'test' implementations, to be linked against the test executable
|
|
|
|
setup_static_lib_package("mocks_test", {}, extern_libs, { no_default_link = 1, no_default_pch = 1 })
|
|
|
|
listconcat(package.files, matchfiles(source_root.."mocks/*.h", source_root.."mocks/*_test.cpp"))
|
2006-06-02 06:07:18 +02:00
|
|
|
end
|
2005-07-02 23:42:55 +02:00
|
|
|
|
|
|
|
|
2006-06-07 03:40:24 +02:00
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
-- main EXE
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
2006-06-07 06:34:48 +02:00
|
|
|
-- used for main EXE as well as test
|
2006-06-07 16:22:26 +02:00
|
|
|
used_extern_libs = {
|
2006-06-07 05:02:20 +02:00
|
|
|
"opengl",
|
|
|
|
"sdl",
|
|
|
|
|
|
|
|
"libjpg",
|
|
|
|
"libpng",
|
|
|
|
"zlib",
|
|
|
|
|
|
|
|
"spidermonkey",
|
2009-03-23 02:07:08 +01:00
|
|
|
"libxml2",
|
2006-06-07 05:02:20 +02:00
|
|
|
|
|
|
|
"openal",
|
|
|
|
"vorbis",
|
|
|
|
|
|
|
|
"boost",
|
|
|
|
"cxxtest",
|
2008-05-31 22:00:37 +02:00
|
|
|
"comsuppw",
|
2009-03-23 02:07:08 +01:00
|
|
|
"enet",
|
2006-06-07 05:02:20 +02:00
|
|
|
}
|
|
|
|
|
2006-06-02 06:07:18 +02:00
|
|
|
-- Bundles static libs together with main.cpp and builds game executable.
|
|
|
|
function setup_main_exe ()
|
2006-04-25 07:10:47 +02:00
|
|
|
|
2006-06-07 03:40:24 +02:00
|
|
|
package_create("pyrogenesis", "winexe")
|
2005-05-31 21:02:38 +02:00
|
|
|
|
2006-06-03 07:08:32 +02:00
|
|
|
-- For VS2005, tell the linker to use the libraries' .obj files instead of
|
|
|
|
-- the .lib, to allow incremental linking.
|
|
|
|
-- (Reduces re-link time from ~20 seconds to ~2 secs)
|
2006-06-07 03:40:24 +02:00
|
|
|
tinsert(package.buildflags, "use-library-dep-inputs")
|
2006-06-03 07:08:32 +02:00
|
|
|
|
2006-06-07 03:40:24 +02:00
|
|
|
local extra_params = {
|
|
|
|
extra_files = { "main.cpp" },
|
2006-06-02 06:07:18 +02:00
|
|
|
}
|
2006-06-07 03:40:24 +02:00
|
|
|
package_add_contents(source_root, {}, {}, extra_params)
|
2005-07-02 23:42:55 +02:00
|
|
|
|
2006-06-07 16:22:26 +02:00
|
|
|
package_add_extern_libs(used_extern_libs)
|
2006-06-07 03:40:24 +02:00
|
|
|
|
2009-08-07 17:21:39 +02:00
|
|
|
tinsert(package.links, "mocks_real")
|
2006-06-07 03:40:24 +02:00
|
|
|
|
|
|
|
-- Platform Specifics
|
|
|
|
if OS == "windows" then
|
2006-06-07 16:22:26 +02:00
|
|
|
|
2008-06-30 20:19:14 +02:00
|
|
|
tinsert(package.files, source_root.."lib/sysdep/os/win/icon.rc")
|
2006-06-07 16:22:26 +02:00
|
|
|
-- from "lowlevel" static lib; must be added here to be linked in
|
2008-06-30 20:19:14 +02:00
|
|
|
tinsert(package.files, source_root.."lib/sysdep/os/win/error_dialog.rc")
|
2005-07-02 23:42:55 +02:00
|
|
|
|
2006-04-25 07:10:47 +02:00
|
|
|
-- VS2005 generates its own manifest, but earlier ones need us to add it manually
|
|
|
|
if (options["target"] == "vs2002" or options["target"] == "vs2003") then
|
2008-06-30 20:19:14 +02:00
|
|
|
tinsert(package.files, source_root.."lib/sysdep/os/win/manifest.rc")
|
2006-04-25 07:10:47 +02:00
|
|
|
end
|
|
|
|
|
2007-06-09 04:40:48 +02:00
|
|
|
tinsert(package.buildflags, "no-rtti")
|
|
|
|
|
2006-06-07 16:22:26 +02:00
|
|
|
package.linkoptions = {
|
2007-06-08 19:44:24 +02:00
|
|
|
-- wraps main thread in a __try block(see wseh.cpp). replace with mainCRTStartup if that's undesired.
|
|
|
|
"/ENTRY:wseh_EntryPoint",
|
2006-06-07 16:22:26 +02:00
|
|
|
|
2007-06-07 21:32:13 +02:00
|
|
|
-- see wstartup.h
|
|
|
|
"/INCLUDE:_wstartup_InitAndRegisterShutdown",
|
|
|
|
|
2006-06-07 16:22:26 +02:00
|
|
|
-- delay loading of various Windows DLLs (not specific to any of the
|
2006-12-01 21:34:28 +01:00
|
|
|
-- external libraries; those are handled separately)
|
2004-12-28 00:27:26 +01:00
|
|
|
"/DELAYLOAD:ws2_32.dll",
|
2007-05-26 19:17:47 +02:00
|
|
|
|
2006-06-07 16:22:26 +02:00
|
|
|
-- allow manual unload of delay-loaded DLLs
|
|
|
|
"/DELAY:UNLOAD"
|
2004-12-28 00:27:26 +01:00
|
|
|
}
|
2005-07-02 23:42:55 +02:00
|
|
|
|
2006-09-04 18:33:47 +02:00
|
|
|
elseif OS == "linux" then
|
2005-07-02 23:42:55 +02:00
|
|
|
|
2004-12-28 00:27:26 +01:00
|
|
|
-- Libraries
|
2006-06-07 03:40:24 +02:00
|
|
|
tinsert(package.links, {
|
2004-12-28 00:27:26 +01:00
|
|
|
"fam",
|
|
|
|
-- Utilities
|
2009-11-13 21:24:21 +01:00
|
|
|
"rt",
|
2005-09-13 02:16:47 +02:00
|
|
|
-- Debugging
|
2009-03-24 01:55:35 +01:00
|
|
|
"bfd", "iberty",
|
|
|
|
-- Dynamic libraries (needed for linking for gold)
|
|
|
|
"dl",
|
2006-06-02 06:07:18 +02:00
|
|
|
})
|
2009-11-13 21:24:21 +01:00
|
|
|
|
|
|
|
-- Threading support
|
|
|
|
tinsert(package.buildoptions, "-pthread")
|
|
|
|
tinsert(package.linkoptions, "-pthread")
|
2006-09-04 18:33:47 +02:00
|
|
|
|
2006-11-12 20:46:47 +01:00
|
|
|
-- For debug_resolve_symbol
|
2005-09-13 02:16:47 +02:00
|
|
|
package.config["Debug"].linkoptions = { "-rdynamic" }
|
|
|
|
package.config["Testing"].linkoptions = { "-rdynamic" }
|
2006-09-04 18:33:47 +02:00
|
|
|
elseif OS == "macosx" then
|
|
|
|
-- Libraries
|
|
|
|
tinsert(package.links, { -- Utilities
|
|
|
|
"pthread"
|
|
|
|
})
|
2004-12-28 00:27:26 +01:00
|
|
|
end
|
2004-06-02 12:47:27 +02:00
|
|
|
end
|
2004-12-28 00:27:26 +01:00
|
|
|
|
2005-10-17 03:11:12 +02:00
|
|
|
|
2006-06-07 05:02:20 +02:00
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
-- atlas
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
2006-06-07 06:34:48 +02:00
|
|
|
-- setup a typical Atlas component package
|
2006-06-23 19:41:55 +02:00
|
|
|
-- extra_params: as in package_add_contents; also zero or more of the following:
|
2007-06-05 20:35:05 +02:00
|
|
|
-- * pch: (any type) set precompiled.h and .cpp as PCH
|
2006-12-06 01:06:05 +01:00
|
|
|
function setup_atlas_package(package_name, target_type, rel_source_dirs, rel_include_dirs, extern_libs, extra_params)
|
2005-10-17 03:11:12 +02:00
|
|
|
|
2006-06-03 07:08:32 +02:00
|
|
|
local source_root = "../../../source/tools/atlas/" .. package_name .. "/"
|
2006-06-07 03:40:24 +02:00
|
|
|
package_create(package_name, target_type)
|
2006-06-03 07:08:32 +02:00
|
|
|
|
|
|
|
-- Don't add the default 'sourceroot/pch/projectname' for finding PCH files
|
2006-06-23 19:41:55 +02:00
|
|
|
extra_params["no_default_pch"] = 1
|
2006-06-03 07:08:32 +02:00
|
|
|
|
2006-06-23 19:41:55 +02:00
|
|
|
package_add_contents(source_root, rel_source_dirs, rel_include_dirs, extra_params)
|
2006-06-07 03:40:24 +02:00
|
|
|
package_add_extern_libs(extern_libs)
|
2005-10-17 03:11:12 +02:00
|
|
|
|
2006-11-12 20:46:47 +01:00
|
|
|
if extra_params["pch"] then
|
2007-06-05 20:35:05 +02:00
|
|
|
package_setup_pch(nil, "precompiled.h", "precompiled.cpp");
|
2006-11-12 20:46:47 +01:00
|
|
|
end
|
|
|
|
|
2009-03-22 21:51:35 +01:00
|
|
|
if options["aoe3ed"] then
|
|
|
|
tinsert(package.defines, "USE_AOE3ED")
|
|
|
|
end
|
|
|
|
|
2005-10-17 03:11:12 +02:00
|
|
|
-- Platform Specifics
|
2006-06-02 06:07:18 +02:00
|
|
|
if OS == "windows" then
|
2005-10-17 03:11:12 +02:00
|
|
|
|
2006-06-07 03:40:24 +02:00
|
|
|
tinsert(package.defines, "_UNICODE")
|
2005-10-17 03:11:12 +02:00
|
|
|
|
2006-04-25 07:10:47 +02:00
|
|
|
-- Link to required libraries
|
2007-06-09 04:40:48 +02:00
|
|
|
package.links = { "winmm", "comctl32", "rpcrt4", "delayimp", "ws2_32" }
|
2005-10-17 03:11:12 +02:00
|
|
|
|
|
|
|
-- required to use WinMain() on Windows, otherwise will default to main()
|
2006-06-07 03:40:24 +02:00
|
|
|
tinsert(package.buildflags, "no-main")
|
2005-10-17 03:11:12 +02:00
|
|
|
|
2006-07-12 16:49:10 +02:00
|
|
|
if extra_params["extra_links"] then
|
|
|
|
listconcat(package.links, extra_params["extra_links"])
|
|
|
|
end
|
|
|
|
|
2007-09-03 14:56:45 +02:00
|
|
|
elseif OS == "linux" then
|
2006-11-12 04:39:40 +01:00
|
|
|
tinsert(package.buildoptions, "-rdynamic")
|
2009-07-11 17:29:05 +02:00
|
|
|
tinsert(package.buildoptions, "-fPIC")
|
2009-08-06 21:41:18 +02:00
|
|
|
tinsert(package.linkoptions, "-fPIC")
|
2006-11-12 04:39:40 +01:00
|
|
|
tinsert(package.linkoptions, "-rdynamic")
|
2007-06-05 20:16:55 +02:00
|
|
|
|
|
|
|
if extra_params["no_unused_warnings"] then
|
|
|
|
if not options["icc"] then
|
|
|
|
tinsert(package.buildoptions, "-Wno-unused-parameter")
|
|
|
|
end
|
|
|
|
end
|
2005-10-17 03:11:12 +02:00
|
|
|
end
|
2006-04-25 07:10:47 +02:00
|
|
|
|
2005-10-17 03:11:12 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
|
2006-06-07 06:34:48 +02:00
|
|
|
-- build all Atlas component packages
|
|
|
|
function setup_atlas_packages()
|
2005-10-17 03:11:12 +02:00
|
|
|
|
2006-06-07 06:34:48 +02:00
|
|
|
setup_atlas_package("AtlasObject", "lib",
|
2006-06-03 07:08:32 +02:00
|
|
|
{ -- src
|
2006-04-20 03:20:24 +02:00
|
|
|
""
|
2006-06-03 07:08:32 +02:00
|
|
|
},{ -- include
|
|
|
|
},{ -- extern_libs
|
2009-03-22 21:51:35 +01:00
|
|
|
"libxml2",
|
2006-11-12 04:39:40 +01:00
|
|
|
"wxwidgets"
|
2006-06-23 19:41:55 +02:00
|
|
|
},{ -- extra_params
|
2005-10-17 03:11:12 +02:00
|
|
|
})
|
|
|
|
|
2007-06-05 20:16:55 +02:00
|
|
|
setup_atlas_package("AtlasScript", "lib",
|
|
|
|
{ -- src
|
|
|
|
""
|
|
|
|
},{ -- include
|
|
|
|
".."
|
|
|
|
},{ -- extern_libs
|
2007-06-09 04:40:48 +02:00
|
|
|
"boost",
|
2007-06-05 20:16:55 +02:00
|
|
|
"spidermonkey",
|
2010-03-26 11:31:47 +01:00
|
|
|
"valgrind",
|
|
|
|
"wxwidgets",
|
2007-06-05 20:16:55 +02:00
|
|
|
},{ -- extra_params
|
|
|
|
})
|
|
|
|
|
|
|
|
setup_atlas_package("wxJS", "lib",
|
|
|
|
{ -- src
|
|
|
|
"",
|
|
|
|
"common",
|
|
|
|
"ext",
|
|
|
|
"gui",
|
|
|
|
"gui/control",
|
|
|
|
"gui/event",
|
|
|
|
"gui/misc",
|
|
|
|
"io",
|
|
|
|
},{ -- include
|
|
|
|
},{ -- extern_libs
|
|
|
|
"spidermonkey",
|
|
|
|
"wxwidgets"
|
|
|
|
},{ -- extra_params
|
|
|
|
pch = (not has_broken_pch),
|
|
|
|
no_unused_warnings = 1, -- wxJS has far too many and we're never going to fix them, so just ignore them
|
|
|
|
})
|
|
|
|
|
2009-03-22 18:57:11 +01:00
|
|
|
atlas_src = {
|
2006-06-03 07:08:32 +02:00
|
|
|
"ActorEditor",
|
|
|
|
"ColourTester",
|
|
|
|
"CustomControls/Buttons",
|
# Added tool for viewing models and animations outside the game.
Atlas: Added ActorViewer. Moved GL canvas into separate class for shared
use. Disabled message-handling callback while blocked on the game, and
stopped creating dialog boxes inside the game thread in order to avoid
deadlocks (hopefully). Support multiple Views (for independent sets of
camera/update/render code). Recalculate territory boundaries when
necessary. Changed default list of animations to match those currently
used by actors.
# Tidied up more code.
Moved some more #includes out of .h files, to minimise unnecessary
compilation.
MathUtil: Deleted unused/unuseful macros (M_PI (use PI instead), M_PI_2
(use PI/2), MAX3, ABS (use abs)).
ObjectManager: Removed some ScEd-specific things.
Unit: Moved creation out of UnitManager, so units can be created without
adding to the manager. Changed CStr8 to the more conventional CStr.
app_hooks: Removed warning for setting multiple times.
win: Restored SEH catcher.
GameSetup, GameView: Removed RenderNoCull, because it doesn't seem to do
what it says it does ("force renderer to load everything") since we're
loading-on-demand most stuff and it doesn't seem especially useful since
we'd prefer to minimise loading times (but feel free to correct me if
I'm wrong). (And because it crashes when things need to be initialised
in a different order, so it's easier to remove than to understand and
fix it.)
PatchRData, Renderer: Work sensibly when there's no game (hence no LOS
manager, water, etc).
LOSManager: Use entity position instead of actor position when possible.
TerritoryManager: Allow delayed recalculations (so Atlas can issue lots
of move+recalculate commands per frame).
Cinematic: Non-pointer wxTimer, so it doesn't leak and doesn't have to
be deleted manually.
This was SVN commit r4261.
2006-08-28 19:36:42 +02:00
|
|
|
"CustomControls/Canvas",
|
2006-07-12 16:49:10 +02:00
|
|
|
"CustomControls/ColourDialog",
|
2006-06-03 07:08:32 +02:00
|
|
|
"CustomControls/DraggableListCtrl",
|
|
|
|
"CustomControls/EditableListCtrl",
|
|
|
|
"CustomControls/FileHistory",
|
|
|
|
"CustomControls/HighResTimer",
|
|
|
|
"CustomControls/SnapSplitterWindow",
|
|
|
|
"CustomControls/VirtualDirTreeCtrl",
|
|
|
|
"CustomControls/Windows",
|
2007-05-05 19:36:24 +02:00
|
|
|
"ErrorReporter",
|
2006-06-03 07:08:32 +02:00
|
|
|
"General",
|
2006-12-05 03:35:00 +01:00
|
|
|
"General/VideoRecorder",
|
2006-06-03 07:08:32 +02:00
|
|
|
"Misc",
|
|
|
|
"ScenarioEditor",
|
|
|
|
"ScenarioEditor/Sections/Common",
|
2006-07-12 16:49:10 +02:00
|
|
|
"ScenarioEditor/Sections/Cinematic",
|
2006-06-03 07:08:32 +02:00
|
|
|
"ScenarioEditor/Sections/Environment",
|
|
|
|
"ScenarioEditor/Sections/Map",
|
|
|
|
"ScenarioEditor/Sections/Object",
|
|
|
|
"ScenarioEditor/Sections/Terrain",
|
2006-11-30 00:37:10 +01:00
|
|
|
"ScenarioEditor/Sections/Trigger",
|
2006-06-03 07:08:32 +02:00
|
|
|
"ScenarioEditor/Tools",
|
2009-03-22 18:57:11 +01:00
|
|
|
"ScenarioEditor/Tools/Common",
|
|
|
|
}
|
|
|
|
atlas_extra_links = {
|
|
|
|
"AtlasObject",
|
|
|
|
"AtlasScript",
|
|
|
|
"wxJS",
|
|
|
|
}
|
|
|
|
if options["aoe3ed"] then
|
|
|
|
tinsert(atlas_src, "ArchiveViewer")
|
|
|
|
tinsert(atlas_src, "FileConverter")
|
|
|
|
tinsert(atlas_extra_links, "DatafileIO")
|
|
|
|
end
|
|
|
|
|
|
|
|
setup_atlas_package("AtlasUI", "dll", atlas_src,
|
|
|
|
{ -- include
|
2006-06-03 07:08:32 +02:00
|
|
|
"..",
|
2006-11-12 04:39:40 +01:00
|
|
|
"CustomControls",
|
|
|
|
"Misc"
|
2006-06-03 07:08:32 +02:00
|
|
|
},{ -- extern_libs
|
2006-06-02 06:07:18 +02:00
|
|
|
"boost",
|
|
|
|
"devil",
|
2008-01-08 01:09:52 +01:00
|
|
|
--"ffmpeg", -- disabled for now because it causes too many build difficulties
|
2009-03-22 21:51:35 +01:00
|
|
|
"libxml2",
|
2007-06-05 20:16:55 +02:00
|
|
|
"spidermonkey",
|
2006-12-05 03:35:00 +01:00
|
|
|
"wxwidgets",
|
2007-09-02 18:50:20 +02:00
|
|
|
"comsuppw",
|
2009-07-18 21:55:27 +02:00
|
|
|
"zlib",
|
|
|
|
"x11",
|
2006-06-23 19:41:55 +02:00
|
|
|
},{ -- extra_params
|
2007-05-31 03:47:17 +02:00
|
|
|
pch = (not has_broken_pch),
|
2009-03-22 18:57:11 +01:00
|
|
|
extra_links = atlas_extra_links,
|
2006-06-07 06:34:48 +02:00
|
|
|
extra_files = { "Misc/atlas.rc" }
|
2005-10-17 03:11:12 +02:00
|
|
|
})
|
|
|
|
|
2009-03-22 18:57:11 +01:00
|
|
|
if options["aoe3ed"] then
|
|
|
|
setup_atlas_package("DatafileIO", "lib",
|
|
|
|
{ -- src
|
|
|
|
"",
|
|
|
|
"BAR",
|
|
|
|
"DDT",
|
|
|
|
"SCN",
|
|
|
|
"Stream",
|
|
|
|
"XMB"
|
|
|
|
},{ -- include
|
|
|
|
},{ -- extern_libs
|
|
|
|
"devil",
|
|
|
|
"xerces",
|
|
|
|
"zlib"
|
|
|
|
},{ -- extra_params
|
|
|
|
pch = 1,
|
|
|
|
})
|
|
|
|
end
|
2006-04-25 07:10:47 +02:00
|
|
|
|
2006-06-07 03:40:24 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
|
2006-06-07 06:34:48 +02:00
|
|
|
-- Atlas 'frontend' tool-launching packages
|
2006-12-06 01:06:05 +01:00
|
|
|
function setup_atlas_frontend_package (package_name)
|
2006-06-07 03:40:24 +02:00
|
|
|
|
|
|
|
package_create(package_name, "winexe")
|
2009-12-28 17:45:42 +01:00
|
|
|
package_add_extern_libs({
|
|
|
|
"spidermonkey",
|
|
|
|
})
|
2006-06-07 03:40:24 +02:00
|
|
|
|
|
|
|
local source_root = "../../../source/tools/atlas/AtlasFrontends/"
|
|
|
|
package.files = {
|
|
|
|
source_root..package_name..".cpp",
|
|
|
|
source_root..package_name..".rc"
|
|
|
|
}
|
|
|
|
package.trimprefix = source_root
|
2006-06-07 05:02:20 +02:00
|
|
|
package.includepaths = { source_root .. ".." }
|
2006-06-07 03:40:24 +02:00
|
|
|
|
|
|
|
-- Platform Specifics
|
|
|
|
if OS == "windows" then
|
|
|
|
tinsert(package.defines, "_UNICODE")
|
|
|
|
|
|
|
|
-- required to use WinMain() on Windows, otherwise will default to main()
|
|
|
|
tinsert(package.buildflags, "no-main")
|
|
|
|
|
|
|
|
else -- Non-Windows, = Unix
|
2009-03-22 18:57:11 +01:00
|
|
|
if options["aoe3ed"] then
|
|
|
|
tinsert(package.links, "DatafileIO")
|
|
|
|
end
|
2006-11-12 04:39:40 +01:00
|
|
|
tinsert(package.links, "AtlasObject")
|
2006-06-07 03:40:24 +02:00
|
|
|
end
|
|
|
|
|
2006-11-12 04:39:40 +01:00
|
|
|
tinsert(package.links, "AtlasUI")
|
|
|
|
|
2006-06-07 03:40:24 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
function setup_atlas_frontends()
|
2006-06-07 06:34:48 +02:00
|
|
|
setup_atlas_frontend_package("ActorEditor")
|
|
|
|
setup_atlas_frontend_package("ColourTester")
|
2009-07-18 21:55:27 +02:00
|
|
|
if options["aoe3ed"] then
|
|
|
|
setup_atlas_frontend_package("ArchiveViewer")
|
|
|
|
setup_atlas_frontend_package("FileConverter")
|
|
|
|
end
|
2005-10-17 03:11:12 +02:00
|
|
|
end
|
|
|
|
|
2006-06-07 05:02:20 +02:00
|
|
|
|
2006-12-06 01:06:05 +01:00
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
-- collada
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
function setup_collada_package(package_name, target_type, rel_source_dirs, rel_include_dirs, extern_libs, extra_params)
|
|
|
|
|
|
|
|
package_create(package_name, target_type)
|
|
|
|
|
|
|
|
-- Don't add the default 'sourceroot/pch/projectname' for finding PCH files
|
|
|
|
extra_params["no_default_pch"] = 1
|
|
|
|
|
|
|
|
package_add_contents(source_root, rel_source_dirs, rel_include_dirs, extra_params)
|
|
|
|
package_add_extern_libs(extern_libs)
|
|
|
|
|
|
|
|
if extra_params["pch"] then
|
|
|
|
package_setup_pch(nil, "precompiled.h", "precompiled.cpp");
|
|
|
|
end
|
|
|
|
|
|
|
|
-- Platform Specifics
|
|
|
|
if OS == "windows" then
|
|
|
|
|
|
|
|
-- required to use WinMain() on Windows, otherwise will default to main()
|
|
|
|
tinsert(package.buildflags, "no-main")
|
|
|
|
|
|
|
|
if extra_params["extra_links"] then
|
|
|
|
listconcat(package.links, extra_params["extra_links"])
|
|
|
|
end
|
2009-07-18 04:04:55 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
if OS == "linux" then
|
2006-12-06 18:39:49 +01:00
|
|
|
tinsert(package.defines, "LINUX");
|
|
|
|
|
2009-07-28 19:01:30 +02:00
|
|
|
-- FCollada is not aliasing-safe, so disallow dangerous optimisations
|
|
|
|
-- (TODO: It'd be nice to fix FCollada, but that looks hard)
|
|
|
|
tinsert(package.buildoptions, "-fno-strict-aliasing")
|
|
|
|
|
2006-12-06 01:06:05 +01:00
|
|
|
tinsert(package.buildoptions, "-rdynamic")
|
|
|
|
tinsert(package.linkoptions, "-rdynamic")
|
2007-09-03 14:56:45 +02:00
|
|
|
elseif OS == "macosx" then
|
|
|
|
-- define MACOS-something?
|
2009-07-18 04:04:55 +02:00
|
|
|
|
|
|
|
-- On OSX, fcollada uses a few utility functions from coreservices
|
|
|
|
tinsert(package.linkoptions, "-framework CoreServices")
|
2006-12-06 01:06:05 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
-- build all Collada component packages
|
|
|
|
function setup_collada_packages()
|
|
|
|
|
|
|
|
setup_collada_package("Collada", "dll",
|
|
|
|
{ -- src
|
|
|
|
"collada"
|
|
|
|
},{ -- include
|
|
|
|
},{ -- extern_libs
|
|
|
|
"fcollada",
|
2009-07-18 21:55:27 +02:00
|
|
|
"dl",
|
2009-07-26 11:48:10 +02:00
|
|
|
"libxml2",
|
2006-12-06 01:06:05 +01:00
|
|
|
},{ -- extra_params
|
|
|
|
pch = 1,
|
|
|
|
})
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2006-06-07 05:02:20 +02:00
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
-- tests
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
2006-06-08 20:48:40 +02:00
|
|
|
function get_all_test_files(root, src_files, hdr_files)
|
2006-06-07 05:02:20 +02:00
|
|
|
|
|
|
|
-- note: lua doesn't have any directory handling functions at all, ugh.
|
|
|
|
-- premake's matchrecursive on patterns like *tests*.h doesn't work -
|
|
|
|
-- apparently it applies them to filenames, not the complete path.
|
2006-06-08 20:48:40 +02:00
|
|
|
-- our workaround is to enumerate all files and manually filter out the
|
|
|
|
-- desired */tests/* files. this is a bit slow, but hey.
|
2006-06-07 05:02:20 +02:00
|
|
|
|
2006-06-08 20:48:40 +02:00
|
|
|
local all_files = matchrecursive(root .. "*.h")
|
2009-07-21 19:38:27 +02:00
|
|
|
for i,v in pairs(all_files) do
|
2006-06-08 20:48:40 +02:00
|
|
|
-- header file in subdirectory test
|
|
|
|
if string.sub(v, -2) == ".h" and string.find(v, "/tests/") then
|
2006-09-30 23:09:02 +02:00
|
|
|
-- don't include sysdep tests on the wrong sys
|
2009-03-23 02:07:08 +01:00
|
|
|
-- don't include Atlas tests unless Atlas is being built
|
|
|
|
if not (string.find(v, "/sysdep/os/win/") and OS ~= "windows") and
|
|
|
|
not (string.find(v, "/tools/atlas/") and not options["atlas"])
|
|
|
|
then
|
2006-09-30 23:09:02 +02:00
|
|
|
tinsert(hdr_files, v)
|
|
|
|
-- add the corresponding source file immediately, instead of
|
|
|
|
-- waiting for it to appear after cxxtestgen. this avoids
|
|
|
|
-- having to recreate workspace 2x after adding a test.
|
|
|
|
tinsert(src_files, string.sub(v, 1, -3) .. ".cpp")
|
|
|
|
end
|
2006-06-07 05:02:20 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function setup_tests()
|
2006-06-08 20:48:40 +02:00
|
|
|
|
|
|
|
local src_files = {}
|
|
|
|
local hdr_files = {}
|
|
|
|
get_all_test_files(source_root, src_files, hdr_files)
|
|
|
|
|
|
|
|
|
2008-06-28 22:22:49 +02:00
|
|
|
package_create("test_gen", "cxxtestgen")
|
2006-06-08 20:48:40 +02:00
|
|
|
package.files = hdr_files
|
2006-06-08 00:19:42 +02:00
|
|
|
package.rootfile = source_root .. "test_root.cpp"
|
2007-01-04 04:22:23 +01:00
|
|
|
package.testoptions = "--have-std"
|
|
|
|
package.rootoptions = "--have-std"
|
2006-06-08 00:19:42 +02:00
|
|
|
if OS == "windows" then
|
2009-08-07 17:21:39 +02:00
|
|
|
package.rootoptions = package.rootoptions .. " --gui=PsTestWrapper --runner=Win32ODSPrinter"
|
2006-06-08 00:19:42 +02:00
|
|
|
else
|
2009-08-07 17:21:39 +02:00
|
|
|
package.rootoptions = package.rootoptions .. " --gui=PsTestWrapper --runner=ErrorPrinter"
|
2006-06-08 00:19:42 +02:00
|
|
|
end
|
2006-11-12 20:46:47 +01:00
|
|
|
-- precompiled headers - the header is added to all generated .cpp files
|
|
|
|
-- note that the header isn't actually precompiled here, only #included
|
|
|
|
-- so that the build stage can use it as a precompiled header.
|
|
|
|
include = " --include=precompiled.h"
|
|
|
|
package.rootoptions = package.rootoptions .. include
|
|
|
|
package.testoptions = package.testoptions .. include
|
2008-06-28 02:49:38 +02:00
|
|
|
tinsert(package.buildflags, "no-manifest")
|
2006-06-08 20:48:40 +02:00
|
|
|
|
2008-06-28 22:22:49 +02:00
|
|
|
package_create("test", "winexe")
|
2006-06-08 20:48:40 +02:00
|
|
|
links = static_lib_names
|
2008-06-28 22:22:49 +02:00
|
|
|
tinsert(links, "test_gen")
|
2009-03-23 02:07:08 +01:00
|
|
|
if options["atlas"] then
|
|
|
|
tinsert(links, "AtlasObject")
|
|
|
|
end
|
2006-06-08 20:48:40 +02:00
|
|
|
extra_params = {
|
2006-12-20 04:09:21 +01:00
|
|
|
extra_files = { "test_root.cpp", "test_setup.cpp" },
|
2006-06-08 20:48:40 +02:00
|
|
|
extra_links = links,
|
|
|
|
}
|
|
|
|
package_add_contents(source_root, {}, {}, extra_params)
|
|
|
|
-- note: these are not relative to source_root and therefore can't be included via package_add_contents.
|
|
|
|
listconcat(package.files, src_files)
|
2006-06-07 16:22:26 +02:00
|
|
|
package_add_extern_libs(used_extern_libs)
|
2009-08-07 17:21:39 +02:00
|
|
|
tinsert(package.links, "mocks_test")
|
2007-01-04 04:22:23 +01:00
|
|
|
|
2006-06-08 20:48:40 +02:00
|
|
|
if OS == "windows" then
|
|
|
|
-- from "lowlevel" static lib; must be added here to be linked in
|
2008-06-30 20:19:14 +02:00
|
|
|
tinsert(package.files, source_root.."lib/sysdep/os/win/error_dialog.rc")
|
2006-08-22 23:38:53 +02:00
|
|
|
|
2007-06-07 21:32:13 +02:00
|
|
|
-- see wstartup.h
|
|
|
|
tinsert(package.linkoptions, "/INCLUDE:_wstartup_InitAndRegisterShutdown")
|
|
|
|
|
2006-09-30 23:09:02 +02:00
|
|
|
elseif OS == "linux" then
|
|
|
|
|
|
|
|
tinsert(package.links, {
|
|
|
|
"fam",
|
|
|
|
-- Utilities
|
2009-11-13 21:24:21 +01:00
|
|
|
"rt",
|
2006-09-30 23:09:02 +02:00
|
|
|
-- Debugging
|
2009-03-24 01:55:35 +01:00
|
|
|
"bfd", "iberty",
|
|
|
|
-- Dynamic libraries (needed for linking for gold)
|
|
|
|
"dl",
|
2006-09-30 23:09:02 +02:00
|
|
|
})
|
2006-11-12 20:46:47 +01:00
|
|
|
|
2009-11-13 21:24:21 +01:00
|
|
|
-- Threading support
|
|
|
|
tinsert(package.buildoptions, "-pthread")
|
|
|
|
tinsert(package.linkoptions, "-pthread")
|
|
|
|
|
2006-09-30 23:09:02 +02:00
|
|
|
-- For debug_resolve_symbol
|
|
|
|
package.config["Debug"].linkoptions = { "-rdynamic" }
|
|
|
|
package.config["Testing"].linkoptions = { "-rdynamic" }
|
|
|
|
|
2006-11-12 20:46:47 +01:00
|
|
|
tinsert(package.includepaths, source_root .. "pch/test/")
|
2006-06-08 20:48:40 +02:00
|
|
|
end
|
|
|
|
|
2006-11-12 20:46:47 +01:00
|
|
|
package_setup_pch(
|
|
|
|
source_root .. "pch/test/",
|
|
|
|
"precompiled.h",
|
|
|
|
"precompiled.cpp");
|
|
|
|
|
2006-06-11 09:03:59 +02:00
|
|
|
tinsert(package.buildflags, "use-library-dep-inputs")
|
|
|
|
|
2006-06-07 05:02:20 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-10-17 03:11:12 +02:00
|
|
|
|
2006-06-02 06:13:37 +02:00
|
|
|
-- must come first, so that VC sets it as the default project and therefore
|
|
|
|
-- allows running via F5 without the "where is the EXE" dialog.
|
2006-06-02 06:07:18 +02:00
|
|
|
setup_main_exe()
|
2006-06-07 03:40:24 +02:00
|
|
|
|
|
|
|
-- save package global variable for later (will be overwritten by setup_all_libs)
|
|
|
|
main_exe_package = package
|
|
|
|
|
2006-06-02 06:13:37 +02:00
|
|
|
setup_all_libs()
|
2005-10-17 03:11:12 +02:00
|
|
|
|
2006-06-07 03:40:24 +02:00
|
|
|
-- HACK: add the static libs to the main EXE project. only now (after
|
|
|
|
-- setup_all_libs has run) are the lib names known. cannot move
|
|
|
|
-- setup_main_exe to run after setup_all_libs (see comment above).
|
|
|
|
-- we also don't want to hardcode the names - that would require more
|
|
|
|
-- work when changing the static lib breakdown.
|
|
|
|
listconcat(main_exe_package.links, static_lib_names)
|
|
|
|
|
2006-06-02 06:07:18 +02:00
|
|
|
if options["atlas"] then
|
2006-06-07 16:22:26 +02:00
|
|
|
setup_atlas_packages()
|
2006-06-07 03:40:24 +02:00
|
|
|
setup_atlas_frontends()
|
2005-01-28 18:37:21 +01:00
|
|
|
end
|
2006-06-07 05:02:20 +02:00
|
|
|
|
2006-12-06 01:06:05 +01:00
|
|
|
if options["collada"] then
|
|
|
|
setup_collada_packages()
|
|
|
|
end
|
|
|
|
|
2006-06-09 00:33:59 +02:00
|
|
|
if not options["without-tests"] then
|
|
|
|
setup_tests()
|
|
|
|
end
|