Add --with-system-mozjs185 build flag. Fixes #990, based on patch by infyquest.

This was SVN commit r10534.
This commit is contained in:
Ykkrosh 2011-11-14 16:10:41 +00:00
parent b56692a2c7
commit ed5a64aae4
3 changed files with 28 additions and 15 deletions

View File

@ -470,24 +470,32 @@ extern_lib_defs = {
},
spidermonkey = {
compile_settings = function()
if os.is("windows") then
include_dir = "include-win32"
if _OPTIONS["with-system-mozjs185"] then
pkgconfig_cflags("mozjs185")
else
include_dir = "include-unix"
if os.is("windows") then
include_dir = "include-win32"
else
include_dir = "include-unix"
end
configuration "Debug"
includedirs { libraries_dir.."spidermonkey/"..include_dir }
configuration "Release"
includedirs { libraries_dir.."spidermonkey/"..include_dir }
configuration { }
end
configuration "Debug"
includedirs { libraries_dir.."spidermonkey/"..include_dir }
configuration "Release"
includedirs { libraries_dir.."spidermonkey/"..include_dir }
configuration { }
end,
link_settings = function()
configuration "Debug"
links { "mozjs185-ps-debug" }
configuration "Release"
links { "mozjs185-ps-release" }
configuration { }
add_default_lib_paths("spidermonkey")
if _OPTIONS["with-system-mozjs185"] then
pkgconfig_libs("mozjs185")
else
configuration "Debug"
links { "mozjs185-ps-debug" }
configuration "Release"
links { "mozjs185-ps-release" }
configuration { }
add_default_lib_paths("spidermonkey")
end
end,
},
valgrind = {

View File

@ -8,6 +8,7 @@ newoption { trigger = "without-tests", description = "Disable generation of test
newoption { trigger = "without-pch", description = "Disable generation and usage of precompiled headers" }
newoption { trigger = "with-system-nvtt", description = "Search standard paths for nvidia-texture-tools library, instead of using bundled copy" }
newoption { trigger = "with-system-enet", description = "Search standard paths for libenet, instead of using bundled copy" }
newoption { trigger = "with-system-mozjs185", description = "Search standard paths for libmozjs185, instead of using bundled copy" }
newoption { trigger = "bindir", description = "Directory for executables (typically '/usr/games'); default is to be relocatable" }
newoption { trigger = "datadir", description = "Directory for data files (typically '/usr/share/games/0ad'); default is ../data/ relative to executable" }
newoption { trigger = "libdir", description = "Directory for libraries (typically '/usr/lib/games/0ad'); default is ./ relative to executable" }

View File

@ -14,6 +14,7 @@ premake_args=""
with_system_nvtt=false
with_system_enet=false
with_system_mozjs185=false
enable_atlas=true
for i in "$@"
@ -21,6 +22,7 @@ do
case $i in
--with-system-nvtt ) with_system_nvtt=true; premake_args="${premake_args} --with-system-nvtt" ;;
--with-system-enet ) with_system_enet=true; premake_args="${premake_args} --with-system-enet" ;;
--with-system-mozjs185 ) with_system_mozjs185=true; premake_args="${premake_args} --with-system-mozjs185" ;;
--enable-atlas ) enable_atlas=true ;;
--disable-atlas ) enable_atlas=false ;;
-j* ) JOBS=$i ;;
@ -44,7 +46,9 @@ echo
# Build/update bundled external libraries
(cd ../../libraries/fcollada/src && make ${JOBS}) || die "FCollada build failed"
echo
(cd ../../libraries/spidermonkey && JOBS=${JOBS} ./build.sh) || die "SpiderMonkey build failed"
if [ "$with_system_mozjs185" = "false" ]; then
(cd ../../libraries/spidermonkey && JOBS=${JOBS} ./build.sh) || die "SpiderMonkey build failed"
fi
echo
if [ "$with_system_nvtt" = "false" ]; then
(cd ../../libraries/nvtt && JOBS=${JOBS} ./build.sh) || die "NVTT build failed"