2016-08-29 22:31:11 +02:00
--
2018-02-03 17:39:28 +01:00
-- Copyright 2010-2018 Branimir Karadzic. All rights reserved.
2016-08-29 22:31:11 +02:00
-- License: https://github.com/bkaradzic/bx#license-bsd-2-clause
--
local bxDir = path.getabsolute ( " .. " )
2017-04-11 08:16:10 +02:00
local function crtNone ( )
defines {
" BX_CRT_NONE=1 " ,
}
buildoptions {
" -nostdlib " ,
" -nodefaultlibs " ,
" -nostartfiles " ,
" -Wa,--noexecstack " ,
" -ffreestanding " ,
}
linkoptions {
" -nostdlib " ,
" -nodefaultlibs " ,
" -nostartfiles " ,
" -Wa,--noexecstack " ,
" -ffreestanding " ,
}
configuration { " linux-* " }
buildoptions {
" -mpreferred-stack-boundary=4 " ,
" -mstackrealign " ,
}
linkoptions {
" -mpreferred-stack-boundary=4 " ,
" -mstackrealign " ,
}
configuration { }
end
2016-08-29 22:31:11 +02:00
function toolchain ( _buildDir , _libDir )
newoption {
trigger = " gcc " ,
value = " GCC " ,
description = " Choose GCC flavor " ,
allowed = {
{ " android-arm " , " Android - ARM " } ,
{ " android-mips " , " Android - MIPS " } ,
{ " android-x86 " , " Android - x86 " } ,
{ " asmjs " , " Emscripten/asm.js " } ,
{ " freebsd " , " FreeBSD " } ,
{ " linux-gcc " , " Linux (GCC compiler) " } ,
{ " linux-gcc-afl " , " Linux (GCC + AFL fuzzer) " } ,
2016-11-10 21:53:08 +01:00
{ " linux-gcc-6 " , " Linux (GCC-6 compiler) " } ,
2016-08-29 22:31:11 +02:00
{ " linux-clang " , " Linux (Clang compiler) " } ,
{ " linux-clang-afl " , " Linux (Clang + AFL fuzzer) " } ,
{ " linux-mips-gcc " , " Linux (MIPS, GCC compiler) " } ,
{ " linux-arm-gcc " , " Linux (ARM, GCC compiler) " } ,
{ " ios-arm " , " iOS - ARM " } ,
2016-11-10 21:53:08 +01:00
{ " ios-arm64 " , " iOS - ARM64 " } ,
2016-08-29 22:31:11 +02:00
{ " ios-simulator " , " iOS - Simulator " } ,
2018-02-03 17:39:28 +01:00
{ " ios-simulator64 " , " iOS - Simulator 64 " } ,
2016-08-29 22:31:11 +02:00
{ " tvos-arm64 " , " tvOS - ARM64 " } ,
{ " tvos-simulator " , " tvOS - Simulator " } ,
{ " mingw-gcc " , " MinGW " } ,
{ " mingw-clang " , " MinGW (clang compiler) " } ,
{ " netbsd " , " NetBSD " } ,
{ " osx " , " OSX " } ,
2016-11-10 21:53:08 +01:00
{ " orbis " , " Orbis " } ,
2017-04-11 08:16:10 +02:00
{ " riscv " , " RISC-V " } ,
2016-08-29 22:31:11 +02:00
{ " rpi " , " RaspberryPi " } ,
} ,
}
newoption {
trigger = " vs " ,
value = " toolset " ,
description = " Choose VS toolset " ,
allowed = {
{ " vs2012-clang " , " Clang 3.6 " } ,
{ " vs2013-clang " , " Clang 3.6 " } ,
{ " vs2015-clang " , " Clang 3.9 " } ,
2017-04-11 08:16:10 +02:00
{ " vs2017-clang " , " Clang with MS CodeGen " } ,
2016-08-29 22:31:11 +02:00
{ " vs2012-xp " , " Visual Studio 2012 targeting XP " } ,
{ " vs2013-xp " , " Visual Studio 2013 targeting XP " } ,
{ " vs2015-xp " , " Visual Studio 2015 targeting XP " } ,
2017-04-11 08:16:10 +02:00
{ " vs2017-xp " , " Visual Studio 2017 targeting XP " } ,
2018-02-03 17:39:28 +01:00
{ " winstore100 " , " Universal Windows App 10.0 " } ,
2016-08-29 22:31:11 +02:00
{ " durango " , " Durango " } ,
2016-11-10 21:53:08 +01:00
{ " orbis " , " Orbis " } ,
2016-08-29 22:31:11 +02:00
} ,
}
newoption {
trigger = " xcode " ,
value = " xcode_target " ,
description = " Choose XCode target " ,
allowed = {
{ " osx " , " OSX " } ,
{ " ios " , " iOS " } ,
{ " tvos " , " tvOS " } ,
}
}
newoption {
trigger = " with-android " ,
value = " # " ,
description = " Set Android platform version (default: android-14). " ,
}
newoption {
trigger = " with-ios " ,
value = " # " ,
description = " Set iOS target version (default: 8.0). " ,
}
2018-02-03 17:39:28 +01:00
newoption {
trigger = " with-macos " ,
value = " # " ,
description = " Set macOS target version (default 10.11). " ,
}
2016-08-29 22:31:11 +02:00
newoption {
trigger = " with-tvos " ,
value = " # " ,
description = " Set tvOS target version (default: 9.0). " ,
}
2017-04-11 08:16:10 +02:00
newoption {
trigger = " with-windows " ,
value = " # " ,
2018-02-03 17:39:28 +01:00
description = " Set the Windows target platform version (default: $WindowsSDKVersion or 8.1). " ,
2017-04-11 08:16:10 +02:00
}
2016-08-29 22:31:11 +02:00
newoption {
trigger = " with-dynamic-runtime " ,
description = " Dynamically link with the runtime rather than statically " ,
}
newoption {
trigger = " with-32bit-compiler " ,
description = " Use 32-bit compiler instead 64-bit. " ,
}
newoption {
trigger = " with-avx " ,
description = " Use AVX extension. " ,
}
-- Avoid error when invoking genie --help.
if ( _ACTION == nil ) then return false end
location ( path.join ( _buildDir , " projects " , _ACTION ) )
if _ACTION == " clean " then
os.rmdir ( _buildDir )
os.mkdir ( _buildDir )
os.exit ( 1 )
end
2017-04-11 08:16:10 +02:00
local androidPlatform = " android-24 "
2016-08-29 22:31:11 +02:00
if _OPTIONS [ " with-android " ] then
androidPlatform = " android- " .. _OPTIONS [ " with-android " ]
end
local iosPlatform = " "
if _OPTIONS [ " with-ios " ] then
iosPlatform = _OPTIONS [ " with-ios " ]
end
2018-02-03 17:39:28 +01:00
local macosPlatform = " "
if _OPTIONS [ " with-macos " ] then
macosPlatform = _OPTIONS [ " with-macos " ]
end
2016-08-29 22:31:11 +02:00
local tvosPlatform = " "
if _OPTIONS [ " with-tvos " ] then
tvosPlatform = _OPTIONS [ " with-tvos " ]
end
2018-02-03 17:39:28 +01:00
local windowsPlatform = string.gsub ( os.getenv ( " WindowsSDKVersion " ) or " 8.1 " , " \\ " , " " )
2017-04-11 08:16:10 +02:00
if _OPTIONS [ " with-windows " ] then
windowsPlatform = _OPTIONS [ " with-windows " ]
end
2016-08-29 22:31:11 +02:00
local compiler32bit = false
if _OPTIONS [ " with-32bit-compiler " ] then
compiler32bit = true
end
2017-04-11 08:16:10 +02:00
flags {
" ExtraWarnings " ,
}
2016-08-29 22:31:11 +02:00
if _ACTION == " gmake " or _ACTION == " ninja " then
if nil == _OPTIONS [ " gcc " ] then
print ( " GCC flavor must be specified! " )
os.exit ( 1 )
end
if " android-arm " == _OPTIONS [ " gcc " ] then
2017-04-11 08:16:10 +02:00
if not os.getenv ( " ANDROID_NDK_ARM " )
or not os.getenv ( " ANDROID_NDK_CLANG " )
or not os.getenv ( " ANDROID_NDK_ROOT " ) then
2018-02-03 17:39:28 +01:00
print ( " Set ANDROID_NDK_CLANG, ANDROID_NDK_ARM, and ANDROID_NDK_ROOT environment variables. " )
2016-08-29 22:31:11 +02:00
end
2017-04-11 08:16:10 +02:00
premake.gcc . cc = " $(ANDROID_NDK_CLANG)/bin/clang "
premake.gcc . cxx = " $(ANDROID_NDK_CLANG)/bin/clang++ "
premake.gcc . ar = " $(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-ar "
premake.gcc . llvm = true
2016-08-29 22:31:11 +02:00
location ( path.join ( _buildDir , " projects " , _ACTION .. " -android-arm " ) )
elseif " android-mips " == _OPTIONS [ " gcc " ] then
2017-04-11 08:16:10 +02:00
if not os.getenv ( " ANDROID_NDK_MIPS " )
or not os.getenv ( " ANDROID_NDK_CLANG " )
or not os.getenv ( " ANDROID_NDK_ROOT " ) then
2018-02-03 17:39:28 +01:00
print ( " Set ANDROID_NDK_CLANG, ANDROID_NDK_ARM, and ANDROID_NDK_ROOT environment variables. " )
2016-08-29 22:31:11 +02:00
end
2017-04-11 08:16:10 +02:00
premake.gcc . cc = " $(ANDROID_NDK_CLANG)/bin/clang "
premake.gcc . cxx = " $(ANDROID_NDK_CLANG)/bin/clang++ "
premake.gcc . llvm = true
2016-08-29 22:31:11 +02:00
location ( path.join ( _buildDir , " projects " , _ACTION .. " -android-mips " ) )
elseif " android-x86 " == _OPTIONS [ " gcc " ] then
2017-04-11 08:16:10 +02:00
if not os.getenv ( " ANDROID_NDK_X86 " )
or not os.getenv ( " ANDROID_NDK_CLANG " )
or not os.getenv ( " ANDROID_NDK_ROOT " ) then
2018-02-03 17:39:28 +01:00
print ( " Set ANDROID_NDK_CLANG, ANDROID_NDK_ARM, and ANDROID_NDK_ROOT environment variables. " )
2016-08-29 22:31:11 +02:00
end
2017-04-11 08:16:10 +02:00
premake.gcc . cc = " $(ANDROID_NDK_CLANG)/bin/clang "
premake.gcc . cxx = " $(ANDROID_NDK_CLANG)/bin/clang++ "
premake.gcc . llvm = true
2016-08-29 22:31:11 +02:00
location ( path.join ( _buildDir , " projects " , _ACTION .. " -android-x86 " ) )
elseif " asmjs " == _OPTIONS [ " gcc " ] then
if not os.getenv ( " EMSCRIPTEN " ) then
2018-02-03 17:39:28 +01:00
print ( " Set EMSCRIPTEN environment variable. " )
2016-08-29 22:31:11 +02:00
end
premake.gcc . cc = " \" $(EMSCRIPTEN)/emcc \" "
premake.gcc . cxx = " \" $(EMSCRIPTEN)/em++ \" "
premake.gcc . ar = " \" $(EMSCRIPTEN)/emar \" "
premake.gcc . llvm = true
location ( path.join ( _buildDir , " projects " , _ACTION .. " -asmjs " ) )
elseif " freebsd " == _OPTIONS [ " gcc " ] then
location ( path.join ( _buildDir , " projects " , _ACTION .. " -freebsd " ) )
2016-11-10 21:53:08 +01:00
elseif " ios-arm " == _OPTIONS [ " gcc " ]
or " ios-arm64 " == _OPTIONS [ " gcc " ] then
2016-08-29 22:31:11 +02:00
premake.gcc . cc = " /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang "
premake.gcc . cxx = " /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ "
premake.gcc . ar = " ar "
2016-11-10 21:53:08 +01:00
location ( path.join ( _buildDir , " projects " , _ACTION .. " - " .. _OPTIONS [ " gcc " ] ) )
2016-08-29 22:31:11 +02:00
elseif " ios-simulator " == _OPTIONS [ " gcc " ] then
premake.gcc . cc = " /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang "
premake.gcc . cxx = " /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ "
premake.gcc . ar = " ar "
location ( path.join ( _buildDir , " projects " , _ACTION .. " -ios-simulator " ) )
2018-02-03 17:39:28 +01:00
elseif " ios-simulator64 " == _OPTIONS [ " gcc " ] then
premake.gcc . cc = " /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang "
premake.gcc . cxx = " /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ "
premake.gcc . ar = " ar "
location ( path.join ( _buildDir , " projects " , _ACTION .. " -ios-simulator64 " ) )
2016-08-29 22:31:11 +02:00
elseif " tvos-arm64 " == _OPTIONS [ " gcc " ] then
premake.gcc . cc = " /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang "
premake.gcc . cxx = " /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ "
premake.gcc . ar = " ar "
location ( path.join ( _buildDir , " projects " , _ACTION .. " -tvos-arm64 " ) )
elseif " tvos-simulator " == _OPTIONS [ " gcc " ] then
premake.gcc . cc = " /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang "
premake.gcc . cxx = " /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ "
premake.gcc . ar = " ar "
location ( path.join ( _buildDir , " projects " , _ACTION .. " -tvos-simulator " ) )
elseif " linux-gcc " == _OPTIONS [ " gcc " ] then
location ( path.join ( _buildDir , " projects " , _ACTION .. " -linux " ) )
elseif " linux-gcc-afl " == _OPTIONS [ " gcc " ] then
premake.gcc . cc = " afl-gcc "
premake.gcc . cxx = " afl-g++ "
premake.gcc . ar = " ar "
location ( path.join ( _buildDir , " projects " , _ACTION .. " -linux " ) )
2016-11-10 21:53:08 +01:00
elseif " linux-gcc-6 " == _OPTIONS [ " gcc " ] then
premake.gcc . cc = " gcc-6 "
premake.gcc . cxx = " g++-6 "
2016-08-29 22:31:11 +02:00
premake.gcc . ar = " ar "
location ( path.join ( _buildDir , " projects " , _ACTION .. " -linux " ) )
elseif " linux-clang " == _OPTIONS [ " gcc " ] then
premake.gcc . cc = " clang "
premake.gcc . cxx = " clang++ "
premake.gcc . ar = " ar "
location ( path.join ( _buildDir , " projects " , _ACTION .. " -linux-clang " ) )
elseif " linux-clang-afl " == _OPTIONS [ " gcc " ] then
premake.gcc . cc = " afl-clang "
premake.gcc . cxx = " afl-clang++ "
premake.gcc . ar = " ar "
location ( path.join ( _buildDir , " projects " , _ACTION .. " -linux-clang " ) )
elseif " linux-mips-gcc " == _OPTIONS [ " gcc " ] then
location ( path.join ( _buildDir , " projects " , _ACTION .. " -linux-mips-gcc " ) )
elseif " linux-arm-gcc " == _OPTIONS [ " gcc " ] then
location ( path.join ( _buildDir , " projects " , _ACTION .. " -linux-arm-gcc " ) )
elseif " linux-steamlink " == _OPTIONS [ " gcc " ] then
if not os.getenv ( " MARVELL_SDK_PATH " ) then
2018-02-03 17:39:28 +01:00
print ( " Set MARVELL_SDK_PATH environment variable. " )
2016-08-29 22:31:11 +02:00
end
premake.gcc . cc = " $(MARVELL_SDK_PATH)/toolchain/bin/armv7a-cros-linux-gnueabi-gcc "
premake.gcc . cxx = " $(MARVELL_SDK_PATH)/toolchain/bin/armv7a-cros-linux-gnueabi-g++ "
premake.gcc . ar = " $(MARVELL_SDK_PATH)/toolchain/bin/armv7a-cros-linux-gnueabi-ar "
location ( path.join ( _buildDir , " projects " , _ACTION .. " -linux-steamlink " ) )
elseif " mingw-gcc " == _OPTIONS [ " gcc " ] then
2018-02-03 17:39:28 +01:00
if not os.getenv ( " MINGW " ) then
print ( " Set MINGW environment variable. " )
end
2016-08-29 22:31:11 +02:00
local mingwToolchain = " x86_64-w64-mingw32 "
if compiler32bit then
if os.is ( " linux " ) then
mingwToolchain = " i686-w64-mingw32 "
else
mingwToolchain = " mingw32 "
end
end
premake.gcc . cc = " $(MINGW)/bin/ " .. mingwToolchain .. " -gcc "
premake.gcc . cxx = " $(MINGW)/bin/ " .. mingwToolchain .. " -g++ "
premake.gcc . ar = " $(MINGW)/bin/ar "
location ( path.join ( _buildDir , " projects " , _ACTION .. " -mingw-gcc " ) )
elseif " mingw-clang " == _OPTIONS [ " gcc " ] then
premake.gcc . cc = " $(CLANG)/bin/clang "
premake.gcc . cxx = " $(CLANG)/bin/clang++ "
premake.gcc . ar = " $(MINGW)/bin/ar "
-- premake.gcc.ar = "$(CLANG)/bin/llvm-ar"
-- premake.gcc.llvm = true
location ( path.join ( _buildDir , " projects " , _ACTION .. " -mingw-clang " ) )
elseif " netbsd " == _OPTIONS [ " gcc " ] then
location ( path.join ( _buildDir , " projects " , _ACTION .. " -netbsd " ) )
elseif " osx " == _OPTIONS [ " gcc " ] then
if os.is ( " linux " ) then
if not os.getenv ( " OSXCROSS " ) then
2018-02-03 17:39:28 +01:00
print ( " Set OSXCROSS environment variable. " )
2016-08-29 22:31:11 +02:00
end
local osxToolchain = " x86_64-apple-darwin15- "
premake.gcc . cc = " $(OSXCROSS)/target/bin/ " .. osxToolchain .. " clang "
premake.gcc . cxx = " $(OSXCROSS)/target/bin/ " .. osxToolchain .. " clang++ "
premake.gcc . ar = " $(OSXCROSS)/target/bin/ " .. osxToolchain .. " ar "
end
location ( path.join ( _buildDir , " projects " , _ACTION .. " -osx " ) )
2016-11-10 21:53:08 +01:00
elseif " orbis " == _OPTIONS [ " gcc " ] then
2016-08-29 22:31:11 +02:00
2016-11-10 21:53:08 +01:00
if not os.getenv ( " SCE_ORBIS_SDK_DIR " ) then
2018-02-03 17:39:28 +01:00
print ( " Set SCE_ORBIS_SDK_DIR environment variable. " )
2016-08-29 22:31:11 +02:00
end
2016-11-10 21:53:08 +01:00
orbisToolchain = " $(SCE_ORBIS_SDK_DIR)/host_tools/bin/orbis- "
2016-08-29 22:31:11 +02:00
2016-11-10 21:53:08 +01:00
premake.gcc . cc = orbisToolchain .. " clang "
premake.gcc . cxx = orbisToolchain .. " clang++ "
premake.gcc . ar = orbisToolchain .. " ar "
location ( path.join ( _buildDir , " projects " , _ACTION .. " -orbis " ) )
2016-08-29 22:31:11 +02:00
elseif " rpi " == _OPTIONS [ " gcc " ] then
location ( path.join ( _buildDir , " projects " , _ACTION .. " -rpi " ) )
elseif " riscv " == _OPTIONS [ " gcc " ] then
2017-04-11 08:16:10 +02:00
premake.gcc . cc = " $(FREEDOM_E_SDK)/toolchain/bin/riscv32-unknown-elf-gcc "
premake.gcc . cxx = " $(FREEDOM_E_SDK)/toolchain/bin/riscv32-unknown-elf-g++ "
premake.gcc . ar = " $(FREEDOM_E_SDK)/toolchain/bin/riscv32-unknown-elf-ar "
2016-08-29 22:31:11 +02:00
location ( path.join ( _buildDir , " projects " , _ACTION .. " -riscv " ) )
end
2017-04-11 08:16:10 +02:00
elseif _ACTION == " vs2012 "
or _ACTION == " vs2013 "
or _ACTION == " vs2015 "
or _ACTION == " vs2017 "
then
2016-08-29 22:31:11 +02:00
2018-02-03 17:39:28 +01:00
local action = premake.action . current ( )
action.vstudio . windowsTargetPlatformVersion = windowsPlatform
action.vstudio . windowsTargetPlatformMinVersion = windowsPlatform
2016-08-29 22:31:11 +02:00
if ( _ACTION .. " -clang " ) == _OPTIONS [ " vs " ] then
2017-04-11 08:16:10 +02:00
if " vs2017-clang " == _OPTIONS [ " vs " ] then
premake.vstudio . toolset = " v141_clang_c2 "
elseif " vs2015-clang " == _OPTIONS [ " vs " ] then
premake.vstudio . toolset = " LLVM-vs2014 "
2016-08-29 22:31:11 +02:00
else
premake.vstudio . toolset = ( " LLVM- " .. _ACTION )
end
location ( path.join ( _buildDir , " projects " , _ACTION .. " -clang " ) )
2018-02-03 17:39:28 +01:00
elseif " winstore100 " == _OPTIONS [ " vs " ] then
premake.vstudio . toolset = " v141 "
premake.vstudio . storeapp = " 10.0 "
2017-04-11 08:16:10 +02:00
2016-08-29 22:31:11 +02:00
platforms { " ARM " }
2018-02-03 17:39:28 +01:00
location ( path.join ( _buildDir , " projects " , _ACTION .. " -winstore100 " ) )
2016-08-29 22:31:11 +02:00
elseif " durango " == _OPTIONS [ " vs " ] then
if not os.getenv ( " DurangoXDK " ) then
print ( " DurangoXDK not found. " )
end
premake.vstudio . toolset = " v140 "
premake.vstudio . storeapp = " durango "
platforms { " Durango " }
location ( path.join ( _buildDir , " projects " , _ACTION .. " -durango " ) )
2016-11-10 21:53:08 +01:00
elseif " orbis " == _OPTIONS [ " vs " ] then
if not os.getenv ( " SCE_ORBIS_SDK_DIR " ) then
2018-02-03 17:39:28 +01:00
print ( " Set SCE_ORBIS_SDK_DIR environment variable. " )
2016-11-10 21:53:08 +01:00
end
platforms { " Orbis " }
location ( path.join ( _buildDir , " projects " , _ACTION .. " -orbis " ) )
2016-08-29 22:31:11 +02:00
elseif ( " vs2012-xp " ) == _OPTIONS [ " vs " ] then
premake.vstudio . toolset = ( " v110_xp " )
location ( path.join ( _buildDir , " projects " , _ACTION .. " -xp " ) )
elseif " vs2013-xp " == _OPTIONS [ " vs " ] then
premake.vstudio . toolset = ( " v120_xp " )
location ( path.join ( _buildDir , " projects " , _ACTION .. " -xp " ) )
elseif " vs2015-xp " == _OPTIONS [ " vs " ] then
premake.vstudio . toolset = ( " v140_xp " )
location ( path.join ( _buildDir , " projects " , _ACTION .. " -xp " ) )
2017-04-11 08:16:10 +02:00
elseif " vs2015-xp " == _OPTIONS [ " vs " ] then
premake.vstudio . toolset = ( " v141_xp " )
location ( path.join ( _buildDir , " projects " , _ACTION .. " -xp " ) )
2018-02-03 17:39:28 +01:00
end
2016-08-29 22:31:11 +02:00
elseif _ACTION == " xcode4 " then
2018-02-03 17:39:28 +01:00
local action = premake.action . current ( )
local str_or = function ( str , def )
return # str > 0 and str or def
end
2016-08-29 22:31:11 +02:00
if " osx " == _OPTIONS [ " xcode " ] then
2018-02-03 17:39:28 +01:00
action.xcode . macOSTargetPlatformVersion = str_or ( macosPlatform , " 10.11 " )
2016-08-29 22:31:11 +02:00
premake.xcode . toolset = " macosx "
location ( path.join ( _buildDir , " projects " , _ACTION .. " -osx " ) )
elseif " ios " == _OPTIONS [ " xcode " ] then
2018-02-03 17:39:28 +01:00
action.xcode . iOSTargetPlatformVersion = str_or ( iosPlatform , " 8.0 " )
2016-08-29 22:31:11 +02:00
premake.xcode . toolset = " iphoneos "
location ( path.join ( _buildDir , " projects " , _ACTION .. " -ios " ) )
elseif " tvos " == _OPTIONS [ " xcode " ] then
2018-02-03 17:39:28 +01:00
action.xcode . tvOSTargetPlatformVersion = str_or ( tvosPlatform , " 9.0 " )
2016-08-29 22:31:11 +02:00
premake.xcode . toolset = " appletvos "
location ( path.join ( _buildDir , " projects " , _ACTION .. " -tvos " ) )
end
end
if not _OPTIONS [ " with-dynamic-runtime " ] then
flags { " StaticRuntime " }
end
if _OPTIONS [ " with-avx " ] then
flags { " EnableAVX " }
end
2017-04-11 08:16:10 +02:00
if _OPTIONS [ " with-crtnone " ] then
crtNone ( )
end
2016-08-29 22:31:11 +02:00
flags {
" NoPCH " ,
" NativeWChar " ,
" NoRTTI " ,
" NoExceptions " ,
" NoEditAndContinue " ,
" NoFramePointer " ,
" Symbols " ,
}
defines {
" __STDC_LIMIT_MACROS " ,
" __STDC_FORMAT_MACROS " ,
" __STDC_CONSTANT_MACROS " ,
}
configuration { " Debug " }
targetsuffix " Debug "
2017-04-11 08:16:10 +02:00
defines {
" _DEBUG " ,
}
2016-08-29 22:31:11 +02:00
configuration { " Release " }
flags {
" NoBufferSecurityCheck " ,
" OptimizeSpeed " ,
}
2017-04-11 08:16:10 +02:00
defines {
" NDEBUG " ,
}
2016-08-29 22:31:11 +02:00
targetsuffix " Release "
2017-04-11 08:16:10 +02:00
configuration { " qbs " }
flags {
" ExtraWarnings " ,
}
2016-08-29 22:31:11 +02:00
configuration { " vs* " , " x32 " }
flags {
" EnableSSE2 " ,
}
2018-02-03 17:39:28 +01:00
configuration { " vs* " , " not orbis " , " not NX32 " , " not NX64 " }
2016-08-29 22:31:11 +02:00
includedirs { path.join ( bxDir , " include/compat/msvc " ) }
defines {
" WIN32 " ,
" _WIN32 " ,
" _HAS_EXCEPTIONS=0 " ,
" _HAS_ITERATOR_DEBUGGING=0 " ,
" _SCL_SECURE=0 " ,
" _SECURE_SCL=0 " ,
" _SCL_SECURE_NO_WARNINGS " ,
" _CRT_SECURE_NO_WARNINGS " ,
" _CRT_SECURE_NO_DEPRECATE " ,
}
buildoptions {
" /wd4201 " , -- warning C4201: nonstandard extension used: nameless struct/union
" /wd4324 " , -- warning C4324: '': structure was padded due to alignment specifier
" /Ob2 " , -- The Inline Function Expansion
}
linkoptions {
" /ignore:4221 " , -- LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
}
configuration { " vs2008 " }
includedirs { path.join ( bxDir , " include/compat/msvc/pre1600 " ) }
configuration { " x32 " , " vs* " }
targetdir ( path.join ( _buildDir , " win32_ " .. _ACTION , " bin " ) )
objdir ( path.join ( _buildDir , " win32_ " .. _ACTION , " obj " ) )
libdirs {
path.join ( _libDir , " lib/win32_ " .. _ACTION ) ,
}
configuration { " x64 " , " vs* " }
defines { " _WIN64 " }
targetdir ( path.join ( _buildDir , " win64_ " .. _ACTION , " bin " ) )
objdir ( path.join ( _buildDir , " win64_ " .. _ACTION , " obj " ) )
libdirs {
path.join ( _libDir , " lib/win64_ " .. _ACTION ) ,
}
2017-04-11 08:16:10 +02:00
configuration { " x32 " , " vs2017 " }
targetdir ( path.join ( _buildDir , " win32_ " .. _ACTION , " bin " ) )
objdir ( path.join ( _buildDir , " win32_ " .. _ACTION , " obj " ) )
libdirs {
path.join ( _libDir , " lib/win32_ " .. _ACTION ) ,
}
configuration { " x64 " , " vs2017 " }
defines { " _WIN64 " }
targetdir ( path.join ( _buildDir , " win64_ " .. _ACTION , " bin " ) )
objdir ( path.join ( _buildDir , " win64_ " .. _ACTION , " obj " ) )
libdirs {
path.join ( _libDir , " lib/win64_ " .. _ACTION ) ,
}
2016-08-29 22:31:11 +02:00
configuration { " ARM " , " vs* " }
targetdir ( path.join ( _buildDir , " arm_ " .. _ACTION , " bin " ) )
objdir ( path.join ( _buildDir , " arm_ " .. _ACTION , " obj " ) )
configuration { " vs*-clang " }
buildoptions {
" -Qunused-arguments " ,
}
configuration { " x32 " , " vs*-clang " }
targetdir ( path.join ( _buildDir , " win32_ " .. _ACTION .. " -clang/bin " ) )
objdir ( path.join ( _buildDir , " win32_ " .. _ACTION .. " -clang/obj " ) )
configuration { " x64 " , " vs*-clang " }
targetdir ( path.join ( _buildDir , " win64_ " .. _ACTION .. " -clang/bin " ) )
objdir ( path.join ( _buildDir , " win64_ " .. _ACTION .. " -clang/obj " ) )
2018-02-03 17:39:28 +01:00
configuration { " winstore* " }
2016-08-29 22:31:11 +02:00
removeflags {
" StaticRuntime " ,
2018-02-03 17:39:28 +01:00
" NoBufferSecurityCheck " ,
}
buildoptions {
" /wd4530 " , -- vccorlib.h(1345): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
}
linkoptions {
" /ignore:4264 " -- LNK4264: archiving object file compiled with /ZW into a static library; note that when authoring Windows Runtime types it is not recommended to link with a static library that contains Windows Runtime metadata
2016-08-29 22:31:11 +02:00
}
configuration { " *-gcc* or osx " }
buildoptions {
" -Wshadow " ,
}
configuration { " mingw-* " }
defines { " WIN32 " }
includedirs { path.join ( bxDir , " include/compat/mingw " ) }
2017-04-11 08:16:10 +02:00
defines {
" MINGW_HAS_SECURE_API=1 " ,
}
2016-08-29 22:31:11 +02:00
buildoptions {
" -Wunused-value " ,
" -fdata-sections " ,
" -ffunction-sections " ,
" -msse2 " ,
" -Wunused-value " ,
" -Wundef " ,
}
buildoptions_cpp {
2016-11-10 21:53:08 +01:00
" -std=c++11 " ,
2016-08-29 22:31:11 +02:00
}
linkoptions {
" -Wl,--gc-sections " ,
" -static " ,
" -static-libgcc " ,
" -static-libstdc++ " ,
}
configuration { " x32 " , " mingw-gcc " }
targetdir ( path.join ( _buildDir , " win32_mingw-gcc/bin " ) )
objdir ( path.join ( _buildDir , " win32_mingw-gcc/obj " ) )
libdirs {
path.join ( _libDir , " lib/win32_mingw-gcc " ) ,
}
buildoptions {
" -m32 " ,
" -mstackrealign " ,
}
configuration { " x64 " , " mingw-gcc " }
targetdir ( path.join ( _buildDir , " win64_mingw-gcc/bin " ) )
objdir ( path.join ( _buildDir , " win64_mingw-gcc/obj " ) )
libdirs {
path.join ( _libDir , " lib/win64_mingw-gcc " ) ,
}
buildoptions { " -m64 " }
configuration { " mingw-clang " }
buildoptions {
" -isystem$(MINGW)/lib/gcc/x86_64-w64-mingw32/4.8.1/include/c++ " ,
" -isystem$(MINGW)/lib/gcc/x86_64-w64-mingw32/4.8.1/include/c++/x86_64-w64-mingw32 " ,
" -isystem$(MINGW)/x86_64-w64-mingw32/include " ,
}
linkoptions {
" -Qunused-arguments " ,
" -Wno-error=unused-command-line-argument-hard-error-in-future " ,
}
configuration { " x32 " , " mingw-clang " }
targetdir ( path.join ( _buildDir , " win32_mingw-clang/bin " ) )
objdir ( path.join ( _buildDir , " win32_mingw-clang/obj " ) )
libdirs {
path.join ( _libDir , " lib/win32_mingw-clang " ) ,
}
buildoptions { " -m32 " }
configuration { " x64 " , " mingw-clang " }
targetdir ( path.join ( _buildDir , " win64_mingw-clang/bin " ) )
objdir ( path.join ( _buildDir , " win64_mingw-clang/obj " ) )
libdirs {
path.join ( _libDir , " lib/win64_mingw-clang " ) ,
}
buildoptions { " -m64 " }
configuration { " linux-clang " }
2016-11-10 21:53:08 +01:00
configuration { " linux-gcc-6 " }
2016-08-29 22:31:11 +02:00
buildoptions {
-- "-fno-omit-frame-pointer",
-- "-fsanitize=address",
-- "-fsanitize=undefined",
-- "-fsanitize=float-divide-by-zero",
-- "-fsanitize=float-cast-overflow",
}
links {
-- "asan",
-- "ubsan",
}
configuration { " linux-gcc " }
buildoptions {
" -mfpmath=sse " ,
}
configuration { " linux-gcc* or linux-clang* " }
buildoptions {
" -msse2 " ,
2018-02-03 17:39:28 +01:00
-- "-Wdouble-promotion",
-- "-Wduplicated-branches",
-- "-Wduplicated-cond",
-- "-Wjump-misses-init",
" -Wlogical-op " ,
" -Wshadow " ,
-- "-Wnull-dereference",
2016-08-29 22:31:11 +02:00
" -Wunused-value " ,
" -Wundef " ,
2018-02-03 17:39:28 +01:00
-- "-Wuseless-cast",
2016-08-29 22:31:11 +02:00
}
buildoptions_cpp {
2016-11-10 21:53:08 +01:00
" -std=c++11 " ,
2016-08-29 22:31:11 +02:00
}
links {
" rt " ,
" dl " ,
}
linkoptions {
" -Wl,--gc-sections " ,
2017-04-11 08:16:10 +02:00
" -Wl,--as-needed " ,
2016-08-29 22:31:11 +02:00
}
configuration { " linux-gcc* " , " x32 " }
targetdir ( path.join ( _buildDir , " linux32_gcc/bin " ) )
objdir ( path.join ( _buildDir , " linux32_gcc/obj " ) )
libdirs { path.join ( _libDir , " lib/linux32_gcc " ) }
buildoptions {
" -m32 " ,
}
configuration { " linux-gcc* " , " x64 " }
targetdir ( path.join ( _buildDir , " linux64_gcc/bin " ) )
objdir ( path.join ( _buildDir , " linux64_gcc/obj " ) )
libdirs { path.join ( _libDir , " lib/linux64_gcc " ) }
buildoptions {
" -m64 " ,
}
configuration { " linux-clang* " , " x32 " }
targetdir ( path.join ( _buildDir , " linux32_clang/bin " ) )
objdir ( path.join ( _buildDir , " linux32_clang/obj " ) )
libdirs { path.join ( _libDir , " lib/linux32_clang " ) }
buildoptions {
" -m32 " ,
}
configuration { " linux-clang* " , " x64 " }
targetdir ( path.join ( _buildDir , " linux64_clang/bin " ) )
objdir ( path.join ( _buildDir , " linux64_clang/obj " ) )
libdirs { path.join ( _libDir , " lib/linux64_clang " ) }
buildoptions {
" -m64 " ,
}
configuration { " linux-mips-gcc " }
targetdir ( path.join ( _buildDir , " linux32_mips_gcc/bin " ) )
objdir ( path.join ( _buildDir , " linux32_mips_gcc/obj " ) )
libdirs { path.join ( _libDir , " lib/linux32_mips_gcc " ) }
buildoptions {
" -Wunused-value " ,
" -Wundef " ,
}
buildoptions_cpp {
2016-11-10 21:53:08 +01:00
" -std=c++11 " ,
2016-08-29 22:31:11 +02:00
}
links {
" rt " ,
" dl " ,
}
linkoptions {
" -Wl,--gc-sections " ,
}
configuration { " linux-arm-gcc " }
targetdir ( path.join ( _buildDir , " linux32_arm_gcc/bin " ) )
objdir ( path.join ( _buildDir , " linux32_arm_gcc/obj " ) )
libdirs { path.join ( _libDir , " lib/linux32_arm_gcc " ) }
buildoptions {
" -Wunused-value " ,
" -Wundef " ,
}
buildoptions_cpp {
2016-11-10 21:53:08 +01:00
" -std=c++11 " ,
2016-08-29 22:31:11 +02:00
}
links {
" rt " ,
" dl " ,
}
linkoptions {
" -Wl,--gc-sections " ,
}
configuration { " android-* " }
targetprefix ( " lib " )
flags {
" NoImportLib " ,
}
includedirs {
2017-04-11 08:16:10 +02:00
" $(ANDROID_NDK_ROOT)/sources/cxx-stl/llvm-libc++/include " ,
2016-08-29 22:31:11 +02:00
" $(ANDROID_NDK_ROOT)/sources/android/native_app_glue " ,
}
linkoptions {
" -nostdlib " ,
}
links {
" c " ,
" dl " ,
" m " ,
" android " ,
" log " ,
2017-04-11 08:16:10 +02:00
" c++ " ,
2016-08-29 22:31:11 +02:00
" gcc " ,
}
buildoptions {
" -fPIC " ,
" -no-canonical-prefixes " ,
" -Wa,--noexecstack " ,
2017-04-11 08:16:10 +02:00
" -fstack-protector-strong " ,
2016-08-29 22:31:11 +02:00
" -ffunction-sections " ,
" -Wunused-value " ,
" -Wundef " ,
}
buildoptions_cpp {
2016-11-10 21:53:08 +01:00
" -std=c++11 " ,
2016-08-29 22:31:11 +02:00
}
linkoptions {
" -no-canonical-prefixes " ,
" -Wl,--no-undefined " ,
" -Wl,-z,noexecstack " ,
" -Wl,-z,relro " ,
" -Wl,-z,now " ,
}
configuration { " linux-steamlink " }
targetdir ( path.join ( _buildDir , " steamlink/bin " ) )
objdir ( path.join ( _buildDir , " steamlink/obj " ) )
libdirs { path.join ( _libDir , " lib/steamlink " ) }
includedirs { path.join ( bxDir , " include/compat/linux " ) }
defines {
" __STEAMLINK__=1 " , -- There is no special prefedined compiler symbol to detect SteamLink, faking it.
}
buildoptions {
2016-11-10 21:53:08 +01:00
" -std=c++11 " ,
2016-08-29 22:31:11 +02:00
" -Wfatal-errors " ,
" -Wunused-value " ,
" -Wundef " ,
" -pthread " ,
" -marm " ,
" -mfloat-abi=hard " ,
" --sysroot=$(MARVELL_SDK_PATH)/rootfs " ,
}
linkoptions {
" -static-libgcc " ,
" -static-libstdc++ " ,
" --sysroot=$(MARVELL_SDK_PATH)/rootfs " ,
}
configuration { " android-arm " }
targetdir ( path.join ( _buildDir , " android-arm/bin " ) )
objdir ( path.join ( _buildDir , " android-arm/obj " ) )
libdirs {
path.join ( _libDir , " lib/android-arm " ) ,
2017-04-11 08:16:10 +02:00
" $(ANDROID_NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a " ,
2016-08-29 22:31:11 +02:00
}
includedirs {
2017-04-11 08:16:10 +02:00
" $(ANDROID_NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/include " ,
" $(ANDROID_NDK_ROOT)/sources/cxx-stl/llvm-libc++/include " ,
2016-08-29 22:31:11 +02:00
}
buildoptions {
2017-04-11 08:16:10 +02:00
" -gcc-toolchain $(ANDROID_NDK_ARM) " ,
2016-08-29 22:31:11 +02:00
" --sysroot= " .. path.join ( " $(ANDROID_NDK_ROOT)/platforms " , androidPlatform , " arch-arm " ) ,
2017-04-11 08:16:10 +02:00
" -target armv7-none-linux-androideabi " ,
2016-08-29 22:31:11 +02:00
" -mthumb " ,
" -march=armv7-a " ,
" -mfloat-abi=softfp " ,
" -mfpu=neon " ,
" -Wunused-value " ,
" -Wundef " ,
}
linkoptions {
2017-04-11 08:16:10 +02:00
" -gcc-toolchain $(ANDROID_NDK_ARM) " ,
2016-08-29 22:31:11 +02:00
" --sysroot= " .. path.join ( " $(ANDROID_NDK_ROOT)/platforms " , androidPlatform , " arch-arm " ) ,
path.join ( " $(ANDROID_NDK_ROOT)/platforms " , androidPlatform , " arch-arm/usr/lib/crtbegin_so.o " ) ,
path.join ( " $(ANDROID_NDK_ROOT)/platforms " , androidPlatform , " arch-arm/usr/lib/crtend_so.o " ) ,
2017-04-11 08:16:10 +02:00
" -target armv7-none-linux-androideabi " ,
2016-08-29 22:31:11 +02:00
" -march=armv7-a " ,
" -Wl,--fix-cortex-a8 " ,
}
configuration { " android-mips " }
targetdir ( path.join ( _buildDir , " android-mips/bin " ) )
objdir ( path.join ( _buildDir , " android-mips/obj " ) )
libdirs {
path.join ( _libDir , " lib/android-mips " ) ,
2017-04-11 08:16:10 +02:00
" $(ANDROID_NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/mips " ,
2016-08-29 22:31:11 +02:00
}
includedirs {
2017-04-11 08:16:10 +02:00
" $(ANDROID_NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/mips/include " ,
2016-08-29 22:31:11 +02:00
}
buildoptions {
2017-04-11 08:16:10 +02:00
" -gcc-toolchain $(ANDROID_NDK_MIPS) " ,
2016-08-29 22:31:11 +02:00
" --sysroot= " .. path.join ( " $(ANDROID_NDK_ROOT)/platforms " , androidPlatform , " arch-mips " ) ,
2017-04-11 08:16:10 +02:00
" -target mipsel-none-linux-android " ,
" -mips32 " ,
2016-08-29 22:31:11 +02:00
" -Wunused-value " ,
" -Wundef " ,
}
linkoptions {
2017-04-11 08:16:10 +02:00
" -gcc-toolchain $(ANDROID_NDK_MIPS) " ,
2016-08-29 22:31:11 +02:00
" --sysroot= " .. path.join ( " $(ANDROID_NDK_ROOT)/platforms " , androidPlatform , " arch-mips " ) ,
path.join ( " $(ANDROID_NDK_ROOT)/platforms " , androidPlatform , " arch-mips/usr/lib/crtbegin_so.o " ) ,
path.join ( " $(ANDROID_NDK_ROOT)/platforms " , androidPlatform , " arch-mips/usr/lib/crtend_so.o " ) ,
2017-04-11 08:16:10 +02:00
" -target mipsel-none-linux-android " ,
" -mips32 " ,
2016-08-29 22:31:11 +02:00
}
configuration { " android-x86 " }
targetdir ( path.join ( _buildDir , " android-x86/bin " ) )
objdir ( path.join ( _buildDir , " android-x86/obj " ) )
libdirs {
path.join ( _libDir , " lib/android-x86 " ) ,
2017-04-11 08:16:10 +02:00
" $(ANDROID_NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/x86 " ,
2016-08-29 22:31:11 +02:00
}
includedirs {
2017-04-11 08:16:10 +02:00
" $(ANDROID_NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/x86/include " ,
2016-08-29 22:31:11 +02:00
}
buildoptions {
2017-04-11 08:16:10 +02:00
" -gcc-toolchain $(ANDROID_NDK_X86) " ,
2016-08-29 22:31:11 +02:00
" --sysroot= " .. path.join ( " $(ANDROID_NDK_ROOT)/platforms " , androidPlatform , " arch-x86 " ) ,
2017-04-11 08:16:10 +02:00
" -target i686-none-linux-android " ,
2016-08-29 22:31:11 +02:00
" -march=i686 " ,
" -mtune=atom " ,
" -mstackrealign " ,
" -msse3 " ,
" -mfpmath=sse " ,
" -Wunused-value " ,
" -Wundef " ,
}
linkoptions {
2017-04-11 08:16:10 +02:00
" -gcc-toolchain $(ANDROID_NDK_X86) " ,
2016-08-29 22:31:11 +02:00
" --sysroot= " .. path.join ( " $(ANDROID_NDK_ROOT)/platforms " , androidPlatform , " arch-x86 " ) ,
path.join ( " $(ANDROID_NDK_ROOT)/platforms " , androidPlatform , " arch-x86/usr/lib/crtbegin_so.o " ) ,
path.join ( " $(ANDROID_NDK_ROOT)/platforms " , androidPlatform , " arch-x86/usr/lib/crtend_so.o " ) ,
2017-04-11 08:16:10 +02:00
" -target i686-none-linux-android " ,
2016-08-29 22:31:11 +02:00
}
configuration { " asmjs " }
targetdir ( path.join ( _buildDir , " asmjs/bin " ) )
objdir ( path.join ( _buildDir , " asmjs/obj " ) )
libdirs { path.join ( _libDir , " lib/asmjs " ) }
buildoptions {
" -i \" system$(EMSCRIPTEN)/system/include \" " ,
2018-02-03 17:39:28 +01:00
" -i \" system$(EMSCRIPTEN)/system/include/libcxx \" " ,
2016-08-29 22:31:11 +02:00
" -i \" system$(EMSCRIPTEN)/system/include/libc \" " ,
" -Wunused-value " ,
" -Wundef " ,
}
2018-02-03 17:39:28 +01:00
buildoptions_cpp {
" -std=c++11 " ,
}
2016-08-29 22:31:11 +02:00
configuration { " freebsd " }
targetdir ( path.join ( _buildDir , " freebsd/bin " ) )
objdir ( path.join ( _buildDir , " freebsd/obj " ) )
libdirs { path.join ( _libDir , " lib/freebsd " ) }
includedirs {
path.join ( bxDir , " include/compat/freebsd " ) ,
}
configuration { " xbox360 " }
targetdir ( path.join ( _buildDir , " xbox360/bin " ) )
objdir ( path.join ( _buildDir , " xbox360/obj " ) )
includedirs { path.join ( bxDir , " include/compat/msvc " ) }
libdirs { path.join ( _libDir , " lib/xbox360 " ) }
defines {
" NOMINMAX " ,
}
configuration { " durango " }
targetdir ( path.join ( _buildDir , " durango/bin " ) )
objdir ( path.join ( _buildDir , " durango/obj " ) )
includedirs { path.join ( bxDir , " include/compat/msvc " ) }
libdirs { path.join ( _libDir , " lib/durango " ) }
removeflags { " StaticRuntime " }
defines {
" NOMINMAX " ,
}
configuration { " netbsd " }
targetdir ( path.join ( _buildDir , " netbsd/bin " ) )
objdir ( path.join ( _buildDir , " netbsd/obj " ) )
libdirs { path.join ( _libDir , " lib/netbsd " ) }
includedirs {
path.join ( bxDir , " include/compat/freebsd " ) ,
}
configuration { " osx " , " x32 " }
targetdir ( path.join ( _buildDir , " osx32_clang/bin " ) )
objdir ( path.join ( _buildDir , " osx32_clang/obj " ) )
--libdirs { path.join(_libDir, "lib/osx32_clang") }
buildoptions {
" -m32 " ,
}
configuration { " osx " , " x64 " }
targetdir ( path.join ( _buildDir , " osx64_clang/bin " ) )
objdir ( path.join ( _buildDir , " osx64_clang/obj " ) )
--libdirs { path.join(_libDir, "lib/osx64_clang") }
buildoptions {
" -m64 " ,
}
configuration { " osx " , " Universal " }
targetdir ( path.join ( _buildDir , " osx_universal/bin " ) )
objdir ( path.join ( _buildDir , " osx_universal/bin " ) )
configuration { " osx " }
2017-04-11 08:16:10 +02:00
buildoptions_cpp {
" -std=c++11 " ,
}
2018-02-03 17:39:28 +01:00
buildoptions_objcpp {
" -std=c++11 " ,
}
2016-08-29 22:31:11 +02:00
buildoptions {
" -Wfatal-errors " ,
" -msse2 " ,
" -Wunused-value " ,
" -Wundef " ,
}
includedirs { path.join ( bxDir , " include/compat/osx " ) }
configuration { " ios* " }
linkoptions {
" -lc++ " ,
}
2017-04-11 08:16:10 +02:00
buildoptions_cpp {
" -std=c++11 " ,
}
2018-02-03 17:39:28 +01:00
buildoptions_objcpp {
" -std=c++11 " ,
}
2016-08-29 22:31:11 +02:00
buildoptions {
" -Wfatal-errors " ,
" -Wunused-value " ,
" -Wundef " ,
}
includedirs { path.join ( bxDir , " include/compat/ios " ) }
configuration { " xcode4 " , " ios* " }
targetdir ( path.join ( _buildDir , " ios-arm/bin " ) )
objdir ( path.join ( _buildDir , " ios-arm/obj " ) )
configuration { " ios-arm " }
targetdir ( path.join ( _buildDir , " ios-arm/bin " ) )
objdir ( path.join ( _buildDir , " ios-arm/obj " ) )
libdirs { path.join ( _libDir , " lib/ios-arm " ) }
linkoptions {
" -arch armv7 " ,
2016-11-10 21:53:08 +01:00
}
buildoptions {
" -arch armv7 " ,
}
configuration { " ios-arm64 " }
targetdir ( path.join ( _buildDir , " ios-arm64/bin " ) )
objdir ( path.join ( _buildDir , " ios-arm64/obj " ) )
libdirs { path.join ( _libDir , " lib/ios-arm64 " ) }
linkoptions {
" -arch arm64 " ,
}
buildoptions {
" -arch arm64 " ,
}
configuration { " ios-arm* " }
linkoptions {
" -miphoneos-version-min=7.0 " ,
2016-08-29 22:31:11 +02:00
" --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS " .. iosPlatform .. " .sdk " ,
" -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS " .. iosPlatform .. " .sdk/usr/lib/system " ,
" -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS " .. iosPlatform .. " .sdk/System/Library/Frameworks " ,
" -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS " .. iosPlatform .. " .sdk/System/Library/PrivateFrameworks " ,
}
buildoptions {
" -miphoneos-version-min=7.0 " ,
" --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS " .. iosPlatform .. " .sdk " ,
}
configuration { " ios-simulator " }
targetdir ( path.join ( _buildDir , " ios-simulator/bin " ) )
objdir ( path.join ( _buildDir , " ios-simulator/obj " ) )
libdirs { path.join ( _libDir , " lib/ios-simulator " ) }
linkoptions {
" -mios-simulator-version-min=7.0 " ,
" -arch i386 " ,
" --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator " .. iosPlatform .. " .sdk " ,
" -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator " .. iosPlatform .. " .sdk/usr/lib/system " ,
" -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator " .. iosPlatform .. " .sdk/System/Library/Frameworks " ,
" -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator " .. iosPlatform .. " .sdk/System/Library/PrivateFrameworks " ,
}
buildoptions {
" -mios-simulator-version-min=7.0 " ,
" -arch i386 " ,
" --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator " .. iosPlatform .. " .sdk " ,
}
2018-02-03 17:39:28 +01:00
configuration { " ios-simulator64 " }
targetdir ( path.join ( _buildDir , " ios-simulator64/bin " ) )
objdir ( path.join ( _buildDir , " ios-simulator64/obj " ) )
libdirs { path.join ( _libDir , " lib/ios-simulator64 " ) }
linkoptions {
" -mios-simulator-version-min=7.0 " ,
" -arch x86_64 " ,
" --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator " .. iosPlatform .. " .sdk " ,
" -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator " .. iosPlatform .. " .sdk/usr/lib/system " ,
" -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator " .. iosPlatform .. " .sdk/System/Library/Frameworks " ,
" -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator " .. iosPlatform .. " .sdk/System/Library/PrivateFrameworks " ,
}
buildoptions {
" -mios-simulator-version-min=7.0 " ,
" -arch x86_64 " ,
" --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator " .. iosPlatform .. " .sdk " ,
}
2016-08-29 22:31:11 +02:00
configuration { " tvos* " }
linkoptions {
" -lc++ " ,
}
buildoptions {
" -Wfatal-errors " ,
" -Wunused-value " ,
" -Wundef " ,
}
includedirs { path.join ( bxDir , " include/compat/ios " ) }
configuration { " xcode4 " , " tvos* " }
targetdir ( path.join ( _buildDir , " tvos-arm64/bin " ) )
objdir ( path.join ( _buildDir , " tvos-arm64/obj " ) )
configuration { " tvos-arm64 " }
targetdir ( path.join ( _buildDir , " tvos-arm64/bin " ) )
objdir ( path.join ( _buildDir , " tvos-arm64/obj " ) )
libdirs { path.join ( _libDir , " lib/tvos-arm64 " ) }
linkoptions {
" -mtvos-version-min=9.0 " ,
" -arch arm64 " ,
" --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS " .. tvosPlatform .. " .sdk " ,
" -L/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS " .. tvosPlatform .. " .sdk/usr/lib/system " ,
" -F/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS " .. tvosPlatform .. " .sdk/System/Library/Frameworks " ,
" -F/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS " .. tvosPlatform .. " .sdk/System/Library/PrivateFrameworks " ,
}
buildoptions {
" -mtvos-version-min=9.0 " ,
" -arch arm64 " ,
" --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS " .. tvosPlatform .. " .sdk " ,
}
configuration { " tvos-simulator " }
targetdir ( path.join ( _buildDir , " tvos-simulator/bin " ) )
objdir ( path.join ( _buildDir , " tvos-simulator/obj " ) )
libdirs { path.join ( _libDir , " lib/tvos-simulator " ) }
linkoptions {
" -mtvos-simulator-version-min=9.0 " ,
" -arch i386 " ,
" --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator " .. tvosPlatform .. " .sdk " ,
" -L/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator " .. tvosPlatform .. " .sdk/usr/lib/system " ,
" -F/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator " .. tvosPlatform .. " .sdk/System/Library/Frameworks " ,
" -F/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator " .. tvosPlatform .. " .sdk/System/Library/PrivateFrameworks " ,
}
buildoptions {
" -mtvos-simulator-version-min=9.0 " ,
" -arch i386 " ,
" --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator " .. tvosPlatform .. " .sdk " ,
}
2016-11-10 21:53:08 +01:00
configuration { " orbis " }
targetdir ( path.join ( _buildDir , " orbis/bin " ) )
objdir ( path.join ( _buildDir , " orbis/obj " ) )
libdirs { path.join ( _libDir , " lib/orbis " ) }
2016-08-29 22:31:11 +02:00
includedirs {
path.join ( bxDir , " include/compat/freebsd " ) ,
2016-11-10 21:53:08 +01:00
" $(SCE_ORBIS_SDK_DIR)/target/include " ,
" $(SCE_ORBIS_SDK_DIR)/target/include_common " ,
2016-08-29 22:31:11 +02:00
}
buildoptions_cpp {
2016-11-10 21:53:08 +01:00
" -std=c++11 " ,
2016-08-29 22:31:11 +02:00
}
configuration { " rpi " }
targetdir ( path.join ( _buildDir , " rpi/bin " ) )
objdir ( path.join ( _buildDir , " rpi/obj " ) )
libdirs {
path.join ( _libDir , " lib/rpi " ) ,
" /opt/vc/lib " ,
}
defines {
" __VCCOREVER__=0x04000000 " , -- There is no special prefedined compiler symbol to detect RaspberryPi, faking it.
" __STDC_VERSION__=199901L " ,
}
buildoptions {
" -Wunused-value " ,
" -Wundef " ,
}
buildoptions_cpp {
2016-11-10 21:53:08 +01:00
" -std=c++11 " ,
2016-08-29 22:31:11 +02:00
}
includedirs {
" /opt/vc/include " ,
" /opt/vc/include/interface/vcos/pthreads " ,
" /opt/vc/include/interface/vmcs_host/linux " ,
}
links {
" rt " ,
2017-04-11 08:16:10 +02:00
" dl " ,
2016-08-29 22:31:11 +02:00
}
linkoptions {
" -Wl,--gc-sections " ,
}
configuration { " riscv " }
targetdir ( path.join ( _buildDir , " riscv/bin " ) )
objdir ( path.join ( _buildDir , " riscv/obj " ) )
2017-04-11 08:16:10 +02:00
defines {
" __BSD_VISIBLE " ,
" __MISC_VISIBLE " ,
}
2016-08-29 22:31:11 +02:00
includedirs {
2017-04-11 08:16:10 +02:00
" $(FREEDOM_E_SDK)/toolchain/riscv32-unknown-elf/include " ,
path.join ( bxDir , " include/compat/riscv " ) ,
2016-08-29 22:31:11 +02:00
}
buildoptions {
" -Wunused-value " ,
" -Wundef " ,
2017-04-11 08:16:10 +02:00
" --sysroot=$(FREEDOM_E_SDK)/toolchain/riscv32-unknown-elf " ,
2016-08-29 22:31:11 +02:00
}
buildoptions_cpp {
2016-11-10 21:53:08 +01:00
" -std=c++11 " ,
2016-08-29 22:31:11 +02:00
}
configuration { } -- reset configuration
return true
end
function strip ( )
configuration { " android-arm " , " Release " }
postbuildcommands {
" $(SILENT) echo Stripping symbols. " ,
" $(SILENT) $(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-strip -s \" $(TARGET) \" "
}
configuration { " android-mips " , " Release " }
postbuildcommands {
" $(SILENT) echo Stripping symbols. " ,
" $(SILENT) $(ANDROID_NDK_MIPS)/bin/mipsel-linux-android-strip -s \" $(TARGET) \" "
}
configuration { " android-x86 " , " Release " }
postbuildcommands {
" $(SILENT) echo Stripping symbols. " ,
" $(SILENT) $(ANDROID_NDK_X86)/bin/i686-linux-android-strip -s \" $(TARGET) \" "
}
configuration { " linux-steamlink " , " Release " }
postbuildcommands {
" $(SILENT) echo Stripping symbols. " ,
" $(SILENT) $(MARVELL_SDK_PATH)/toolchain/bin/armv7a-cros-linux-gnueabi-strip -s \" $(TARGET) \" "
}
configuration { " linux-* or rpi " , " not linux-steamlink " , " Release " }
postbuildcommands {
" $(SILENT) echo Stripping symbols. " ,
" $(SILENT) strip -s \" $(TARGET) \" "
}
configuration { " mingw* " , " Release " }
postbuildcommands {
" $(SILENT) echo Stripping symbols. " ,
" $(SILENT) $(MINGW)/bin/strip -s \" $(TARGET) \" "
}
configuration { " asmjs " }
postbuildcommands {
" $(SILENT) echo Running asmjs finalize. " ,
" $(SILENT) \" $(EMSCRIPTEN)/emcc \" -O2 "
-- .. "-s EMTERPRETIFY=1 "
-- .. "-s EMTERPRETIFY_ASYNC=1 "
.. " -s TOTAL_MEMORY=268435456 "
-- .. "-s ALLOW_MEMORY_GROWTH=1 "
-- .. "-s USE_WEBGL2=1 "
.. " --memory-init-file 1 "
.. " \" $(TARGET) \" -o \" $(TARGET) \" .html "
2018-02-03 17:39:28 +01:00
-- .. "--preload-file ../../../examples/runtime@/ "
.. " -s PRECISE_F32=1 "
2016-08-29 22:31:11 +02:00
}
2017-04-11 09:15:27 +02:00
configuration { " riscv " }
postbuildcommands {
" $(SILENT) echo Stripping symbols. " ,
" $(SILENT) $(FREEDOM_E_SDK)/toolchain/bin/riscv32-unknown-elf-strip -s \" $(TARGET) \" "
}
2016-08-29 22:31:11 +02:00
configuration { } -- reset configuration
end