summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Julian Sikorski <belegdol+github@gmail.com>2019-09-29 15:30:18 +0200
committer R. Belmont <rb6502@users.noreply.github.com>2019-09-29 09:30:18 -0400
commited2b7e5ef1626c0d6318b6ea71897efbb4356277 (patch)
tree62a84a4a2c804922839dbfa60ec664b84beaaee0
parent1bd1288c9e17bdba9544d1e56be7618106fece7e (diff)
Synced with GENie upstream revision e78d6c1 (#5631)
* Synced with GENie upstream revision e78d6c1 * Add Visual Studio 2019 support * Fix hardcoded -m64 * Switch appveyor to Visual Studio 2019 * Fix genie being built as 32-bit * MSVC build is known to be broken currently. Let it fail until all the known issues are fixed. * Update the packages before building * Build with 3 threads Appveyor VMs have only 2 cores and 8 GB RAM. * Enable caching of pacman cache
-rw-r--r--.appveyor.yml29
-rw-r--r--3rdparty/genie/.gitignore1
-rw-r--r--3rdparty/genie/LICENSE5
-rw-r--r--3rdparty/genie/README.md37
-rw-r--r--3rdparty/genie/build/gmake.darwin/genie.make200
-rw-r--r--3rdparty/genie/build/gmake.freebsd/genie.make187
-rw-r--r--3rdparty/genie/build/gmake.linux/genie.make162
-rw-r--r--3rdparty/genie/build/gmake.solaris/genie.make6
-rw-r--r--3rdparty/genie/build/gmake.windows/genie.make162
-rw-r--r--3rdparty/genie/docs/scripting-reference.md482
-rw-r--r--3rdparty/genie/makefile6
-rw-r--r--3rdparty/genie/scripts/genie.lua28
-rw-r--r--3rdparty/genie/src/_manifest.lua13
-rw-r--r--3rdparty/genie/src/actions/cmake/cmake_project.lua7
-rw-r--r--3rdparty/genie/src/actions/fastbuild/fastbuild_project.lua32
-rw-r--r--3rdparty/genie/src/actions/make/_make.lua24
-rw-r--r--3rdparty/genie/src/actions/make/make_cpp.lua136
-rw-r--r--3rdparty/genie/src/actions/make/make_csharp.lua56
-rw-r--r--3rdparty/genie/src/actions/ninja/ninja_base.lua12
-rw-r--r--3rdparty/genie/src/actions/ninja/ninja_cpp.lua162
-rw-r--r--3rdparty/genie/src/actions/qbs/_qbs.lua2
-rw-r--r--3rdparty/genie/src/actions/qbs/qbs_cpp.lua38
-rw-r--r--3rdparty/genie/src/actions/vstudio/_vstudio.lua6
-rw-r--r--3rdparty/genie/src/actions/vstudio/vs2017.lua2
-rw-r--r--3rdparty/genie/src/actions/vstudio/vs2019.lua64
-rw-r--r--3rdparty/genie/src/actions/vstudio/vstudio_solution.lua2
-rw-r--r--3rdparty/genie/src/actions/vstudio/vstudio_vcxproj.lua748
-rw-r--r--3rdparty/genie/src/actions/vstudio/vstudio_vcxproj_filters.lua1
-rw-r--r--3rdparty/genie/src/actions/xcode/_xcode.lua88
-rw-r--r--3rdparty/genie/src/actions/xcode/xcode10.lua116
-rw-r--r--3rdparty/genie/src/actions/xcode/xcode4_workspace.lua100
-rw-r--r--3rdparty/genie/src/actions/xcode/xcode6_config.lua10
-rw-r--r--3rdparty/genie/src/actions/xcode/xcode6_project.lua247
-rw-r--r--3rdparty/genie/src/actions/xcode/xcode8.lua362
-rw-r--r--3rdparty/genie/src/actions/xcode/xcode9.lua107
-rw-r--r--3rdparty/genie/src/actions/xcode/xcode_common.lua726
-rw-r--r--3rdparty/genie/src/actions/xcode/xcode_project.lua71
-rw-r--r--3rdparty/genie/src/actions/xcode/xcode_scheme.lua239
-rw-r--r--3rdparty/genie/src/actions/xcode/xcode_workspace.lua145
-rw-r--r--3rdparty/genie/src/base/action.lua11
-rw-r--r--3rdparty/genie/src/base/api.lua1678
-rw-r--r--3rdparty/genie/src/base/bake.lua25
-rw-r--r--3rdparty/genie/src/base/config.lua33
-rw-r--r--3rdparty/genie/src/base/globals.lua25
-rw-r--r--3rdparty/genie/src/base/io.lua12
-rw-r--r--3rdparty/genie/src/base/os.lua16
-rw-r--r--3rdparty/genie/src/base/path.lua17
-rw-r--r--3rdparty/genie/src/base/premake.lua16
-rw-r--r--3rdparty/genie/src/base/project.lua30
-rw-r--r--3rdparty/genie/src/base/table.lua24
-rw-r--r--3rdparty/genie/src/host/premake.c6
-rw-r--r--3rdparty/genie/src/host/scripts.c508
-rw-r--r--3rdparty/genie/src/host/string_endswith.c6
-rw-r--r--3rdparty/genie/src/tools/dotnet.lua22
-rw-r--r--3rdparty/genie/src/tools/gcc.lua49
-rw-r--r--3rdparty/genie/tests/actions/vstudio/vc2010/test_files.lua11
-rw-r--r--3rdparty/genie/tests/actions/xcode/test_file_references.lua49
-rw-r--r--3rdparty/genie/tests/actions/xcode/test_xcode4_project.lua60
-rw-r--r--3rdparty/genie/tests/actions/xcode/test_xcode4_workspace.lua71
-rw-r--r--3rdparty/genie/tests/actions/xcode/test_xcode_common.lua67
-rw-r--r--3rdparty/genie/tests/actions/xcode/test_xcode_dependencies.lua338
-rw-r--r--3rdparty/genie/tests/actions/xcode/test_xcode_project.lua2025
-rw-r--r--3rdparty/genie/tests/premake4.lua10
-rw-r--r--makefile51
64 files changed, 4942 insertions, 5039 deletions
diff --git a/.appveyor.yml b/.appveyor.yml
index 884f95ae5c0..ff2686d4adc 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -1,9 +1,6 @@
version: 1.0.{build}
image:
-# - Visual Studio 2017
-# - Visual Studio 2017 Preview
- Visual Studio 2019
-# - Previous Visual Studio 2017
shallow_clone: true
clone_depth: 1
@@ -13,32 +10,32 @@ environment:
- BUILD: GCC
- BUILD: MSVC
-matrix:
- exclude:
- - image: Visual Studio 2017 Preview
- BUILD: GCC
- - image: Visual Studio 2019
- BUILD: GCC
- - image: Previous Visual Studio 2017
- BUILD: GCC
-
install:
- set "PATH=C:\msys64\usr\bin;C:\msys64\mingw64\bin;C:\Windows\System32;C:\Windows;%PATH%"
- set MSYSTEM=MINGW64
- set PreferredToolArchitecture=x64
- - cinst windows-sdk-8.1
build_script:
- - bash -lc "exec 0</dev/null && cd $APPVEYOR_BUILD_FOLDER && make SUBTARGET=tiny PTR64=1 TOOLS=1 OPTIMIZE=0 vs2017 -j4"
- - msbuild "build\projects\windows\mametiny\vs2017\mametiny.sln" /m /p:ContinueOnError=false /p:StopOnFirstFailure=true /property:Configuration=Debug /property:Platform=x64 /p:PlatformToolset=v142 /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
+ - bash -lc "exec 0</dev/null && cd $APPVEYOR_BUILD_FOLDER && export MINGW64=/mingw64 && make SUBTARGET=tiny PTR64=1 TOOLS=1 OPTIMIZE=0 vs2019 -j3"
+ - msbuild "build\projects\windows\mametiny\vs2019\mametiny.sln" /m /p:ContinueOnError=false /p:StopOnFirstFailure=true /property:Configuration=Debug /property:Platform=x64 /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
+
+matrix:
+ allow_failures:
+ - BUILD: MSVC
for:
-
matrix:
only:
- BUILD: GCC
+ cache:
+ - C:\msys64\var\cache\pacman\pkg
+ install:
+ - set "PATH=C:\msys64\usr\bin;C:\msys64\mingw64\bin;C:\Windows\System32;C:\Windows;%PATH%"
+ - set MSYSTEM=MINGW64
+ - bash -lc "pacman -Syu --noconfirm"
build_script:
- - bash -lc "exec 0</dev/null && cd $APPVEYOR_BUILD_FOLDER && export MINGW64=/mingw64 && make SUBTARGET=tiny PTR64=1 OPTIMIZE=0 ARCHOPTS=-Wa,-mbig-obj IGNORE_GIT=1 -j4"
+ - bash -lc "exec 0</dev/null && cd $APPVEYOR_BUILD_FOLDER && export MINGW64=/mingw64 && make SUBTARGET=tiny PTR64=1 OPTIMIZE=0 ARCHOPTS=-Wa,-mbig-obj IGNORE_GIT=1 -j3"
test_script:
- \projects\mame\mametiny64.exe -validate
after_test:
diff --git a/3rdparty/genie/.gitignore b/3rdparty/genie/.gitignore
index e089800419f..1b7b8c022a0 100644
--- a/3rdparty/genie/.gitignore
+++ b/3rdparty/genie/.gitignore
@@ -1,3 +1,4 @@
+.build
bin
build/*/obj
src/host/scripts.c
diff --git a/3rdparty/genie/LICENSE b/3rdparty/genie/LICENSE
index a48450143c5..c82bd9f6adf 100644
--- a/3rdparty/genie/LICENSE
+++ b/3rdparty/genie/LICENSE
@@ -1,11 +1,12 @@
# GENie
GENie
-Copyright (c) 2014-2016 Branimir Karadžić, Neil Richardson, Mike Popoloski,
+Copyright (c) 2014-2018 Branimir Karadžić, Neil Richardson, Mike Popoloski,
Drew Solomon, Ted de Munnik, Miodrag Milanović, Brett Vickers, Bill Freist,
Terry Hendrix II, Ryan Juckett, Andrew Johnson, Johan Sköld,
Alastair Murray, Patrick Munns, Jan-Eric Duden, Phil Stevens, Stuart Carnie,
-Nikolay Aleksiev, Jon Olson, Mike Fitzgerald.
+Nikolay Aleksiev, Jon Olson, Mike Fitzgerald, Anders Stenberg, Violets,
+Hugo Amnov, Christian Helmich.
All rights reserved.
https://github.com/bkaradzic/genie
diff --git a/3rdparty/genie/README.md b/3rdparty/genie/README.md
index 82f5a7d0060..224ed480dc6 100644
--- a/3rdparty/genie/README.md
+++ b/3rdparty/genie/README.md
@@ -13,7 +13,7 @@ Supported project generators:
* GNU Makefile
* Ninja (experimental)
* Qbs / QtCreator (experimental)
- * Visual Studio 2008, 2010, 2012, 2013, 2015, 2017
+ * Visual Studio 2010, 2012, 2013, 2015, 2017, 2019
* XCode
Download (stable)
@@ -21,7 +21,7 @@ Download (stable)
[![Build Status](https://travis-ci.org/bkaradzic/GENie.svg?branch=master)](https://travis-ci.org/bkaradzic/GENie)
- version 849 (commit f3788f8531e75ddde92df41ecc1ccdb34f1d75ff)
+ version 1095 (commit f0b68ba0490458bbf0a556bb64575a22a27b7f11)
Linux:
https://github.com/bkaradzic/bx/raw/master/tools/bin/linux/genie
@@ -117,6 +117,28 @@ of Premake 4.4 beta 5, and there is no intention to keep it compatible with it.
- Added `removeplatforms` that removes VS build target platforms.
- Added `PedanticWarnings` flag.
- Added `ObjcARC` flag to enable automatic reference counting for Objective-C(++).
+ - Added `iostargetplatformversion`, `macostargetplatformversion`, and
+ `tvostargetplatformversion` to specify XCode OS target version.
+ - Removed the `xcode3`, and `xcode4` actions.
+ - Added the `xcode8`, `xcode9`, and `xcode10` actions.
+ - Added `systemincludedirs` that are always searched after directories added
+ using `includedirs`.
+ - Added `NoRuntimeChecks` flag to disable Basic Runtime Checks in non-optimized
+ Visual Studio builds.
+ - Added support for Nintendo Switch projects.
+ - Added flags for selecting C++ standard: `Cpp11`, `Cpp14`, `Cpp17`,
+ and `CppLatest`.
+ - Added `xcodeprojectopts` and `xcodetargetopts`.
+ - Added vs2019 support.
+ - Added UnitySupport flag to enable Unity (Jumbo) builds in Visual Studio 2019
+
+build - GENie build system scripts
+----------------------------------
+
+build is a set of build system scripts and related tools, built around
+GENie project generator tool.
+
+https://milostosic.github.io/build/
Debugging GENie scripts
-----------------------
@@ -172,18 +194,23 @@ https://github.com/andr3wmac/Torque6 Torque 6 is an MIT licensed 3D engine
loosely based on Torque2D. Being neither Torque2D or Torque3D it is the 6th
derivative of the original Torque Engine.
-http://mtuner.net/ is a memory profiler and memory leak finder for Windows, PS4,
+https://milostosic.github.io/MTuner MTuner is a memory profiler and memory leak finder for Windows, PS4,
PS3.
+Developer Crackshell used GENie for development of games
+[Heroes of Hammerwatch](http://store.steampowered.com/app/677120/Heroes_of_Hammerwatch/), and
+[Serious Sam's Bogus Detour](http://store.steampowered.com/app/272620/Serious_Sams_Bogus_Detour/).
+
[License](https://github.com/bkaradzic/genie/blob/master/LICENSE)
-----------------------------------------------------------------
GENie
- Copyright (c) 2014-2016 Branimir Karadžić, Neil Richardson, Mike Popoloski,
+ Copyright (c) 2014-2018 Branimir Karadžić, Neil Richardson, Mike Popoloski,
Drew Solomon, Ted de Munnik, Miodrag Milanović, Brett Vickers, Bill Freist,
Terry Hendrix II, Ryan Juckett, Andrew Johnson, Johan Sköld,
Alastair Murray, Patrick Munns, Jan-Eric Duden, Phil Stevens, Stuart Carnie,
- Nikolay Aleksiev, Jon Olson, Mike Fitzgerald.
+ Nikolay Aleksiev, Jon Olson, Mike Fitzgerald, Anders Stenberg, Violets,
+ Hugo Amnov, Christian Helmich.
All rights reserved.
https://github.com/bkaradzic/genie
diff --git a/3rdparty/genie/build/gmake.darwin/genie.make b/3rdparty/genie/build/gmake.darwin/genie.make
index f8fc95a7e47..81e820505cb 100644
--- a/3rdparty/genie/build/gmake.darwin/genie.make
+++ b/3rdparty/genie/build/gmake.darwin/genie.make
@@ -48,19 +48,22 @@ ifeq ($(config),release)
override TARGET = $(TARGETDIR)/genie
DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE -DLUA_USE_MACOSX
INCLUDES += -I"../../src/host/lua-5.3.0/src"
- INCLUDES +=
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -MP $(DEFINES) $(INCLUDES)
- ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -mmacosx-version-min=10.6
- ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -mmacosx-version-min=10.6
- ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -mmacosx-version-min=10.6
- ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -mmacosx-version-min=10.6
- ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -mmacosx-version-min=10.6
+ ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -mmacosx-version-min=10.6
+ ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -mmacosx-version-min=10.6
+ ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -mmacosx-version-min=10.6
+ ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -mmacosx-version-min=10.6
+ ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -mmacosx-version-min=10.6
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
- ALL_LDFLAGS += $(LDFLAGS) -L. -mmacosx-version-min=10.6
+ ALL_LDFLAGS += $(LDFLAGS) -L"." -mmacosx-version-min=10.6
+ LIBDEPS +=
LDDEPS +=
+ LDRESP =
LIBS += $(LDDEPS) -framework CoreServices
EXTERNAL_LIBS +=
- LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
+ LINKOBJS = $(OBJECTS)
+ LINKCMD = $(CC) -o $(TARGET) $(LINKOBJS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
+ OBJRESP =
OBJECTS := \
$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \
$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \
@@ -132,19 +135,22 @@ ifeq ($(config),debug)
override TARGET = $(TARGETDIR)/genie
DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE -DLUA_USE_MACOSX
INCLUDES += -I"../../src/host/lua-5.3.0/src"
- INCLUDES +=
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -MP $(DEFINES) $(INCLUDES)
- ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -mmacosx-version-min=10.6
- ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -mmacosx-version-min=10.6
- ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -mmacosx-version-min=10.6
- ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -mmacosx-version-min=10.6
- ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -mmacosx-version-min=10.6
+ ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM) -mmacosx-version-min=10.6
+ ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM) -mmacosx-version-min=10.6
+ ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM) -mmacosx-version-min=10.6
+ ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM) -mmacosx-version-min=10.6
+ ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM) -mmacosx-version-min=10.6
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
- ALL_LDFLAGS += $(LDFLAGS) -L. -mmacosx-version-min=10.6
+ ALL_LDFLAGS += $(LDFLAGS) -L"." -mmacosx-version-min=10.6
+ LIBDEPS +=
LDDEPS +=
+ LDRESP =
LIBS += $(LDDEPS) -framework CoreServices
EXTERNAL_LIBS +=
- LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
+ LINKOBJS = $(OBJECTS)
+ LINKCMD = $(CC) -o $(TARGET) $(LINKOBJS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
+ OBJRESP =
OBJECTS := \
$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \
$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \
@@ -217,19 +223,22 @@ ifeq ($(config),releaseuniv32)
override TARGET = $(TARGETDIR)/genie
DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE -DLUA_USE_MACOSX
INCLUDES += -I"../../src/host/lua-5.3.0/src"
- INCLUDES +=
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -MP $(DEFINES) $(INCLUDES)
- ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc -mmacosx-version-min=10.4
- ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc -mmacosx-version-min=10.4
- ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc -mmacosx-version-min=10.4
- ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc -mmacosx-version-min=10.4
- ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc -mmacosx-version-min=10.4
+ ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc $(MPARAM) -mmacosx-version-min=10.6
+ ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc $(MPARAM) -mmacosx-version-min=10.6
+ ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc $(MPARAM) -mmacosx-version-min=10.6
+ ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc $(MPARAM) -mmacosx-version-min=10.6
+ ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc $(MPARAM) -mmacosx-version-min=10.6
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
- ALL_LDFLAGS += $(LDFLAGS) -L. -arch i386 -arch ppc -mmacosx-version-min=10.4
+ ALL_LDFLAGS += $(LDFLAGS) -L"." -arch i386 -arch ppc -mmacosx-version-min=10.6
+ LIBDEPS +=
LDDEPS +=
+ LDRESP =
LIBS += $(LDDEPS) -framework CoreServices
EXTERNAL_LIBS +=
- LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
+ LINKOBJS = $(OBJECTS)
+ LINKCMD = $(CC) -o $(TARGET) $(LINKOBJS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
+ OBJRESP =
OBJECTS := \
$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \
$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \
@@ -302,19 +311,22 @@ ifeq ($(config),debuguniv32)
override TARGET = $(TARGETDIR)/genie
DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE -DLUA_USE_MACOSX
INCLUDES += -I"../../src/host/lua-5.3.0/src"
- INCLUDES +=
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -MP $(DEFINES) $(INCLUDES)
- ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc -mmacosx-version-min=10.4
- ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc -mmacosx-version-min=10.4
- ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc -mmacosx-version-min=10.4
- ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc -mmacosx-version-min=10.4
- ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc -mmacosx-version-min=10.4
+ ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc $(MPARAM) -mmacosx-version-min=10.6
+ ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc $(MPARAM) -mmacosx-version-min=10.6
+ ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc $(MPARAM) -mmacosx-version-min=10.6
+ ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc $(MPARAM) -mmacosx-version-min=10.6
+ ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc $(MPARAM) -mmacosx-version-min=10.6
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
- ALL_LDFLAGS += $(LDFLAGS) -L. -arch i386 -arch ppc -mmacosx-version-min=10.4
+ ALL_LDFLAGS += $(LDFLAGS) -L"." -arch i386 -arch ppc -mmacosx-version-min=10.6
+ LIBDEPS +=
LDDEPS +=
+ LDRESP =
LIBS += $(LDDEPS) -framework CoreServices
EXTERNAL_LIBS +=
- LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
+ LINKOBJS = $(OBJECTS)
+ LINKCMD = $(CC) -o $(TARGET) $(LINKOBJS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
+ OBJRESP =
OBJECTS := \
$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \
$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \
@@ -392,7 +404,7 @@ RESOURCES := \
all: $(OBJDIRS) $(TARGETDIR) prebuild prelink $(TARGET)
@:
-$(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(EXTERNAL_LIBS) $(RESOURCES) | $(TARGETDIR) $(OBJDIRS)
+$(TARGET): $(GCH) $(OBJECTS) $(LIBDEPS) $(EXTERNAL_LIBS) $(RESOURCES) $(OBJRESP) $(LDRESP) | $(TARGETDIR) $(OBJDIRS)
@echo Linking genie
$(SILENT) $(LINKCMD)
$(POSTBUILDCMDS)
@@ -431,223 +443,235 @@ $(GCH_OBJC): $(PCH) $(MAKEFILE) | $(OBJDIR)
$(SILENT) $(CC) $(ALL_OBJCFLAGS) -x objective-c-header $(DEFINES) $(INCLUDES) -o "$@" -c "$<"
endif
-$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o: ../../src/host/lua-5.3.0/src/lapi.c $(GCH) $(MAKEFILE)
+ifneq (,$(OBJRESP))
+$(OBJRESP): $(OBJECTS) | $(TARGETDIR) $(OBJDIRS)
+ $(SILENT) echo $^
+ $(SILENT) echo $^ > $@
+endif
+
+ifneq (,$(LDRESP))
+$(LDRESP): $(LDDEPS) | $(TARGETDIR) $(OBJDIRS)
+ $(SILENT) echo $^
+ $(SILENT) echo $^ > $@
+endif
+
+$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o: ../../src/host/lua-5.3.0/src/lapi.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o: ../../src/host/lua-5.3.0/src/lauxlib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o: ../../src/host/lua-5.3.0/src/lauxlib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o: ../../src/host/lua-5.3.0/src/lbaselib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o: ../../src/host/lua-5.3.0/src/lbaselib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o: ../../src/host/lua-5.3.0/src/lbitlib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o: ../../src/host/lua-5.3.0/src/lbitlib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lcode.o: ../../src/host/lua-5.3.0/src/lcode.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lcode.o: ../../src/host/lua-5.3.0/src/lcode.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o: ../../src/host/lua-5.3.0/src/lcorolib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o: ../../src/host/lua-5.3.0/src/lcorolib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lctype.o: ../../src/host/lua-5.3.0/src/lctype.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lctype.o: ../../src/host/lua-5.3.0/src/lctype.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o: ../../src/host/lua-5.3.0/src/ldblib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o: ../../src/host/lua-5.3.0/src/ldblib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o: ../../src/host/lua-5.3.0/src/ldebug.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o: ../../src/host/lua-5.3.0/src/ldebug.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ldo.o: ../../src/host/lua-5.3.0/src/ldo.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/ldo.o: ../../src/host/lua-5.3.0/src/ldo.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ldump.o: ../../src/host/lua-5.3.0/src/ldump.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/ldump.o: ../../src/host/lua-5.3.0/src/ldump.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o: ../../src/host/lua-5.3.0/src/lfunc.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o: ../../src/host/lua-5.3.0/src/lfunc.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lgc.o: ../../src/host/lua-5.3.0/src/lgc.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lgc.o: ../../src/host/lua-5.3.0/src/lgc.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/linit.o: ../../src/host/lua-5.3.0/src/linit.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/linit.o: ../../src/host/lua-5.3.0/src/linit.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/liolib.o: ../../src/host/lua-5.3.0/src/liolib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/liolib.o: ../../src/host/lua-5.3.0/src/liolib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/llex.o: ../../src/host/lua-5.3.0/src/llex.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/llex.o: ../../src/host/lua-5.3.0/src/llex.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o: ../../src/host/lua-5.3.0/src/lmathlib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o: ../../src/host/lua-5.3.0/src/lmathlib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lmem.o: ../../src/host/lua-5.3.0/src/lmem.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lmem.o: ../../src/host/lua-5.3.0/src/lmem.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o: ../../src/host/lua-5.3.0/src/loadlib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o: ../../src/host/lua-5.3.0/src/loadlib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lobject.o: ../../src/host/lua-5.3.0/src/lobject.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lobject.o: ../../src/host/lua-5.3.0/src/lobject.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o: ../../src/host/lua-5.3.0/src/lopcodes.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o: ../../src/host/lua-5.3.0/src/lopcodes.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/loslib.o: ../../src/host/lua-5.3.0/src/loslib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/loslib.o: ../../src/host/lua-5.3.0/src/loslib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lparser.o: ../../src/host/lua-5.3.0/src/lparser.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lparser.o: ../../src/host/lua-5.3.0/src/lparser.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lstate.o: ../../src/host/lua-5.3.0/src/lstate.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lstate.o: ../../src/host/lua-5.3.0/src/lstate.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lstring.o: ../../src/host/lua-5.3.0/src/lstring.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lstring.o: ../../src/host/lua-5.3.0/src/lstring.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o: ../../src/host/lua-5.3.0/src/lstrlib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o: ../../src/host/lua-5.3.0/src/lstrlib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ltable.o: ../../src/host/lua-5.3.0/src/ltable.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/ltable.o: ../../src/host/lua-5.3.0/src/ltable.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o: ../../src/host/lua-5.3.0/src/ltablib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o: ../../src/host/lua-5.3.0/src/ltablib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ltm.o: ../../src/host/lua-5.3.0/src/ltm.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/ltm.o: ../../src/host/lua-5.3.0/src/ltm.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lundump.o: ../../src/host/lua-5.3.0/src/lundump.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lundump.o: ../../src/host/lua-5.3.0/src/lundump.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o: ../../src/host/lua-5.3.0/src/lutf8lib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o: ../../src/host/lua-5.3.0/src/lutf8lib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lvm.o: ../../src/host/lua-5.3.0/src/lvm.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lvm.o: ../../src/host/lua-5.3.0/src/lvm.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lzio.o: ../../src/host/lua-5.3.0/src/lzio.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lzio.o: ../../src/host/lua-5.3.0/src/lzio.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_chdir.o: ../../src/host/os_chdir.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_chdir.o: ../../src/host/os_chdir.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_copyfile.o: ../../src/host/os_copyfile.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_copyfile.o: ../../src/host/os_copyfile.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_isdir.o: ../../src/host/os_isdir.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_isdir.o: ../../src/host/os_isdir.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_isfile.o: ../../src/host/os_isfile.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_isfile.o: ../../src/host/os_isfile.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_stat.o: ../../src/host/os_stat.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_stat.o: ../../src/host/os_stat.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_ticks.o: ../../src/host/os_ticks.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_ticks.o: ../../src/host/os_ticks.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_uuid.o: ../../src/host/os_uuid.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_uuid.o: ../../src/host/os_uuid.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/path_getabsolute.o: ../../src/host/path_getabsolute.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/path_getabsolute.o: ../../src/host/path_getabsolute.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/path_getrelative.o: ../../src/host/path_getrelative.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/path_getrelative.o: ../../src/host/path_getrelative.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/path_helpers.o: ../../src/host/path_helpers.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/path_helpers.o: ../../src/host/path_helpers.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/premake.o: ../../src/host/premake.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/premake.o: ../../src/host/premake.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/premake_main.o: ../../src/host/premake_main.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/premake_main.o: ../../src/host/premake_main.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/scripts.o: ../../src/host/scripts.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/scripts.o: ../../src/host/scripts.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/string_endswith.o: ../../src/host/string_endswith.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/string_endswith.o: ../../src/host/string_endswith.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
diff --git a/3rdparty/genie/build/gmake.freebsd/genie.make b/3rdparty/genie/build/gmake.freebsd/genie.make
index f288aab8cc4..3ee72460742 100644
--- a/3rdparty/genie/build/gmake.freebsd/genie.make
+++ b/3rdparty/genie/build/gmake.freebsd/genie.make
@@ -40,23 +40,26 @@ ifndef RESCOMP
endif
endif
+MAKEFILE = genie.make
+
ifeq ($(config),release)
- OBJDIR = obj/Release
- TARGETDIR = ../../bin/bsd
- override TARGET = $(TARGETDIR)/genie
- DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE -DLUA_USE_POSIX -DLUA_USE_DLOPEN
- INCLUDES += -I../../src/host/lua-5.3.0/src
- INCLUDES +=
- ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -MP $(DEFINES) $(INCLUDES)
- ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os
- ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os
- ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os
- ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
- ALL_LDFLAGS += $(LDFLAGS) -L. -s -rdynamic
- LDDEPS +=
- LIBS += $(LDDEPS) -lm
- EXTERNAL_LIBS +=
- LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
+ OBJDIR = obj/Release
+ TARGETDIR = ../../bin/bsd
+ override TARGET = $(TARGETDIR)/genie
+ DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE -DLUA_USE_POSIX -DLUA_USE_DLOPEN
+ INCLUDES += -I"../../src/host/lua-5.3.0/src"
+ ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -MP $(DEFINES) $(INCLUDES)
+ ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM)
+ ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM)
+ ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM)
+ ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM)
+ ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM)
+ ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
+ ALL_LDFLAGS += $(LDFLAGS) -L. -s -rdynamic
+ LDDEPS +=
+ LIBS += $(LDDEPS) -lm
+ EXTERNAL_LIBS +=
+ LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
OBJECTS := \
$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \
$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \
@@ -123,22 +126,23 @@ ifeq ($(config),release)
endif
ifeq ($(config),debug)
- OBJDIR = obj/Debug
- TARGETDIR = ../../bin/bsd
- override TARGET = $(TARGETDIR)/genie
- DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE -DLUA_USE_POSIX -DLUA_USE_DLOPEN
- INCLUDES += -I../../src/host/lua-5.3.0/src
- INCLUDES +=
- ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -MP $(DEFINES) $(INCLUDES)
- ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
- ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
- ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
- ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
- ALL_LDFLAGS += $(LDFLAGS) -L. -rdynamic
- LDDEPS +=
- LIBS += $(LDDEPS) -lm
- EXTERNAL_LIBS +=
- LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
+ OBJDIR = obj/Debug
+ TARGETDIR = ../../bin/bsd
+ override TARGET = $(TARGETDIR)/genie
+ DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE -DLUA_USE_POSIX -DLUA_USE_DLOPEN
+ INCLUDES += -I"../../src/host/lua-5.3.0/src"
+ ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -MP $(DEFINES) $(INCLUDES)
+ ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
+ ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
+ ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
+ ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
+ ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
+ ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
+ ALL_LDFLAGS += $(LDFLAGS) -L. -rdynamic
+ LDDEPS +=
+ LIBS += $(LDDEPS) -lm
+ EXTERNAL_LIBS +=
+ LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
OBJECTS := \
$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \
$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \
@@ -213,7 +217,7 @@ RESOURCES := \
.PHONY: clean prebuild prelink
-all: $(OBJDIRS) prebuild prelink $(TARGET) | $(TARGETDIR)
+all: $(OBJDIRS) $(TARGETDIR) prebuild prelink $(TARGET)
@:
$(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(EXTERNAL_LIBS) $(RESOURCES) | $(TARGETDIR) $(OBJDIRS)
@@ -246,232 +250,237 @@ prelink:
$(PRELINKCMDS)
ifneq (,$(PCH))
-$(GCH): $(PCH) | $(OBJDIR)
+$(GCH): $(PCH) $(MAKEFILE) | $(OBJDIR)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) -x c-header $(DEFINES) $(INCLUDES) -o "$@" -c "$<"
+
+$(GCH_OBJC): $(PCH) $(MAKEFILE) | $(OBJDIR)
+ @echo $(notdir $<)
+ $(SILENT) $(CC) $(ALL_OBJCFLAGS) -x objective-c-header $(DEFINES) $(INCLUDES) -o "$@" -c "$<"
endif
-$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o: ../../src/host/lua-5.3.0/src/lapi.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o: ../../src/host/lua-5.3.0/src/lapi.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o: ../../src/host/lua-5.3.0/src/lauxlib.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o: ../../src/host/lua-5.3.0/src/lauxlib.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o: ../../src/host/lua-5.3.0/src/lbaselib.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o: ../../src/host/lua-5.3.0/src/lbaselib.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o: ../../src/host/lua-5.3.0/src/lbitlib.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o: ../../src/host/lua-5.3.0/src/lbitlib.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lcode.o: ../../src/host/lua-5.3.0/src/lcode.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/lcode.o: ../../src/host/lua-5.3.0/src/lcode.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o: ../../src/host/lua-5.3.0/src/lcorolib.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o: ../../src/host/lua-5.3.0/src/lcorolib.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lctype.o: ../../src/host/lua-5.3.0/src/lctype.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/lctype.o: ../../src/host/lua-5.3.0/src/lctype.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o: ../../src/host/lua-5.3.0/src/ldblib.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o: ../../src/host/lua-5.3.0/src/ldblib.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o: ../../src/host/lua-5.3.0/src/ldebug.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o: ../../src/host/lua-5.3.0/src/ldebug.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ldo.o: ../../src/host/lua-5.3.0/src/ldo.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/ldo.o: ../../src/host/lua-5.3.0/src/ldo.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ldump.o: ../../src/host/lua-5.3.0/src/ldump.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/ldump.o: ../../src/host/lua-5.3.0/src/ldump.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o: ../../src/host/lua-5.3.0/src/lfunc.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o: ../../src/host/lua-5.3.0/src/lfunc.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lgc.o: ../../src/host/lua-5.3.0/src/lgc.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/lgc.o: ../../src/host/lua-5.3.0/src/lgc.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/linit.o: ../../src/host/lua-5.3.0/src/linit.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/linit.o: ../../src/host/lua-5.3.0/src/linit.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/liolib.o: ../../src/host/lua-5.3.0/src/liolib.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/liolib.o: ../../src/host/lua-5.3.0/src/liolib.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/llex.o: ../../src/host/lua-5.3.0/src/llex.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/llex.o: ../../src/host/lua-5.3.0/src/llex.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o: ../../src/host/lua-5.3.0/src/lmathlib.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o: ../../src/host/lua-5.3.0/src/lmathlib.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lmem.o: ../../src/host/lua-5.3.0/src/lmem.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/lmem.o: ../../src/host/lua-5.3.0/src/lmem.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o: ../../src/host/lua-5.3.0/src/loadlib.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o: ../../src/host/lua-5.3.0/src/loadlib.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lobject.o: ../../src/host/lua-5.3.0/src/lobject.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/lobject.o: ../../src/host/lua-5.3.0/src/lobject.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o: ../../src/host/lua-5.3.0/src/lopcodes.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o: ../../src/host/lua-5.3.0/src/lopcodes.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/loslib.o: ../../src/host/lua-5.3.0/src/loslib.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/loslib.o: ../../src/host/lua-5.3.0/src/loslib.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lparser.o: ../../src/host/lua-5.3.0/src/lparser.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/lparser.o: ../../src/host/lua-5.3.0/src/lparser.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lstate.o: ../../src/host/lua-5.3.0/src/lstate.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/lstate.o: ../../src/host/lua-5.3.0/src/lstate.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lstring.o: ../../src/host/lua-5.3.0/src/lstring.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/lstring.o: ../../src/host/lua-5.3.0/src/lstring.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o: ../../src/host/lua-5.3.0/src/lstrlib.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o: ../../src/host/lua-5.3.0/src/lstrlib.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ltable.o: ../../src/host/lua-5.3.0/src/ltable.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/ltable.o: ../../src/host/lua-5.3.0/src/ltable.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o: ../../src/host/lua-5.3.0/src/ltablib.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o: ../../src/host/lua-5.3.0/src/ltablib.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ltm.o: ../../src/host/lua-5.3.0/src/ltm.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/ltm.o: ../../src/host/lua-5.3.0/src/ltm.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lundump.o: ../../src/host/lua-5.3.0/src/lundump.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/lundump.o: ../../src/host/lua-5.3.0/src/lundump.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o: ../../src/host/lua-5.3.0/src/lutf8lib.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o: ../../src/host/lua-5.3.0/src/lutf8lib.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lvm.o: ../../src/host/lua-5.3.0/src/lvm.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/lvm.o: ../../src/host/lua-5.3.0/src/lvm.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lzio.o: ../../src/host/lua-5.3.0/src/lzio.c $(GCH) genie.make
+$(OBJDIR)/src/host/lua-5.3.0/src/lzio.o: ../../src/host/lua-5.3.0/src/lzio.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_chdir.o: ../../src/host/os_chdir.c $(GCH) genie.make
+$(OBJDIR)/src/host/os_chdir.o: ../../src/host/os_chdir.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_copyfile.o: ../../src/host/os_copyfile.c $(GCH) genie.make
+$(OBJDIR)/src/host/os_copyfile.o: ../../src/host/os_copyfile.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c $(GCH) genie.make
+$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c $(GCH) genie.make
+$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_isdir.o: ../../src/host/os_isdir.c $(GCH) genie.make
+$(OBJDIR)/src/host/os_isdir.o: ../../src/host/os_isdir.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_isfile.o: ../../src/host/os_isfile.c $(GCH) genie.make
+$(OBJDIR)/src/host/os_isfile.o: ../../src/host/os_isfile.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c $(GCH) genie.make
+$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c $(GCH) genie.make
+$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.c $(GCH) genie.make
+$(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c $(GCH) genie.make
+$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_stat.o: ../../src/host/os_stat.c $(GCH) genie.make
+$(OBJDIR)/src/host/os_stat.o: ../../src/host/os_stat.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_ticks.o: ../../src/host/os_ticks.c $(GCH) genie.make
+$(OBJDIR)/src/host/os_ticks.o: ../../src/host/os_ticks.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_uuid.o: ../../src/host/os_uuid.c $(GCH) genie.make
+$(OBJDIR)/src/host/os_uuid.o: ../../src/host/os_uuid.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/path_getabsolute.o: ../../src/host/path_getabsolute.c $(GCH) genie.make
+$(OBJDIR)/src/host/path_getabsolute.o: ../../src/host/path_getabsolute.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/path_getrelative.o: ../../src/host/path_getrelative.c $(GCH) genie.make
+$(OBJDIR)/src/host/path_getrelative.o: ../../src/host/path_getrelative.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/path_helpers.o: ../../src/host/path_helpers.c $(GCH) genie.make
+$(OBJDIR)/src/host/path_helpers.o: ../../src/host/path_helpers.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c $(GCH) genie.make
+$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/premake.o: ../../src/host/premake.c $(GCH) genie.make
+$(OBJDIR)/src/host/premake.o: ../../src/host/premake.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/premake_main.o: ../../src/host/premake_main.c $(GCH) genie.make
+$(OBJDIR)/src/host/premake_main.o: ../../src/host/premake_main.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/scripts.o: ../../src/host/scripts.c $(GCH) genie.make
+$(OBJDIR)/src/host/scripts.o: ../../src/host/scripts.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/string_endswith.o: ../../src/host/string_endswith.c $(GCH) genie.make
+$(OBJDIR)/src/host/string_endswith.o: ../../src/host/string_endswith.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c $(GCH) genie.make
+$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c $(GCH) $(MAKEFILE)
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-include $(OBJECTS:%.o=%.d)
ifneq (,$(PCH))
-include $(OBJDIR)/$(notdir $(PCH)).d
+ -include $(OBJDIR)/$(notdir $(PCH))_objc.d
endif
diff --git a/3rdparty/genie/build/gmake.linux/genie.make b/3rdparty/genie/build/gmake.linux/genie.make
index 859189868cc..fbb65308854 100644
--- a/3rdparty/genie/build/gmake.linux/genie.make
+++ b/3rdparty/genie/build/gmake.linux/genie.make
@@ -48,19 +48,22 @@ ifeq ($(config),release)
override TARGET = $(TARGETDIR)/genie
DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE -DLUA_USE_POSIX -DLUA_USE_DLOPEN
INCLUDES += -I"../../src/host/lua-5.3.0/src"
- INCLUDES +=
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -MP $(DEFINES) $(INCLUDES)
- ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os
- ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os
- ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os
- ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os
- ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os
+ ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -Wno-implicit-fallthrough
+ ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -Wno-implicit-fallthrough
+ ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -Wno-implicit-fallthrough
+ ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -Wno-implicit-fallthrough
+ ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -Wno-implicit-fallthrough
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
- ALL_LDFLAGS += $(LDFLAGS) -L. -s -rdynamic
+ ALL_LDFLAGS += $(LDFLAGS) -L"." -s -rdynamic
+ LIBDEPS +=
LDDEPS +=
+ LDRESP =
LIBS += $(LDDEPS) -ldl -lm
EXTERNAL_LIBS +=
- LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
+ LINKOBJS = $(OBJECTS)
+ LINKCMD = $(CC) -o $(TARGET) $(LINKOBJS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
+ OBJRESP =
OBJECTS := \
$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \
$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \
@@ -132,19 +135,22 @@ ifeq ($(config),debug)
override TARGET = $(TARGETDIR)/genie
DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE -DLUA_USE_POSIX -DLUA_USE_DLOPEN
INCLUDES += -I"../../src/host/lua-5.3.0/src"
- INCLUDES +=
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -MP $(DEFINES) $(INCLUDES)
- ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
- ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
- ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
- ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
- ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
+ ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM) -Wno-implicit-fallthrough
+ ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM) -Wno-implicit-fallthrough
+ ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM) -Wno-implicit-fallthrough
+ ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM) -Wno-implicit-fallthrough
+ ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM) -Wno-implicit-fallthrough
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
- ALL_LDFLAGS += $(LDFLAGS) -L. -rdynamic
+ ALL_LDFLAGS += $(LDFLAGS) -L"." -rdynamic
+ LIBDEPS +=
LDDEPS +=
+ LDRESP =
LIBS += $(LDDEPS) -ldl -lm
EXTERNAL_LIBS +=
- LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
+ LINKOBJS = $(OBJECTS)
+ LINKCMD = $(CC) -o $(TARGET) $(LINKOBJS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
+ OBJRESP =
OBJECTS := \
$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \
$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \
@@ -222,7 +228,7 @@ RESOURCES := \
all: $(OBJDIRS) $(TARGETDIR) prebuild prelink $(TARGET)
@:
-$(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(EXTERNAL_LIBS) $(RESOURCES) | $(TARGETDIR) $(OBJDIRS)
+$(TARGET): $(GCH) $(OBJECTS) $(LIBDEPS) $(EXTERNAL_LIBS) $(RESOURCES) $(OBJRESP) $(LDRESP) | $(TARGETDIR) $(OBJDIRS)
@echo Linking genie
$(SILENT) $(LINKCMD)
$(POSTBUILDCMDS)
@@ -261,223 +267,235 @@ $(GCH_OBJC): $(PCH) $(MAKEFILE) | $(OBJDIR)
$(SILENT) $(CC) $(ALL_OBJCFLAGS) -x objective-c-header $(DEFINES) $(INCLUDES) -o "$@" -c "$<"
endif
-$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o: ../../src/host/lua-5.3.0/src/lapi.c $(GCH) $(MAKEFILE)
+ifneq (,$(OBJRESP))
+$(OBJRESP): $(OBJECTS) | $(TARGETDIR) $(OBJDIRS)
+ $(SILENT) echo $^
+ $(SILENT) echo $^ > $@
+endif
+
+ifneq (,$(LDRESP))
+$(LDRESP): $(LDDEPS) | $(TARGETDIR) $(OBJDIRS)
+ $(SILENT) echo $^
+ $(SILENT) echo $^ > $@
+endif
+
+$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o: ../../src/host/lua-5.3.0/src/lapi.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o: ../../src/host/lua-5.3.0/src/lauxlib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o: ../../src/host/lua-5.3.0/src/lauxlib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o: ../../src/host/lua-5.3.0/src/lbaselib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o: ../../src/host/lua-5.3.0/src/lbaselib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o: ../../src/host/lua-5.3.0/src/lbitlib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o: ../../src/host/lua-5.3.0/src/lbitlib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lcode.o: ../../src/host/lua-5.3.0/src/lcode.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lcode.o: ../../src/host/lua-5.3.0/src/lcode.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o: ../../src/host/lua-5.3.0/src/lcorolib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o: ../../src/host/lua-5.3.0/src/lcorolib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lctype.o: ../../src/host/lua-5.3.0/src/lctype.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lctype.o: ../../src/host/lua-5.3.0/src/lctype.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o: ../../src/host/lua-5.3.0/src/ldblib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o: ../../src/host/lua-5.3.0/src/ldblib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o: ../../src/host/lua-5.3.0/src/ldebug.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o: ../../src/host/lua-5.3.0/src/ldebug.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ldo.o: ../../src/host/lua-5.3.0/src/ldo.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/ldo.o: ../../src/host/lua-5.3.0/src/ldo.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ldump.o: ../../src/host/lua-5.3.0/src/ldump.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/ldump.o: ../../src/host/lua-5.3.0/src/ldump.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o: ../../src/host/lua-5.3.0/src/lfunc.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o: ../../src/host/lua-5.3.0/src/lfunc.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lgc.o: ../../src/host/lua-5.3.0/src/lgc.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lgc.o: ../../src/host/lua-5.3.0/src/lgc.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/linit.o: ../../src/host/lua-5.3.0/src/linit.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/linit.o: ../../src/host/lua-5.3.0/src/linit.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/liolib.o: ../../src/host/lua-5.3.0/src/liolib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/liolib.o: ../../src/host/lua-5.3.0/src/liolib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/llex.o: ../../src/host/lua-5.3.0/src/llex.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/llex.o: ../../src/host/lua-5.3.0/src/llex.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o: ../../src/host/lua-5.3.0/src/lmathlib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o: ../../src/host/lua-5.3.0/src/lmathlib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lmem.o: ../../src/host/lua-5.3.0/src/lmem.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lmem.o: ../../src/host/lua-5.3.0/src/lmem.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o: ../../src/host/lua-5.3.0/src/loadlib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o: ../../src/host/lua-5.3.0/src/loadlib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lobject.o: ../../src/host/lua-5.3.0/src/lobject.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lobject.o: ../../src/host/lua-5.3.0/src/lobject.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o: ../../src/host/lua-5.3.0/src/lopcodes.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o: ../../src/host/lua-5.3.0/src/lopcodes.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/loslib.o: ../../src/host/lua-5.3.0/src/loslib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/loslib.o: ../../src/host/lua-5.3.0/src/loslib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lparser.o: ../../src/host/lua-5.3.0/src/lparser.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lparser.o: ../../src/host/lua-5.3.0/src/lparser.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lstate.o: ../../src/host/lua-5.3.0/src/lstate.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lstate.o: ../../src/host/lua-5.3.0/src/lstate.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lstring.o: ../../src/host/lua-5.3.0/src/lstring.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lstring.o: ../../src/host/lua-5.3.0/src/lstring.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o: ../../src/host/lua-5.3.0/src/lstrlib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o: ../../src/host/lua-5.3.0/src/lstrlib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ltable.o: ../../src/host/lua-5.3.0/src/ltable.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/ltable.o: ../../src/host/lua-5.3.0/src/ltable.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o: ../../src/host/lua-5.3.0/src/ltablib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o: ../../src/host/lua-5.3.0/src/ltablib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ltm.o: ../../src/host/lua-5.3.0/src/ltm.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/ltm.o: ../../src/host/lua-5.3.0/src/ltm.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lundump.o: ../../src/host/lua-5.3.0/src/lundump.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lundump.o: ../../src/host/lua-5.3.0/src/lundump.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o: ../../src/host/lua-5.3.0/src/lutf8lib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o: ../../src/host/lua-5.3.0/src/lutf8lib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lvm.o: ../../src/host/lua-5.3.0/src/lvm.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lvm.o: ../../src/host/lua-5.3.0/src/lvm.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lzio.o: ../../src/host/lua-5.3.0/src/lzio.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lzio.o: ../../src/host/lua-5.3.0/src/lzio.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_chdir.o: ../../src/host/os_chdir.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_chdir.o: ../../src/host/os_chdir.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_copyfile.o: ../../src/host/os_copyfile.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_copyfile.o: ../../src/host/os_copyfile.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_isdir.o: ../../src/host/os_isdir.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_isdir.o: ../../src/host/os_isdir.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_isfile.o: ../../src/host/os_isfile.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_isfile.o: ../../src/host/os_isfile.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_stat.o: ../../src/host/os_stat.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_stat.o: ../../src/host/os_stat.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_ticks.o: ../../src/host/os_ticks.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_ticks.o: ../../src/host/os_ticks.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_uuid.o: ../../src/host/os_uuid.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_uuid.o: ../../src/host/os_uuid.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/path_getabsolute.o: ../../src/host/path_getabsolute.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/path_getabsolute.o: ../../src/host/path_getabsolute.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/path_getrelative.o: ../../src/host/path_getrelative.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/path_getrelative.o: ../../src/host/path_getrelative.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/path_helpers.o: ../../src/host/path_helpers.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/path_helpers.o: ../../src/host/path_helpers.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/premake.o: ../../src/host/premake.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/premake.o: ../../src/host/premake.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/premake_main.o: ../../src/host/premake_main.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/premake_main.o: ../../src/host/premake_main.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/scripts.o: ../../src/host/scripts.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/scripts.o: ../../src/host/scripts.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/string_endswith.o: ../../src/host/string_endswith.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/string_endswith.o: ../../src/host/string_endswith.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
diff --git a/3rdparty/genie/build/gmake.solaris/genie.make b/3rdparty/genie/build/gmake.solaris/genie.make
index 27e29508bfb..56ce127f9d9 100644
--- a/3rdparty/genie/build/gmake.solaris/genie.make
+++ b/3rdparty/genie/build/gmake.solaris/genie.make
@@ -44,9 +44,9 @@ ifeq ($(config),release)
DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE -D_REENTRANT -DLUA_USE_POSIX -DLUA_USE_DLOPEN
INCLUDES += -I../../src/host/lua-5.3.0/src
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES)
- ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -std=gnu99
- ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -std=gnu99
- ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -std=gnu99
+ ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -std=gnu99
+ ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -std=gnu99
+ ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -std=gnu99
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
ALL_LDFLAGS += $(LDFLAGS) -L. -s -rdynamic
LDDEPS +=
diff --git a/3rdparty/genie/build/gmake.windows/genie.make b/3rdparty/genie/build/gmake.windows/genie.make
index a29da3d94e9..f3808bfd730 100644
--- a/3rdparty/genie/build/gmake.windows/genie.make
+++ b/3rdparty/genie/build/gmake.windows/genie.make
@@ -48,19 +48,22 @@ ifeq ($(config),release)
override TARGET = $(TARGETDIR)/genie.exe
DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE
INCLUDES += -I"../../src/host/lua-5.3.0/src"
- INCLUDES +=
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -MP $(DEFINES) $(INCLUDES)
- ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os
- ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os
- ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os
- ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os
- ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os
+ ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM)
+ ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM)
+ ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM)
+ ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM)
+ ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM)
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
- ALL_LDFLAGS += $(LDFLAGS) -L. -s
+ ALL_LDFLAGS += $(LDFLAGS) -L"." -s
+ LIBDEPS +=
LDDEPS +=
+ LDRESP =
LIBS += $(LDDEPS) -lole32
EXTERNAL_LIBS +=
- LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
+ LINKOBJS = $(OBJECTS)
+ LINKCMD = $(CC) -o $(TARGET) $(LINKOBJS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
+ OBJRESP =
OBJECTS := \
$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \
$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \
@@ -132,19 +135,22 @@ ifeq ($(config),debug)
override TARGET = $(TARGETDIR)/genie.exe
DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE
INCLUDES += -I"../../src/host/lua-5.3.0/src"
- INCLUDES +=
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -MP $(DEFINES) $(INCLUDES)
- ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
- ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
- ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
- ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
- ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
+ ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM)
+ ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM)
+ ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM)
+ ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM)
+ ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM)
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
- ALL_LDFLAGS += $(LDFLAGS) -L.
+ ALL_LDFLAGS += $(LDFLAGS) -L"."
+ LIBDEPS +=
LDDEPS +=
+ LDRESP =
LIBS += $(LDDEPS) -lole32
EXTERNAL_LIBS +=
- LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
+ LINKOBJS = $(OBJECTS)
+ LINKCMD = $(CC) -o $(TARGET) $(LINKOBJS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
+ OBJRESP =
OBJECTS := \
$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \
$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \
@@ -222,7 +228,7 @@ RESOURCES := \
all: $(OBJDIRS) $(TARGETDIR) prebuild prelink $(TARGET)
@:
-$(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(EXTERNAL_LIBS) $(RESOURCES) | $(TARGETDIR) $(OBJDIRS)
+$(TARGET): $(GCH) $(OBJECTS) $(LIBDEPS) $(EXTERNAL_LIBS) $(RESOURCES) $(OBJRESP) $(LDRESP) | $(TARGETDIR) $(OBJDIRS)
@echo Linking genie
$(SILENT) $(LINKCMD)
$(POSTBUILDCMDS)
@@ -261,223 +267,235 @@ $(GCH_OBJC): $(PCH) $(MAKEFILE) | $(OBJDIR)
$(SILENT) $(CC) $(ALL_OBJCFLAGS) -x objective-c-header $(DEFINES) $(INCLUDES) -o "$@" -c "$<"
endif
-$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o: ../../src/host/lua-5.3.0/src/lapi.c $(GCH) $(MAKEFILE)
+ifneq (,$(OBJRESP))
+$(OBJRESP): $(OBJECTS) | $(TARGETDIR) $(OBJDIRS)
+ $(SILENT) echo $^
+ $(SILENT) echo $^ > $@
+endif
+
+ifneq (,$(LDRESP))
+$(LDRESP): $(LDDEPS) | $(TARGETDIR) $(OBJDIRS)
+ $(SILENT) echo $^
+ $(SILENT) echo $^ > $@
+endif
+
+$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o: ../../src/host/lua-5.3.0/src/lapi.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o: ../../src/host/lua-5.3.0/src/lauxlib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o: ../../src/host/lua-5.3.0/src/lauxlib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o: ../../src/host/lua-5.3.0/src/lbaselib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o: ../../src/host/lua-5.3.0/src/lbaselib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o: ../../src/host/lua-5.3.0/src/lbitlib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o: ../../src/host/lua-5.3.0/src/lbitlib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lcode.o: ../../src/host/lua-5.3.0/src/lcode.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lcode.o: ../../src/host/lua-5.3.0/src/lcode.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o: ../../src/host/lua-5.3.0/src/lcorolib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o: ../../src/host/lua-5.3.0/src/lcorolib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lctype.o: ../../src/host/lua-5.3.0/src/lctype.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lctype.o: ../../src/host/lua-5.3.0/src/lctype.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o: ../../src/host/lua-5.3.0/src/ldblib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o: ../../src/host/lua-5.3.0/src/ldblib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o: ../../src/host/lua-5.3.0/src/ldebug.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o: ../../src/host/lua-5.3.0/src/ldebug.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ldo.o: ../../src/host/lua-5.3.0/src/ldo.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/ldo.o: ../../src/host/lua-5.3.0/src/ldo.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ldump.o: ../../src/host/lua-5.3.0/src/ldump.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/ldump.o: ../../src/host/lua-5.3.0/src/ldump.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o: ../../src/host/lua-5.3.0/src/lfunc.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o: ../../src/host/lua-5.3.0/src/lfunc.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lgc.o: ../../src/host/lua-5.3.0/src/lgc.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lgc.o: ../../src/host/lua-5.3.0/src/lgc.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/linit.o: ../../src/host/lua-5.3.0/src/linit.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/linit.o: ../../src/host/lua-5.3.0/src/linit.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/liolib.o: ../../src/host/lua-5.3.0/src/liolib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/liolib.o: ../../src/host/lua-5.3.0/src/liolib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/llex.o: ../../src/host/lua-5.3.0/src/llex.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/llex.o: ../../src/host/lua-5.3.0/src/llex.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o: ../../src/host/lua-5.3.0/src/lmathlib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o: ../../src/host/lua-5.3.0/src/lmathlib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lmem.o: ../../src/host/lua-5.3.0/src/lmem.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lmem.o: ../../src/host/lua-5.3.0/src/lmem.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o: ../../src/host/lua-5.3.0/src/loadlib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o: ../../src/host/lua-5.3.0/src/loadlib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lobject.o: ../../src/host/lua-5.3.0/src/lobject.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lobject.o: ../../src/host/lua-5.3.0/src/lobject.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o: ../../src/host/lua-5.3.0/src/lopcodes.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o: ../../src/host/lua-5.3.0/src/lopcodes.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/loslib.o: ../../src/host/lua-5.3.0/src/loslib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/loslib.o: ../../src/host/lua-5.3.0/src/loslib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lparser.o: ../../src/host/lua-5.3.0/src/lparser.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lparser.o: ../../src/host/lua-5.3.0/src/lparser.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lstate.o: ../../src/host/lua-5.3.0/src/lstate.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lstate.o: ../../src/host/lua-5.3.0/src/lstate.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lstring.o: ../../src/host/lua-5.3.0/src/lstring.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lstring.o: ../../src/host/lua-5.3.0/src/lstring.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o: ../../src/host/lua-5.3.0/src/lstrlib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o: ../../src/host/lua-5.3.0/src/lstrlib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ltable.o: ../../src/host/lua-5.3.0/src/ltable.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/ltable.o: ../../src/host/lua-5.3.0/src/ltable.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o: ../../src/host/lua-5.3.0/src/ltablib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o: ../../src/host/lua-5.3.0/src/ltablib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ltm.o: ../../src/host/lua-5.3.0/src/ltm.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/ltm.o: ../../src/host/lua-5.3.0/src/ltm.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lundump.o: ../../src/host/lua-5.3.0/src/lundump.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lundump.o: ../../src/host/lua-5.3.0/src/lundump.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o: ../../src/host/lua-5.3.0/src/lutf8lib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o: ../../src/host/lua-5.3.0/src/lutf8lib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lvm.o: ../../src/host/lua-5.3.0/src/lvm.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lvm.o: ../../src/host/lua-5.3.0/src/lvm.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lzio.o: ../../src/host/lua-5.3.0/src/lzio.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lzio.o: ../../src/host/lua-5.3.0/src/lzio.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_chdir.o: ../../src/host/os_chdir.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_chdir.o: ../../src/host/os_chdir.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_copyfile.o: ../../src/host/os_copyfile.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_copyfile.o: ../../src/host/os_copyfile.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_isdir.o: ../../src/host/os_isdir.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_isdir.o: ../../src/host/os_isdir.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_isfile.o: ../../src/host/os_isfile.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_isfile.o: ../../src/host/os_isfile.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_stat.o: ../../src/host/os_stat.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_stat.o: ../../src/host/os_stat.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_ticks.o: ../../src/host/os_ticks.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_ticks.o: ../../src/host/os_ticks.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_uuid.o: ../../src/host/os_uuid.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_uuid.o: ../../src/host/os_uuid.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/path_getabsolute.o: ../../src/host/path_getabsolute.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/path_getabsolute.o: ../../src/host/path_getabsolute.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/path_getrelative.o: ../../src/host/path_getrelative.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/path_getrelative.o: ../../src/host/path_getrelative.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/path_helpers.o: ../../src/host/path_helpers.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/path_helpers.o: ../../src/host/path_helpers.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/premake.o: ../../src/host/premake.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/premake.o: ../../src/host/premake.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/premake_main.o: ../../src/host/premake_main.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/premake_main.o: ../../src/host/premake_main.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/scripts.o: ../../src/host/scripts.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/scripts.o: ../../src/host/scripts.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/string_endswith.o: ../../src/host/string_endswith.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/string_endswith.o: ../../src/host/string_endswith.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
diff --git a/3rdparty/genie/docs/scripting-reference.md b/3rdparty/genie/docs/scripting-reference.md
index 74a3f08d0d0..bc4d1d3351e 100644
--- a/3rdparty/genie/docs/scripting-reference.md
+++ b/3rdparty/genie/docs/scripting-reference.md
@@ -16,6 +16,7 @@
* [configuration](#configurationkeywords)
* [configurations](#configurationsnames)
* [custombuildtask](#custombuildtasktask)
+ * [debugcmd](#debugcmdcmd)
* [debugargs](#debugargsargs)
* [debugdir](#debugdirpath)
* [defines](#definessymbols)
@@ -46,6 +47,7 @@
* [newoption](#newoptionsdescription)
* [nopch](#nopch)
* [objdir](#objdirpath)
+ * [options](#optionsoptions)
* [pchheader](#pchheaderfile)
* [pchsource](#pchsourcefile)
* [platforms](#platformsidentifiers)
@@ -63,6 +65,7 @@
* [resoptions](#resoptionsoptions)
* [solution](#solutionname)
* [startproject](#startprojectname)
+ * [systemincludedirs](#systemincludedirspaths)
* [targetdir](#targetdirpath)
* [targetextension](#targetextensionext)
* [targetname](#targetnamename)
@@ -72,6 +75,12 @@
* [userincludedirs](#userincludedirspaths)
* [uuid](#uuidprojectuuid)
* [vpaths](#vpathsgroup--pattern)
+ * [xcodeprojectopts](#xcodeprojectoptskey--value-)
+ * [xcodetargetopts](#xcodetargetoptskey--value-)
+ * [xcodescriptphases](#xcodescriptphasescmd-inputpaths-)
+ * [xcodecopyresources](#xcodecopyresourcestargetpath-inputfiles-)
+ * [xcodecopyframeworks](#xcodecopyframeworksinputframeworks-)
+ * [wholearchive](#wholearchivereferences)
* Utility functions
* [iif](#iifcondition-trueval-falseval)
* [os.chdir](#oschdirpath)
@@ -204,6 +213,7 @@ Specifies what action should be performed on a set of files during compilation.
#### Arguments
_action_ - the action to be performed. One of:
+
* "Compile" - treat the file as source code: compile and run it
* "Embed" - embed the file into the target binary as a resource
* "Copy" - copy the file to the target directory
@@ -211,10 +221,12 @@ _action_ - the action to be performed. One of:
#### Examples
Embed all PNGs into the target binary
+
```lua
configuration "**.png"
buildaction "Embed"
```
+
[Back to top](#table-of-contents)
---
@@ -238,10 +250,12 @@ _options_ - list of compiler flags
#### Examples
Add some GCC-specific options
+
```lua
configuration {"linux", "gmake"}
buildoptions {"-ansi", "-pedantic"}
```
+
[Back to top](#table-of-contents)
---
@@ -252,6 +266,7 @@ Limits subsequent build settings to a particular environment. Acts as a filter,
_keywords_ - list of identifiers to compare to the current runtime environment
Possible values:
+
* Configuration names - configuration names passed to [configurations](#configurations)
* Action names - "vs2015", "gmake", etc.
* Operating system names - "windows", "macosx", etc.
@@ -263,6 +278,7 @@ You may also use "*" and "**" wildcards, as well as "not" and "or".
#### Return
Current configuration object with the following fields:
+
* _buildaction_ - build action.
* _buildoptions_ - list of compiler options.
* _defines_ - list of compiler symbols.
@@ -298,33 +314,76 @@ Current configuration object with the following fields:
#### Examples
Define debug symbol for debug configurations
+
```lua
configuration "Debug"
defines { "DEBUG" }
```
Define a symbol based on a wildcard
+
```lua
configuration "vs*"
defines { "VISUAL_STUDIO_2005" }
```
Define a symbol based on an "or"
+
```lua
configuration "linux or macosx"
defines { "LINUX_OR_MACOSX" }
```
Define a symbol based on a "not"
+
```lua
configuration "not windows"
defines { "NOT_WINDOWS" }
```
Reset the configuration filter
+
```lua
configuration {}
```
+
+#### Caveats
+
+- Argument chaining:
+ `configuration` can take multiple arguments, e.g.,
+ ```lua
+ configuration {"StaticLib", "xcode*", "osx or ios*"}
+ ```
+ These arguments will be combined as an `AND` clause,
+ i.e. if one of the keywords does _not_ match the actual configuration terms,
+ the following settings will not be applied.
+
+- Condition evaluation:
+ The arguments are **not** evaluated as Lua. They are merely regex-matched against the configuration terms.
+ The implications of this are that parentheses have no effect outside of regular expression groups.
+ A condition like `"not (osx or ios*)"` will not be equivalent to `{"not osx", "not ios*}"`.
+ Furthermore, a condition like `"not osx or ios*"` will be evaluated as the negation of `"osx or ios*"`.
+
+- `and` is **not** a valid keyword for configuration combinations.
+ However, several keywords will be combined as an `AND` clause.
+
+- Limits of Lua's regular expressions:
+ Each passed keyword is matched against each configuration terms from the project/solution type being built
+ using [Lua's regular expression mechanism](https://www.lua.org/manual/5.3/manual.html#6.4).
+ This means that keyword matching is subject to the same limits as regular Lua regex matching.
+ This implies that regexes like `"(osx|ios)"` do not work.
+
+- Wildcard expansion:
+ Wildcards will get expanded following the same rules as paths.
+ Similarly, special characters such as `()` will get escaped (i.e. converted to `%(%)`) before being matched.
+ This means that `"not (osx or ios*)"` will in fact get expanded to `"not %(osx or ios[^/]*)"` and then checked as
+ `not` _result of_ `"%(osx or ios[^/]*)"`, which in turn gets broken down to `"%(osx"` and `"ios[^/]*)"`.
+
+- `"win*"` matchings:
+ Intuitively, the configuration keyword to match "Windows" ("Win32", "Win64" or "WinCE") configuration would be
+ `"win*"`. However **`"win*"` also matches "WindowedApp"**. Prefer using the term `"vs*"` to check for configurations
+ targeting Windows.
+
[Back to top](#table-of-contents)
---
@@ -341,34 +400,38 @@ When called with no arguments - list of current configuration names
#### Examples
Specify configurations for a solution
+
```lua
solution "MySolution"
configurations { "Debug", "Release" }
```
Add additional configurations
+
```lua
configurations{ "Debug", "Release", "DebugDLL", "ReleaseDLL" }
```
Retrieve current list of configurations
+
```lua
local cfgs = configurations()
```
+
[Back to top](#table-of-contents)
---
-### custombuildtask({_input_file_, _output_file_, {_dependency_,...},{_command_,...}},...)
+### custombuildtask({*input_file*, *output_file*, {*dependency*, ...}, {*command*, ...}}, ...)
Defines custom build task for specific input file, that generates output file, there can be additional dependencies, and
for rule listed commands are executed.
**Scope:** solutions, projects, configurations
#### Arguments
-_input_file_ - source file that should be "compiled" with custom task
-_output_file_ - generated file name
-_dependency_ - additional dependencies, that can be used as parameters to commands
-_command_ - command list, special functions in commands are :
+*input_file* - source file that should be "compiled" with custom task
+*output_file* - generated file name
+*dependency* - additional dependencies, that can be used as parameters to commands
+*command* - command list, special functions in commands are :
$(<) - input file
$(@) - output file
$(1) - $(9) - additional dependencies
@@ -384,11 +447,29 @@ custombuildtask {
[Back to top](#table-of-contents)
---
+### debugcmd(cmd)
+Specifies a command to execute when running under the debugger instead of the build target.
+
+**Note:** In Visual Studio, this can be overridden by a per-user config file (e.g. ProjectName.vcxproj.MYDOMAIN-MYUSERNAME.user).
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_cmd_ - the command to execute when starting with the debugger
+
+#### Examples
+
+```lua
+configuration 'TestConfig'
+ debugcmd 'D:\\Apps\\Test.exe'
+```
+
+[Back to top](#table-of-contents)
+
+---
### debugargs({_args_...})
Specifies a list of arguments to pas to the application when run under the debugger.
-**Note:** Not implemented for Xcode 3, where it must be configured in a per-user config file.
-
**Note:** In Visual Studio, this can be overridden by a per-user config file (e.g. ProjectName.vcxproj.MYDOMAIN-MYUSERNAME.user).
**Scope:** solutions, projects, configurations
@@ -397,18 +478,18 @@ Specifies a list of arguments to pas to the application when run under the debug
_args_ - list of arguments to pass to the executable while debugging
#### Examples
+
```lua
configuration "Debug"
debugargs { "--append", "somefile.txt" }
```
+
[Back to top](#table-of-contents)
---
### debugdir(_path_)
Sets the working directory for the integrated debugger.
-**Note:** Not implemented for Xcode 3, where it must be configured in a per-user config file.
-
**Note:** In Visual Studio, this can be overridden by a per-user config file (e.g. ProjectName.vcxproj.MYDOMAIN-MYUSERNAME.user).
**Scope:** solutions, projects, configurations
@@ -417,10 +498,12 @@ Sets the working directory for the integrated debugger.
_path_ - path to the working directory, relative to the currently-executing script file
#### Examples
+
```lua
configuration "Debug"
debugdir "bin/debug"
```
+
[Back to top](#table-of-contents)
---
@@ -434,27 +517,31 @@ _symbols_ - list of symbols
#### Examples
Define two new symbols
+
```lua
defines { "DEBUG", "TRACE" }
```
Assign a symbol value
+
```lua
defines { "CALLSPEC=__dllexport" }
```
+
[Back to top](#table-of-contents)
---
-### dependency({_main_file_, _depending_of_}...)
-GMAKE specific adds dependency between source file and any other file.
+### dependency({*main_file*, *depending_of*} ...)
+GMAKE specific. Adds dependency between source file and any other file.
**Scope:** solutions, projects, configurations
#### Arguments
-_main_file_ - name of source file that depends of other file
-_depending_of_ - name of dependency file
+*main_file* - name of source file that depends of other file
+*depending_of* - name of dependency file
#### Examples
+
```lua
dependency { { ROOT_DIR .. "src/test.c", ROOT_DIR .. "verion.txt" } }
```
@@ -487,16 +574,19 @@ _files_ - List of files to exclude. Paths should be relative to the currently-ex
#### Examples
Add all c files in a directory, then exclude a specific file
+
```lua
files { "*.c" }
excludes { "a_file.c" }
```
Add an entire directory of C files, then exclude one directory
+
```lua
files { "*.c" }
excludes { "tests/*.c" }
```
+
[Back to top](#table-of-contents)
---
@@ -512,19 +602,23 @@ _files_ - List of files to include. Paths should be relative to the currently-ex
#### Examples
Add two files to the current project
+
```lua
files { "hello.cpp", "goodbye.cpp" }
```
Add all C++ files from the "src/" directory to the project
+
```lua
files { "src/*.cpp" }
```
Add all C++ files from the "src/" directory and any subdirectories
+
```lua
files { "src/**.cpp" }
```
+
[Back to top](#table-of-contents)
---
@@ -542,6 +636,8 @@ _flags_ - List of flag names from list below. Names are case-insensitive and ign
* _FatalWarnings_ - Treat warnings as errors.
* _FloatFast_ - Enable floating point optimizations at the expense of accuracy.
* _FloatStrict_ - Improve floating point consistency at the expense of performance.
+* _FullSymbols_ - Use together with _Symbols_ to generate full debug symbols with Visual Studio.
+* _LinkSupportCircularDependencies_ - Enables the linker to iterate over provided libs in order to resolve circular dependencies (make and ninja only).
* _Managed_ - Enable Managed C++ (.NET).
* _MinimumWarnings_ - - Sets compiler's minimum warning level (Visual Studio only).
* _MFC_ - Enable support for Microsoft Foundation Classes.
@@ -555,6 +651,7 @@ _flags_ - List of flag names from list below. Names are case-insensitive and ign
* _NoImportLib_ - Prevent the generation of an import library for a Windows DLL.
* _NoManifest_ - Prevent the generation of a manifest for Windows executables and shared libraries.
* _NoMultiProcessorCompilation_ - Disables Visual Studio's and FastBuild's multiprocessor compilation.
+* _NoRuntimeChecks_ - Disable Visual Studio's Basic Runtime Checks in Debug builds.
* _EnableMinimalRebuild_ - Enable Visual Studio's minimal rebuild feature.
* _NoPCH_ - Disable precompiled headers.
* _NoRTTI_ - Disable C++ runtime type information.
@@ -572,6 +669,8 @@ _flags_ - List of flag names from list below. Names are case-insensitive and ign
* _Unicode_ - Enable Unicode strings. If not specified, the default toolset behavior is used.
* _Unsafe_ - Enable the use of unsafe code in .NET applications.
* _UseFullPaths_ - Enable absolute paths for `__FILE__`.
+* _UseLDResponseFile_ - Enable use of response file (aka @file) for linking lib dependencies (make only).
+* _UseObjectResponseFile_ - Enable use of response file (aka @file) for linking objects (make only).
* _UnsignedChar_ - Force `char`s to be `unsigned` by default.
* _WinMain_ - Use WinMain() as the entry point for Windows applications, rather than main().
@@ -581,6 +680,7 @@ Additional tool-specific arguments can be passed with [`buildoptions`](#buildopt
#### Examples
Enable debugging symbols in the Debug configuration and optimize the Release configuration
+
```lua
configuration "Debug"
flags { "Symbols" }
@@ -588,6 +688,7 @@ configuration "Debug"
configuration "Release"
flags { "OptimizeSpeed", "No64BitChecks" }
```
+
[Back to top](#table-of-contents)
---
@@ -610,9 +711,11 @@ _version_ - one of the following:
#### Examples
Use the .NET 3.0 framework
+
```lua
framework "3.0"
```
+
[Back to top](#table-of-contents)
---
@@ -625,6 +728,7 @@ Creates a solution folder for Visual Studio solutions.
_name_ - the name of the solution folder
#### Examples
+
```lua
solution "MySolution"
group "MyGroup1"
@@ -636,6 +740,7 @@ solution "MySolution"
project "Project3"
-- ...
```
+
[Back to top](#table-of-contents)
---
@@ -670,9 +775,11 @@ Specifies the import library output directory. Import libraries are generated fo
_path_ - the output directory for the library, relative to the currently-executing script file
#### Examples
+
```lua
implibdir "../Libraries"
```
+
[Back to top](#table-of-contents)
---
@@ -707,14 +814,17 @@ Specifies the import library file name prefix. Import libraries are generated fo
_prefix_ - new file name prefix
#### Examples
+
```lua
implibprefix "plugin"
```
The prefix may also be set to an empty string for no prefix
+
```lua
implibprefix ""
```
+
[Back to top](#table-of-contents)
---
@@ -727,11 +837,13 @@ Specifies the file name suffix for the import library base file name. Import lib
_suffix_ - the new filename suffix
#### Examples
+
```lua
-- Add "-d" to debug versions of files
configuration "Debug"
implibsuffix "-d"
```
+
[Back to top](#table-of-contents)
---
@@ -745,6 +857,7 @@ _directory_ - path to the included directory, relative to the currently-executin
Any values returned by the script are passed through to the caller
#### Examples
+
```lua
-- runs "src/MyApplication/premake4.lua"
include "src/MyApplication"
@@ -752,6 +865,7 @@ include "src/MyApplication"
-- runs "src/MyLibrary/premake4.lua"
include "src/MyLibrary"
```
+
[Back to top](#table-of-contents)
---
@@ -765,13 +879,17 @@ _paths_ - list of include file search directories, relative to the currently-exe
#### Examples
Define two include file search paths
+
```lua
includedirs { "../lua/include", "../zlib" }
```
+
You can also use [wildcards](#wildcards) to match multiple directories.
+
```lua
includedirs { "../includes/**" }
```
+
[Back to top](#table-of-contents)
---
@@ -790,10 +908,13 @@ _kind_ - project kind identifier. One of:
* _Bundle_ - Xcode: Cocoa Bundle, everywhere else: alias to _SharedLib_
#### Examples
+
```lua
kind "ConsoleApp"
```
+
You can also set different kinds for each configuration. **Not supported by XCode.**
+
```lua
solution "MySolution"
configurations { "DebugLib", "ReleaseLib", "DebugDLL", "ReleaseDLL" }
@@ -805,6 +926,7 @@ project "MyProject"
configuration "*DLL"
kind "SharedLib"
```
+
[Back to top](#table-of-contents)
---
@@ -817,9 +939,11 @@ Sets the programming language used by a project. GENie currently supports C, C++
_lang_ - language identifier string ("C", "C++", "C#" or "Vala"). Case insensitive.
#### Examples
+
```lua
language "C++"
```
+
[Back to top](#table-of-contents)
---
@@ -834,13 +958,17 @@ Multiple calls are concatenated.
_paths_ - list of library search directories, relative to the currently-executing script file
#### Examples
+
```lua
libdirs { "../lua/libs", "../zlib" }
```
+
You can also use [wildcards](#wildcards) to match multiple directories.
+
```lua
libdirs { "../libs/**" }
```
+
[Back to top](#table-of-contents)
---
@@ -854,10 +982,12 @@ _options_ - list of flags and options to pass
#### Examples
Use `pkg-config`-style configuration when building on Linux with GCC.
+
```lua
configuration { "linux", "gmake" }
linkoptions { "`wx-config --libs`"}
```
+
[Back to top](#table-of-contents)
---
@@ -875,6 +1005,7 @@ When linking against system libraries, do not include any prefix or file extensi
#### Examples
Link against some system libraries
+
```lua
configuration "windows"
links { "user32", "gdi32" }
@@ -886,7 +1017,9 @@ configuration "macosx"
--- OS X frameworks need the extension to be handled properly
links { "Cocoa.framework", "png" }
```
+
In a solution with two projects, link the library into the executable. Note that the project name is used to specify the link. GENie will automatically figure out the correct library file name and directory and create a project dependency.
+
```lua
solution "MySolution"
configurations { "Debug", "Release" }
@@ -901,7 +1034,9 @@ solution "MySolution"
kind "SharedLib"
files "**.cpp"
```
+
You may also create links between non-library projects. In this case, GENie will generate a build dependency (the linked project will build first) but not an actual link. In this example, MyProject uses a build dependency to ensure that MyTool gets built first. It then uses MyTool as part of its build process
+
```lua
solution "MySolution"
configurations { "Debug", "Release" }
@@ -917,6 +1052,7 @@ solution "MySolution"
kind "ConsoleApp"
files "**.cpp"
```
+
[Back to top](#table-of-contents)
---
@@ -931,14 +1067,18 @@ Sets the destination directory for a generated solution or project file. By defa
_path_ - directory into which files should be generated, relative to the currently-executing script file.
#### Examples
+
```lua
solution "MySolution"
location "../build"
```
+
If you plan to build with multiple tools from the same source tree, you might want to split up the project files by toolset. The _ACTION global variable contains the current toolset identifier, as specified on the command line. Note that Lua syntax requires parentheses around the function parameters in this case.
+
```lua
location ("../build/" .. _ACTION)
```
+
[Back to top](#table-of-contents)
---
@@ -951,9 +1091,11 @@ Skips certain messages in ninja and Makefile generated projects.
_options_ - one or several of "SkipCreatingMessage", "SkipBuildingMessage", "SkipCleaningMessage"
#### Examples
+
```lua
messageskip { "SkipCreatingMessage", "SkipBuildingMessage", "SkipCleaningMessage" }
```
+
[Back to top](#table-of-contents)
---
@@ -968,6 +1110,7 @@ _description_ - a table describing the new action with the following fields:
* _execute_ - Function to be executed when the action is fired
#### Examples
+
```lua
newaction {
trigger = "install",
@@ -977,6 +1120,7 @@ newaction {
end
}
```
+
[Back to top](#table-of-contents)
---
@@ -994,6 +1138,7 @@ _description_ - a table describing the new option with the following fields:
* _allowed_ - (optional) list of key-value pairs listing the allowed values for the option
#### Examples
+
```lua
newoption {
trigger = "gfxapi",
@@ -1006,6 +1151,7 @@ newoption {
}
}
```
+
[Back to top](#table-of-contents)
---
@@ -1021,16 +1167,19 @@ _files_ - List of files to not use the precompiled header. Paths should be relat
#### Examples
Add all c files in a directory, then set a specific file to not use precompiled headers.
+
```lua
files { "*.c" }
nopch { "a_file.c" }
```
Add an entire directory of C files, then set one directory to not use precompiled headers
+
```lua
files { "*.c" }
nopch { "tests/*.c" }
```
+
[Back to top](#table-of-contents)
---
@@ -1043,11 +1192,14 @@ Sets an object and intermediate file directory for a project. By default, object
_path_ - directory where the object and intermediate files should be stored, relative to the currently-executing script file.
#### Examples
+
```lua
project "MyProject"
objdir "objects"
```
+
Set object directories per configuration
+
```lua
configuration "Debug"
objdir "../obj_debug"
@@ -1055,6 +1207,25 @@ configuration "Debug"
configuration "Release"
objdir "../obj_release"
```
+
+[Back to top](#table-of-contents)
+
+---
+### options({_options_...})
+Specifies build flags to modify the compiling or linking process. This differs from `flags` in
+that these are set per project rather than per configuration.
+
+**Scope:** solutions, projects
+
+#### Arguments
+_options_ - List of option names from list below. Names are case-insensitive and ignored if not supported on a platform.
+
+* _ArchiveSplit_ - Split arguments to the gmake archiver across multiple invocations, if there are too many of them.
+* _ForceCPP_ - Force compiling source as C++ despite the file extension suggesting otherwise.
+* _SkipBundling_ - Disable generating bundles for Apple platforms.
+* _XcodeLibrarySchemes_ - Generate XCode schemes for libraries too. (By default schemes are only created for runnable apps.)
+* _XcodeSchemeNoConfigs_ - Generate a single scheme per project, rather than one per project config.
+
[Back to top](#table-of-contents)
---
@@ -1067,10 +1238,12 @@ Sets the main header file for precompiled header support.
_file_ - name of the header file, as it is specified in your `#include` statements
#### Examples
+
```lua
pchheader "afxwin.h"
pchsource "afxwin.cpp"
```
+
[Back to top](#table-of-contents)
---
@@ -1083,10 +1256,12 @@ Sets the main source file for precompiled header support. Only used by Visual St
_file_ - name of the source file, relative to the currently-executing script file
#### Examples
+
```lua
pchheader "afxwin.h"
pchsource "afxwin.cpp"
```
+
[Back to top](#table-of-contents)
---
@@ -1119,12 +1294,15 @@ Current list of target platforms for the active solution
#### Examples
Generic build, as well as OS X Universal build
+
```lua
solution "MySolution"
configurations { "Debug", "Release" }
platforms { "native", "universal" }
```
+
Prove 32- and 64-bit specific build targets. No generic build is provided so one of these two platforms must always be used. Do this only if your software requires knowledge of the underlying architecture at build time; otherwise, include _native_ to provide a generic build.
+
```lua
solution "MySolution"
configurations { "Debug", "Release" }
@@ -1132,11 +1310,13 @@ solution "MySolution"
```
You can retrieve the current list of platforms by calling the function with no parameters
+
```lua
local p = platforms()
```
Once you have defined a list of platforms, you may use those identifiers to set up configuration filters and apply platform-specific settings.
+
```lua
configuration "x64"
defines "IS_64BIT"
@@ -1145,6 +1325,7 @@ configuration "x64"
configuration { "Debug", "x64" }
defines "IS_64BIT_DEBUG"
```
+
[Back to top](#table-of-contents)
---
@@ -1157,6 +1338,7 @@ Specifies shell commands to run after build is finished
_commands_ - one or more shell commands
#### Examples
+
```lua
configuration "windows"
postbuildcommands { "copy default.config bin\\project.config" }
@@ -1164,6 +1346,7 @@ configuration "windows"
configuration "not windows"
postbuildcommands { "cp default.config bin/project.config" }
```
+
[Back to top](#table-of-contents)
---
@@ -1177,9 +1360,11 @@ Specifies shell commands to run after compile of file is finished
_commands_ - one or more shell commands
#### Examples
+
```lua
postcompiletasks { "rm $(@:%.o=%.d)" }
```
+
[Back to top](#table-of-contents)
---
@@ -1192,6 +1377,7 @@ Specifies shell commands to run before each build
_commands_ - one or more shell commands
#### Examples
+
```lua
configuration "windows"
prebuildcommands { "copy default.config bin\\project.config" }
@@ -1199,6 +1385,7 @@ configuration "windows"
configuration "not windows"
prebuildcommands { "cp default.config bin/project.config" }
```
+
[Back to top](#table-of-contents)
---
@@ -1211,6 +1398,7 @@ Specifies shell commands to run after source files have been compiled, but befor
_commands_ - one or more shell commands
#### Examples
+
```lua
configuration "windows"
prelinkcommands { "copy default.config bin\\project.config" }
@@ -1218,6 +1406,7 @@ configuration "windows"
configuration "not windows"
prelinkcommands { "cp default.config bin/project.config" }
```
+
[Back to top](#table-of-contents)
@@ -1246,6 +1435,7 @@ Every project is represented in Lua as a table of key-value pairs. You should tr
#### Examples
Create a new project named "MyProject". Note that a solution must exist to contain the project. The indentation is for readability and is optional.
+
```lua
solution "MySolution"
configurations { "Debug", "Release" }
@@ -1254,17 +1444,20 @@ solution "MySolution"
```
You can retrieve the currently active project by calling `project` with no parameters.
+
```lua
local prj = project()
```
You can retrieve the list of projects associated with a solution using the `projects` field of the solution object, which may then be iterated over.
+
```lua
local prjs = solution().projects
for i, prj in ipairs(prjs) do
print(prj.name)
end
```
+
[Back to top](#table-of-contents)
---
@@ -1323,6 +1516,7 @@ Specifies preprocessor symbols for the resource compiler. Multiple calls are con
_symbols_ - list of symbols to be defined
#### Examples
+
```lua
resdefines { "DEBUG", "TRACE" }
```
@@ -1330,6 +1524,7 @@ resdefines { "DEBUG", "TRACE" }
```lua
resdefines { "CALLSPEC=__dllexport" }
```
+
[Back to top](#table-of-contents)
---
@@ -1342,14 +1537,17 @@ Specifies the include file search paths for the resource compiler. Multiple call
_paths_ - list of include file search directories, relative to the currently executing script file
#### Examples
+
```lua
resincludedirs { "../lua/include", "../zlib" }
```
May use wildcards
+
```lua
resincludedirs { "../includes/**" }
```
+
[Back to top](#table-of-contents)
---
@@ -1362,10 +1560,12 @@ Passes arguments directly to the resource compiler. Multiple calls are concatena
_options_ - list of resource compiler flags and options
#### Examples
+
```lua
configuration { "linux", "gmake" }
resoptions { "`wx-config --cxxflags`", "-ansi", "-pedantic" }
```
+
[Back to top](#table-of-contents)
---
@@ -1391,21 +1591,25 @@ Represented as a Lua table key-value pairs, containing the following values. You
* _projects_ - list of projects contained by the solution
#### Examples
+
```lua
solution "MySolution"
```
You can retrieve the currently active solution object by calling `solution` with no parameters.
+
```lua
local sln = solution()
```
You can use the global variable `_SOLUTIONS` to list out all of the currently defined solutions.
+
```lua
for i, sln in ipairs(_SOLUTIONS) do
print(sln.name)
end
```
+
[Back to top](#table-of-contents)
---
@@ -1418,6 +1622,7 @@ Sets the start (default) project for the solution. Works for VS, QBS and Xcode.
_name_ - name of the project to set as the start project.
### Examples
+
```lua
solution "MySolution"
startproject "MyProjectFoo"
@@ -1429,6 +1634,36 @@ project "MyProjectFoo"
project "MyProjectBar"
-- [...]
```
+
+[Back to top](#table-of-contents)
+
+---
+### systemincludedirs({_paths_...})
+Specifies the system include file search paths. Multiple calls are concatenated.
+
+For clang/gcc, it maps to setting the include directory using the `-isystem` option.
+
+On the other build systems, it behaves like [includedirs](#includedirspaths),
+but is always searched after directories specified using includedirs.
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_paths_ - list of system include file search directories, relative to the currently-executing script file.
+
+#### Examples
+Define two include file search paths
+
+```lua
+systemincludedirs { "../lua/include", "../zlib" }
+```
+
+You can also use [wildcards](#wildcards) to match multiple directories.
+
+```lua
+systemincludedirs { "../includes/**" }
+```
+
[Back to top](#table-of-contents)
---
@@ -1441,6 +1676,7 @@ Sets the destination directory for the compiled binary target. By default, gener
_path_ - file system path to the directory where the compiled target file should be stored, relative to the currently executing script file.
#### Examples
+
```lua
project "MyProject"
@@ -1450,6 +1686,7 @@ project "MyProject"
configuration "Release"
targetdir "bin/release"
```
+
[Back to top](#table-of-contents)
---
@@ -1462,9 +1699,11 @@ Specifies the file extension for the compiled binary target. By default, the pro
_ext_ - new file extension, including leading dot
#### Examples
+
```lua
targetextension ".zmf"
```
+
[Back to top](#table-of-contents)
---
@@ -1477,9 +1716,11 @@ Specifies the base file name for the compiled binary target. By default, the pro
_name_ - new base file name
#### Examples
+
```lua
targetname "mytarget"
```
+
[Back to top](#table-of-contents)
---
@@ -1492,14 +1733,17 @@ Specifies the file name prefix for the compiled binary target. By default, syste
_prefix_ - new file name prefix
#### Examples
+
```lua
targetprefix "plugin"
```
The prefix may also be set to an empty string for no prefix
+
```lua
targetprefix ""
```
+
[Back to top](#table-of-contents)
---
@@ -1523,11 +1767,13 @@ Specifies a file name suffix for the compiled binary target.
_suffix_ - new filename suffix
#### Examples
+
```lua
--- Add "-d" to debug versions of files
configuration "Debug"
targetsuffix "-d"
```
+
[Back to top](#table-of-contents)
---
@@ -1543,9 +1789,11 @@ _projectuuid_ - UUID for the current project
Current project UUID or `nil` if no UUID has been set
#### Examples
+
```lua
uuid "XXXXXXXX-XXXX-XXXX-XXXXXXXXXXXX"
```
+
[Back to top](#table-of-contents)
---
@@ -1565,11 +1813,13 @@ _pattern_ - file system pattern for matching file names
#### Examples
Place all header files into a virtual path called "Headers". Any directory information is removed, "src/lua/lua.h" will appear in the IDE as "Headers/lua.h"
+
```lua
vpaths { ["Headers"] = "**.h" }
```
You may specify multiple file patterns using table syntax
+
```lua
vpaths {
["Headers"] = { "**.h", "**.hxx", "**.hpp" }
@@ -1577,21 +1827,25 @@ vpaths {
```
It is also possible to include the file's path in the virtual group. Using this rule, "src/lua/lua.h" will appear in the IDE as "Headers/src/lua/lua.h".
+
```lua
vpaths { ["Headers/*"] = "**.h" }
```
Any directory information explicitly provided in the pattern will be removed from the replacement. Using this rule, "src/lua/lua.h" will appear in the IDE as "Headers/lua/lua.h".
+
```lua
vpaths { ["Headers/*"] = "src/**.h" }
```
You can also use virtual paths to remove extra directories from the IDE. Using this rule, "src/lua/lua.h" will appear in the IDE as "lua/lua.h".
+
```lua
vpaths { ["*"] = "src" }
```
You may specify more than one rule at a time
+
```lua
vpaths {
["Headers"] = "**.h",
@@ -1599,9 +1853,187 @@ vpaths {
["Docs"] = "**.txt"
}
```
+
+[Back to top](#table-of-contents)
+
+---
+### xcodeprojectopts({[_key_] = _value_, ...})
+#### XCode only
+Sets XCode project options in the generated project files. [List of options.](https://gist.github.com/tkersey/39b4fe69e14b859889ffadccb009e397)
+
+#### Arguments
+_key_ - Name of the option to set
+_value_ - Value to set it to
+
+#### Examples
+
+```lua
+xcodeprojectopts {
+ ENABLE_BITCODE = "NO",
+ GCC_ENABLE_TRIGRAPHS = "YES",
+}
+```
+
+[Back to top](#table-of-contents)
+
+---
+### xcodetargetopts({[_key_] = _value_, ...})
+#### XCode only
+Sets XCode target options in the generated project files. [List of options.](https://gist.github.com/tkersey/39b4fe69e14b859889ffadccb009e397)
+
+#### Arguments
+_key_ - Name of the option to set
+_value_ - Value to set it to
+
+#### Examples
+
+```lua
+xcodetargetopts {
+ ALWAYS_SEARCH_USER_PATHS = "YES",
+}
+```
+
+[Back to top](#table-of-contents)
+
+---
+### xcodescriptphases({{_cmd_, {_inputpaths_, ...}}})
+#### XCode only
+Adds a script phase to the generated XCode project file.
+One tag can contain several commands with different inputpaths.
+
+#### Arguments
+_cmd_ - The actual command to run. (This can be a shell script file or direct shell code).
+_inputpaths_ - The paths passed to the command
+
+#### Examples
+_Building shader files_
+
+```lua
+xcodescriptphases {
+ {"shaderc_xcode.sh", {
+ os.matchfiles("**.shader")}
+ },
+}
+```
+
+_Copying, trimming and signing frameworks by relying on [carthage](https://github.com/Carthage/Carthage)_
+
+```lua
+xcodescriptphases {
+ {"carthage copy-frameworks", {
+ os.matchdirs("**.frameworks")}
+ },
+}
+```
+
+#### Caveats
+- Script phases are added in their order of declaration inside the project,
+ and in their order of declaration inside the tag.
+- The input paths are used as passed to the tag.
+ If relative paths are required, you have to rebase them beforehand using `path.getrelative()`.
+- For commands/scripts: You can iterate over the input paths using the following XCode variables:
+ `${SCRIPT_INPUT_FILE_COUNT}`: The number of input paths provided to the script
+ `${SCRIPT_INPUT_FILE_0}` ...: The input paths at index 0 and so on.
+ **NOTE**: You can construct the indexed variable as in the example below:
+```bash
+for (( i = 0; i < ${SCRIPT_INPUT_FILE_COUNT}; ++i )); do
+ varname=SCRIPT_INPUT_FILE_$i
+ echo ${!varname}
+done
+```
+
+[Back to top](#table-of-contents)
+
+---
+### xcodecopyresources({{_targetpath_, {_inputfiles_, ...}}})
+#### XCode only
+Adds a 'Copy Files' phase to the generated XCode project file.
+One tag can contain several target paths with different input files.
+
+#### Arguments
+_targetpath_ - The target path relative to the _Resource_ folder in the resulting `.app` structure.
+_inputfiles_ - The input files to be copied.
+
+#### Examples
+
+```lua
+xcodecopyresources {
+ { ".", {
+ "GameResources", -- a folder
+ }},
+ { "shaders", {
+ os.matchfiles("**.shader"), -- sparse files
+ }},
+}
+```
+
+#### Caveats
+- The target path is only handled as relative to the _Resource_ folder. No other folder can be indicated at the moment.
+ If you need support for other targets, please file an issue on Github.
+- `xcodecopyresources` can only be set _per project_, not _per configuration_.
+
+
[Back to top](#table-of-contents)
---
+### xcodecopyframeworks({_inputframeworks_, ...})
+#### XCode only
+Adds a 'Copy Files' phase to the generated XCode project file that will copy and sign the provided frameworks.
+
+#### Arguments
+_inputframeworks_ - A list of frameworks to be copied to the `.app` structure, with the `SignOnCopy` flag set.
+
+#### Examples
+
+```lua
+links { -- frameworks have to be linked with the .app first
+ "GTLR.framework",
+ "BGFX.framework",
+}
+xcodecopyframeworks {
+ "GTLR.framework",
+ "BGFX.framework",
+}
+```
+
+#### Caveats
+- Frameworks must be known to the project to be copyable: set the link dependency accordingly using `links {}`.
+- `xcodecopyframeworks` can only be set _per project_, not _per configuration_.
+
+[Back to top](#table-of-contents)
+
+---
+
+---
+### wholearchive({_references_...})
+Specifies a list of libraries to link without stripping unreferenced object files. The libraries must have already been added using `links`, and the same identifier must be specified.
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_references_ - list of library and project names
+
+#### Examples
+
+```lua
+project "static_lib"
+ kind "StaticLib"
+
+project "console_app"
+ kind "ConsoleApp"
+ links { "static_lib" }
+ wholearchive { "static_lib" }
+```
+
+#### References
+* [Clang documentation](https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang2-force-load)
+* [GNU documentation](https://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_node/ld_3.html#IDX183)
+* [Microsoft documentation](https://docs.microsoft.com/en-us/cpp/build/reference/wholearchive-include-all-library-object-files?view=vs-2017)
+
+[Back to top](#table-of-contents)
+
+
+---
## Utility functions
### iif(_condition_, _trueval_, _falseval_)
@@ -1613,14 +2045,17 @@ _trueval_ - value to return if _condition_ evaluates to `true`
_falseval_ - value to return if _condition_ evaluates to `false`
#### Examples
+
```lua
result = iif(os.is("windows"), "is windows", "is not windows")
```
Note that all expressions are evaluated before the condition is checked. The following expression cannot be implemented with an `iif` because it may try to concatenate a string value.
+
```lua
result = iif(x -= nil, "x is " .. x, "x is nil")
```
+
[Back to top](#table-of-contents)
---
@@ -1670,11 +2105,13 @@ One of "bsd", "linux", "macosx", "solaris", or "windows"
**Note:** This function returns the OS being targeted, which is not necessarily the same as the OS on which GENie is being run.
#### Example
+
```lua
if os.get() == "windows" then
-- do something windows-specific
end
```
+
[Back to top](#table-of-contents)
---
@@ -1702,7 +2139,9 @@ Table containing the following key-value pairs:
| revision | bug fix release or service pack number |
| description | human-readable description of the OS version |
+
#### Examples
+
```lua
local ver = os.getversion()
print(string.format(" %d.%d.%d (%s)",
@@ -1712,6 +2151,7 @@ print(string.format(" %d.%d.%d (%s)",
-- On Windows XP: "5.1.3 (Windows XP)"
-- On OSX: "10.6.6 (Mac OS X Snow Leopard)"
```
+
[Back to top](#table-of-contents)
---
@@ -1737,6 +2177,7 @@ Determines if the host is using a 64-bit processor.
`false` otherwise
#### Examples
+
```lua
if os.is64bit() then
print("This is a 64-bit system")
@@ -1744,6 +2185,7 @@ else
print("This is NOT a 64-bit system")
end
```
+
[Back to top](#table-of-contents)
---
@@ -1783,11 +2225,13 @@ _pattern_ - file system path to search. May [wildcard](#wildcard) patterns.
List of directories which match the specified pattern. May be empty.
#### Examples
+
```lua
matches = os.matchdirs("src/*") -- non-recursive match
matches = os.matchdirs("src/**") -- recursive match
matches = os.matchdirs("src/test*") -- may also match partial name
```
+
[Back to top](#table-of-contents)
---
@@ -1801,10 +2245,12 @@ _pattern_ - file system path to search. May contain [wildcard](#wildcard) patter
List of files which match the specified pattern. May be empty.
#### Examples
+
```lua
matches = os.matchfiles("src/*.c") -- non-recursive match
matches = os.matchfiles("src/**.c") -- recursive match
```
+
[Back to top](#table-of-contents)
---
@@ -1831,10 +2277,12 @@ _command_ - shell command to run
The output of the command
#### Examples
+
```lua
-- Get the ID for the host processor architecture
local proc = os.outputof("uname -p")
```
+
[Back to top](#table-of-contents)
---
@@ -1852,9 +2300,11 @@ Path to the directory which contains the file, if found
`nil` otherwise
#### Examples
+
```lua
local p = os.pathsearch("mysystem.config", "./config:/usr/local/etc:/etc")
```
+
[Back to top](#table-of-contents)
---
@@ -1904,13 +2354,17 @@ _paths_ - list of user include file search directories, relative to the currentl
#### Examples
Define two include file search paths
+
```lua
userincludedirs { "../lua/include", "../zlib" }
```
+
You can also use [wildcards](#wildcards) to match multiple directories.
+
```lua
userincludedirs { "../includes/**" }
```
+
[Back to top](#table-of-contents)
---
@@ -2076,6 +2530,7 @@ _trailing_ - ending portion of the path
Merged path
#### Examples
+
```lua
-- returns "MySolution/MyProject"
p = path.join("MySolution", "MyProject")
@@ -2086,6 +2541,7 @@ p = path.join("MySolution", "/usr/bin")
-- tokens are assumed to be absolute. This returns `${ProjectDir}`
p = path.join("MySolution", "$(ProjectDir)")
```
+
[Back to top](#table-of-contents)
---
diff --git a/3rdparty/genie/makefile b/3rdparty/genie/makefile
index 1653c27bc74..7064ec9cbc9 100644
--- a/3rdparty/genie/makefile
+++ b/3rdparty/genie/makefile
@@ -39,8 +39,8 @@ clean:
projgen:
$(SILENT) $(GENIE) --to=../build/gmake.windows --os=windows gmake
- $(SILENT) $(GENIE) --to=../build/gmake.linux --os=linux gmake
- $(SILENT) $(GENIE) --to=../build/gmake.darwin --os=macosx --platform=universal32 gmake
+ $(SILENT) $(GENIE) --to=../build/gmake.linux --os=linux gmake
+ $(SILENT) $(GENIE) --to=../build/gmake.darwin --os=macosx --platform=universal32 gmake
$(SILENT) $(GENIE) --to=../build/gmake.freebsd --os=bsd gmake
rebuild:
@@ -55,7 +55,7 @@ release-linux: $(GENIE)
$(SILENT) $(GENIE) release
$(SILENT) $(MAKE) -C build/gmake.darwin clean all CC=x86_64-apple-darwin15-clang
$(SILENT) $(MAKE) -C build/gmake.linux clean all
- $(SILENT) $(MAKE) -C build/gmake.windows clean all CC=i686-w64-mingw32-gcc
+ $(SILENT) $(MAKE) -C build/gmake.windows clean all CC=x86_64-w64-mingw32-gcc
$(SILENT) git checkout src/host/version.h
release: release-$(OS)
diff --git a/3rdparty/genie/scripts/genie.lua b/3rdparty/genie/scripts/genie.lua
index 144b5cf3709..7e64ad9a68a 100644
--- a/3rdparty/genie/scripts/genie.lua
+++ b/3rdparty/genie/scripts/genie.lua
@@ -21,10 +21,11 @@
language "C"
kind "ConsoleApp"
flags {
- "No64BitChecks",
"ExtraWarnings",
+ "No64BitChecks",
"StaticRuntime"
}
+
includedirs {
"../src/host/lua-5.3.0/src"
}
@@ -44,6 +45,10 @@
"../src/host/lua-5.3.0/etc/*.c",
}
+ buildoptions {
+ "-m64",
+ }
+
configuration "Debug"
defines { "_DEBUG", "LUA_COMPAT_MODULE" }
flags { "Symbols" }
@@ -66,16 +71,11 @@
configuration "bsd"
targetdir "../bin/bsd"
- configuration "solaris"
- targetdir "../bin/solaris"
- defines { "_REENTRANT" }
- buildoptions { "-std=gnu99" }
- links { "dl" }
-
- configuration "linux or bsd or solaris"
- defines { "LUA_USE_POSIX", "LUA_USE_DLOPEN" }
- links { "m" }
- linkoptions { "-rdynamic" }
+ configuration "linux or bsd"
+ defines { "LUA_USE_POSIX", "LUA_USE_DLOPEN" }
+ buildoptions { "-Wno-implicit-fallthrough" }
+ links { "m" }
+ linkoptions { "-rdynamic" }
configuration "macosx"
targetdir "../bin/darwin"
@@ -83,8 +83,10 @@
links { "CoreServices.framework" }
configuration { "macosx", "gmake" }
- buildoptions { "-mmacosx-version-min=10.4" }
- linkoptions { "-mmacosx-version-min=10.4" }
+ buildoptions { "-mmacosx-version-min=10.6" }
+ linkoptions { "-mmacosx-version-min=10.6" }
+
+ configuration {}
--
diff --git a/3rdparty/genie/src/_manifest.lua b/3rdparty/genie/src/_manifest.lua
index d2be5f1dcb5..5d4a1ba5f41 100644
--- a/3rdparty/genie/src/_manifest.lua
+++ b/3rdparty/genie/src/_manifest.lua
@@ -64,19 +64,18 @@
"actions/vstudio/vs2013.lua",
"actions/vstudio/vs2015.lua",
"actions/vstudio/vs2017.lua",
+ "actions/vstudio/vs2019.lua",
"actions/vstudio/vsllvm.lua",
-- Xcode action
"actions/xcode/_xcode.lua",
"actions/xcode/xcode_common.lua",
"actions/xcode/xcode_project.lua",
-
- -- Xcode4 action
- "actions/xcode/xcode4_workspace.lua",
-
- -- Xcode6 action
- "actions/xcode/xcode6_project.lua",
- "actions/xcode/xcode6_config.lua",
+ "actions/xcode/xcode_scheme.lua",
+ "actions/xcode/xcode_workspace.lua",
+ "actions/xcode/xcode8.lua",
+ "actions/xcode/xcode9.lua",
+ "actions/xcode/xcode10.lua",
--FASTBuild action
"actions/fastbuild/_fastbuild.lua",
diff --git a/3rdparty/genie/src/actions/cmake/cmake_project.lua b/3rdparty/genie/src/actions/cmake/cmake_project.lua
index bc123eabeb2..e40486bfea9 100644
--- a/3rdparty/genie/src/actions/cmake/cmake_project.lua
+++ b/3rdparty/genie/src/actions/cmake/cmake_project.lua
@@ -50,8 +50,11 @@ function cmake.files(prj)
onbranchexit = function(node, depth)
end,
onleaf = function(node, depth)
- table.insert(ret, node.cfg.name)
- _p(1, '../%s', node.cfg.name)
+ assert(node, "unexpected empty node")
+ if node.cfg then
+ table.insert(ret, node.cfg.name)
+ _p(1, '../%s', node.cfg.name)
+ end
end,
}, true, 1)
diff --git a/3rdparty/genie/src/actions/fastbuild/fastbuild_project.lua b/3rdparty/genie/src/actions/fastbuild/fastbuild_project.lua
index eec65d584f5..1043b6f0bbc 100644
--- a/3rdparty/genie/src/actions/fastbuild/fastbuild_project.lua
+++ b/3rdparty/genie/src/actions/fastbuild/fastbuild_project.lua
@@ -54,17 +54,7 @@ local function compile(indentlevel, prj, cfg, commonbasepath)
end
_p(indentlevel, ".IncludeDirs = ''")
- local sortedincdirs = {}
- for _, includedir in ipairs(cfg.userincludedirs) do
- if includedir ~= nil then
- table.insert(sortedincdirs, includedir)
- end
- end
- for _, includedir in ipairs(cfg.includedirs) do
- if includedir ~= nil then
- table.insert(sortedincdirs, includedir)
- end
- end
+ local sortedincdirs = table.join(cfg.userincludedirs, cfg.includedirs, cfg.systemincludedirs)
-- Setup for special include dir sort to ensure that 'nearby' dirs get precedence over others.
-- Gets the relative path from commonbasepath and counts the steps in that path.
@@ -104,7 +94,6 @@ local function compile(indentlevel, prj, cfg, commonbasepath)
'"%1"',
'/nologo',
'/c',
- '/Gy',
'/Gm-',
'/Zc:inline',
'/errorReport:prompt',
@@ -167,11 +156,10 @@ local function compile(indentlevel, prj, cfg, commonbasepath)
if (cfg.flags.C7DebugInfo) then
table.insert(compileroptions, '/Z7')
else
- if (premake.config.isoptimizedbuild(cfg.flags)
- or cfg.flags.NoEditAndContinue) then
- table.insert(compileroptions, '/Zi')
- else
+ if premake.config.iseditandcontinue(cfg) then
table.insert(compileroptions, '/ZI')
+ else
+ table.insert(compileroptions, '/Zi')
end
local targetdir = add_trailing_backslash(cfg.buildtarget.directory)
table.insert(compileroptions, string.format("/Fd\"%s%s.pdb\"", targetdir, cfg.buildtarget.basename))
@@ -190,8 +178,16 @@ local function compile(indentlevel, prj, cfg, commonbasepath)
end
if isoptimised then
- table.insert(compileroptions, '/GF')
+ -- Refer to vstudio.vcxproj.lua about FunctionLevelLinking
+ if cfg.flags.NoOptimizeLink and cfg.flags.NoEditAndContinue then
+ table.insert(compileroptions, '/GF-')
+ table.insert(compileroptions, '/Gy-')
+ else
+ table.insert(compileroptions, '/GF')
+ table.insert(compileroptions, '/Gy')
+ end
else
+ table.insert(compileroptions, '/Gy')
table.insert(compileroptions, '/Od')
table.insert(compileroptions, '/RTC1')
end
@@ -364,7 +360,7 @@ local function binary(prj, cfg, useconfig, bintype, commonbasepath)
table.insert(linkeroptions, '/DEBUG')
end
- if premake.config.isoptimizedbuild(cfg.flags) then
+ if premake.config.islinkeroptimizedbuild(cfg.flags) then
table.insert(linkeroptions, '/OPT:REF')
table.insert(linkeroptions, '/OPT:ICF')
end
diff --git a/3rdparty/genie/src/actions/make/_make.lua b/3rdparty/genie/src/actions/make/_make.lua
index 6392ff46ac6..0f1a4b60519 100644
--- a/3rdparty/genie/src/actions/make/_make.lua
+++ b/3rdparty/genie/src/actions/make/_make.lua
@@ -33,6 +33,26 @@
end
end
+--
+-- Escape quoted string so it can be passed as define via command line.
+--
+
+ function _MAKE.escquote(value)
+ local result
+ if (type(value) == "table") then
+ result = { }
+ for _,v in ipairs(value) do
+ table.insert(result, _MAKE.escquote(v))
+ end
+ return result
+ else
+ -- handle simple replacements
+ result = value:gsub(" ", "\\ ")
+ result = result:gsub("\"", "\\\"")
+ return result
+ end
+ end
+
--
-- Rules for file ops based on the shell type. Can't use defines and $@ because
@@ -166,5 +186,7 @@
oncleanproject = function(prj)
premake.clean.file(prj, _MAKE.getmakefilename(prj, true))
- end
+ end,
+
+ gmake = {}
}
diff --git a/3rdparty/genie/src/actions/make/make_cpp.lua b/3rdparty/genie/src/actions/make/make_cpp.lua
index d071cd967c4..a4e92521bdc 100644
--- a/3rdparty/genie/src/actions/make/make_cpp.lua
+++ b/3rdparty/genie/src/actions/make/make_cpp.lua
@@ -1,4 +1,4 @@
---
+-- --
-- make_cpp.lua
-- Generate a C/C++ project makefile.
-- Copyright (c) 2002-2013 Jason Perkins and the Premake project
@@ -19,14 +19,10 @@
-- build a list of supported target platforms that also includes a generic build
local platforms = premake.filterplatforms(prj.solution, cc.platforms, "Native")
+ -- output build configurations
+ local action = premake.action.current()
premake.gmake_cpp_header(prj, cc, platforms)
-
- for _, platform in ipairs(platforms) do
- for cfg in premake.eachconfig(prj, platform) do
- premake.gmake_cpp_config(prj, cfg, cc)
- end
- end
-
+ premake.gmake_cpp_configs(prj, cc, platforms)
table.sort(prj.allfiles)
-- list object directories
@@ -66,7 +62,7 @@
_p('.PHONY: clean prebuild prelink')
_p('')
- if os.is("MacOSX") and prj.kind == "WindowedApp" then
+ if os.is("MacOSX") and prj.kind == "WindowedApp" and not prj.options.SkipBundling then
_p('all: $(OBJDIRS) $(TARGETDIR) prebuild prelink $(TARGET) $(dir $(TARGETDIR))PkgInfo $(dir $(TARGETDIR))Info.plist')
else
_p('all: $(OBJDIRS) $(TARGETDIR) prebuild prelink $(TARGET)')
@@ -89,7 +85,7 @@
end
-- target build rule
- _p('$(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(EXTERNAL_LIBS) $(RESOURCES) | $(TARGETDIR) $(OBJDIRS)')
+ _p('$(TARGET): $(GCH) $(OBJECTS) $(LIBDEPS) $(EXTERNAL_LIBS) $(RESOURCES) $(OBJRESP) $(LDRESP) | $(TARGETDIR) $(OBJDIRS)')
if prj.kind == "StaticLib" then
if prj.msgarchiving then
@@ -106,10 +102,10 @@
_p('else')
_p('\t$(SILENT) if exist $(subst /,\\\\,$(TARGET)) del $(subst /,\\\\,$(TARGET))')
_p('endif')
- _p('\t$(SILENT) $(LINKCMD) $(OBJECTS)' .. (os.is("MacOSX") and " 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'" or ""))
+ _p('\t$(SILENT) $(LINKCMD) $(LINKOBJS)' .. (os.is("MacOSX") and " 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'" or ""))
else
_p('\t$(call RM,$(TARGET))')
- _p('\t@$(call max_args,$(LINKCMD),'.. prj.archivesplit_size ..',$(OBJECTS))' .. (os.is("MacOSX") and " 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'" or ""))
+ _p('\t@$(call max_args,$(LINKCMD),'.. prj.archivesplit_size ..',$(LINKOBJS))' .. (os.is("MacOSX") and " 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'" or ""))
_p('\t$(SILENT) $(LINKCMD_NDX)')
end
else
@@ -120,6 +116,7 @@
end
_p('\t$(SILENT) $(LINKCMD)')
end
+
_p('\t$(POSTBUILDCMDS)')
_p('')
@@ -136,7 +133,7 @@
_p('')
-- Mac OS X specific targets
- if os.is("MacOSX") and prj.kind == "WindowedApp" then
+ if os.is("MacOSX") and prj.kind == "WindowedApp" and not prj.options.SkipBundling then
_p('$(dir $(TARGETDIR))PkgInfo:')
_p('$(dir $(TARGETDIR))Info.plist:')
_p('')
@@ -289,20 +286,42 @@
return false
end
- function premake.gmake_cpp_config(prj, cfg, cc)
+ function premake.gmake_cpp_configs(prj, cc, platforms)
+ for _, platform in ipairs(platforms) do
+ for cfg in premake.eachconfig(prj, platform) do
+ premake.gmake_cpp_config(prj, cfg, cc)
+ end
+ end
+ end
+ function premake.gmake_cpp_config(prj, cfg, cc)
_p('ifeq ($(config),%s)', _MAKE.esc(cfg.shortname))
-- if this platform requires a special compiler or linker, list it here
cpp.platformtools(cfg, cc)
+ local targetDir = _MAKE.esc(cfg.buildtarget.directory)
+
_p(' ' .. (table.contains(premake.make.override,"OBJDIR") and "override " or "") .. 'OBJDIR = %s', _MAKE.esc(cfg.objectsdir))
- _p(' ' .. (table.contains(premake.make.override,"TARGETDIR") and "override " or "") .. 'TARGETDIR = %s', _MAKE.esc(cfg.buildtarget.directory))
+ _p(' ' .. (table.contains(premake.make.override,"TARGETDIR") and "override " or "") .. 'TARGETDIR = %s', iif(targetDir == "", ".", targetDir))
_p(' ' .. (table.contains(premake.make.override,"TARGET") and "override " or "") .. 'TARGET = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name))
- _p(' DEFINES +=%s', make.list(cc.getdefines(cfg.defines)))
- _p(' INCLUDES +=%s', make.list(cc.getincludedirs(cfg.includedirs)))
- _p(' INCLUDES +=%s', make.list(cc.getquoteincludedirs(cfg.userincludedirs)))
+ _p(' DEFINES +=%s', make.list(_MAKE.escquote(cc.getdefines(cfg.defines))))
+
+ local id = make.list(cc.getincludedirs(cfg.includedirs));
+ local uid = make.list(cc.getquoteincludedirs(cfg.userincludedirs))
+ local sid = make.list(cc.getsystemincludedirs(cfg.systemincludedirs))
+ if id ~= "" then
+ _p(' INCLUDES +=%s', id)
+ end
+
+ if uid ~= "" then
+ _p(' INCLUDES +=%s', uid)
+ end
+
+ if sid ~= "" then
+ _p(' INCLUDES +=%s', sid)
+ end
-- set up precompiled headers
cpp.pchconfig(cfg)
@@ -316,6 +335,11 @@
table.sort(cfg.files)
-- add objects for compilation, and remove any that are excluded per config.
+ if cfg.flags.UseObjectResponseFile then
+ _p(' OBJRESP = $(OBJDIR)/%s_objects', prj.name)
+ else
+ _p(' OBJRESP =')
+ end
_p(' OBJECTS := \\')
for _, file in ipairs(cfg.files) do
if path.issourcefile(file) then
@@ -413,12 +437,46 @@
--
function cpp.linker(prj, cfg, cc)
- -- Patch #3401184 changed the order
+ local libdeps
+ local lddeps
+
+ if #cfg.wholearchive > 0 then
+ libdeps = {}
+ lddeps = {}
+
+ for _, linkcfg in ipairs(premake.getlinks(cfg, "siblings", "object")) do
+ local linkpath = path.rebase(linkcfg.linktarget.fullpath, linkcfg.location, cfg.location)
+
+ if table.icontains(cfg.wholearchive, linkcfg.project.name) then
+ lddeps = table.join(lddeps, cc.wholearchive(linkpath))
+ else
+ table.insert(lddeps, linkpath)
+ end
+
+ table.insert(libdeps, linkpath)
+ end
+
+ libdeps = make.list(_MAKE.esc(libdeps))
+ lddeps = make.list(_MAKE.esc(lddeps))
+ else
+ libdeps = make.list(_MAKE.esc(premake.getlinks(cfg, "siblings", "fullpath")))
+ lddeps = libdeps
+ end
+
_p(' ALL_LDFLAGS += $(LDFLAGS)%s', make.list(table.join(cc.getlibdirflags(cfg), cc.getldflags(cfg), cfg.linkoptions)))
+ _p(' LIBDEPS +=%s', libdeps)
+ _p(' LDDEPS +=%s', lddeps)
+
+ if cfg.flags.UseLDResponseFile then
+ _p(' LDRESP = $(OBJDIR)/%s_libs', prj.name)
+ _p(' LIBS += @$(LDRESP)%s', make.list(cc.getlinkflags(cfg)))
+ else
+ _p(' LDRESP =')
+ _p(' LIBS += $(LDDEPS)%s', make.list(cc.getlinkflags(cfg)))
+ end
- _p(' LDDEPS +=%s', make.list(_MAKE.esc(premake.getlinks(cfg, "siblings", "fullpath"))))
- _p(' LIBS += $(LDDEPS)%s', make.list(cc.getlinkflags(cfg)))
_p(' EXTERNAL_LIBS +=%s', make.list(cc.getlibfiles(cfg)))
+ _p(' LINKOBJS = %s', (cfg.flags.UseObjectResponseFile and "@$(OBJRESP)" or "$(OBJECTS)"))
if cfg.kind == "StaticLib" then
if (not prj.options.ArchiveSplit) then
@@ -428,15 +486,14 @@
_p(' LINKCMD_NDX = $(AR) %s $(TARGET)', make.list(cc.getarchiveflags(prj, cfg, true)))
end
else
-
- -- this was $(TARGET) $(LDFLAGS) $(OBJECTS)
- -- but had trouble linking to certain static libs; $(OBJECTS) moved up
- -- $(LDFLAGS) moved to end (http://sourceforge.net/p/premake/patches/107/)
- -- $(LIBS) moved to end (http://sourceforge.net/p/premake/bugs/279/)
-
local tool = iif(cfg.language == "C", "CC", "CXX")
- _p(' LINKCMD = $(%s) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)', tool)
-
+ local startgroup = ''
+ local endgroup = ''
+ if (cfg.flags.LinkSupportCircularDependencies) then
+ startgroup = '-Wl,--start-group '
+ endgroup = ' -Wl,--end-group'
+ end
+ _p(' LINKCMD = $(%s) -o $(TARGET) $(LINKOBJS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) %s$(LIBS)%s', tool, startgroup, endgroup)
end
end
@@ -520,19 +577,34 @@
function cpp.fileRules(prj, cc)
local platforms = premake.filterplatforms(prj.solution, cc.platforms, "Native")
- table.sort(prj.allfiles)
+ _p('ifneq (,$(OBJRESP))')
+ _p('$(OBJRESP): $(OBJECTS) | $(TARGETDIR) $(OBJDIRS)')
+ _p('\t$(SILENT) echo $^')
+ _p('\t$(SILENT) echo $^ > $@')
+ _p('endif')
+ _p('')
+
+ _p('ifneq (,$(LDRESP))')
+ _p('$(LDRESP): $(LDDEPS) | $(TARGETDIR) $(OBJDIRS)')
+ _p('\t$(SILENT) echo $^')
+ _p('\t$(SILENT) echo $^ > $@')
+ _p('endif')
+ _p('')
+ table.sort(prj.allfiles)
for _, file in ipairs(prj.allfiles or {}) do
if path.issourcefile(file) then
if (path.isobjcfile(file)) then
- _p('$(OBJDIR)/%s.o: %s $(GCH_OBJC) $(MAKEFILE)'
+ _p('$(OBJDIR)/%s.o: %s $(GCH_OBJC) $(MAKEFILE) | $(OBJDIR)/%s'
, _MAKE.esc(path.trimdots(path.removeext(file)))
, _MAKE.esc(file)
+ , _MAKE.esc(path.getdirectory(path.trimdots(file)))
)
else
- _p('$(OBJDIR)/%s.o: %s $(GCH) $(MAKEFILE)'
+ _p('$(OBJDIR)/%s.o: %s $(GCH) $(MAKEFILE) | $(OBJDIR)/%s'
, _MAKE.esc(path.trimdots(path.removeext(file)))
, _MAKE.esc(file)
+ , _MAKE.esc(path.getdirectory(path.trimdots(file)))
)
end
if (path.isobjcfile(file) and prj.msgcompile_objc) then
diff --git a/3rdparty/genie/src/actions/make/make_csharp.lua b/3rdparty/genie/src/actions/make/make_csharp.lua
index e241e11dc42..ea6a0fcf410 100644
--- a/3rdparty/genie/src/actions/make/make_csharp.lua
+++ b/3rdparty/genie/src/actions/make/make_csharp.lua
@@ -8,12 +8,12 @@
-- Given a .resx resource file, builds the path to corresponding .resource
-- file, matching the behavior and naming of Visual Studio.
--
-
+
local function getresourcefilename(cfg, fname)
if path.getextension(fname) == ".resx" then
- local name = cfg.buildtarget.basename .. "."
- local dir = path.getdirectory(fname)
- if dir ~= "." then
+ local name = cfg.buildtarget.basename .. "."
+ local dir = path.getdirectory(fname)
+ if dir ~= "." then
name = name .. path.translate(dir, ".") .. "."
end
return "$(OBJDIR)/" .. _MAKE.esc(name .. path.getbasename(fname)) .. ".resources"
@@ -27,7 +27,7 @@
--
-- Main function
--
-
+
function premake.make_csharp(prj)
local csc = premake.dotnet
@@ -47,12 +47,12 @@
end
end
end
-
+
-- sort the files into categories, based on their build action
local sources = {}
local embedded = { }
local copypairs = { }
-
+
for fcfg in premake.project.eachfile(prj) do
local action = csc.getbuildaction(fcfg)
if action == "Compile" then
@@ -78,19 +78,19 @@
copypairs[target] = _MAKE.esc(source)
end
end
-
+
-- end of preprocessing --
-- set up the environment
_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)
_p('')
-
+
_p('ifndef config')
_p(' config=%s', _MAKE.esc(prj.configurations[1]:lower()))
_p('endif')
_p('')
-
+
_p('ifndef verbose')
_p(' SILENT = @')
_p('endif')
@@ -122,7 +122,7 @@
_p(' CSC=%s', csc.getcompilervar(prj))
_p('endif')
_p('')
-
+
_p('ifndef RESGEN')
_p(' RESGEN=resgen')
_p('endif')
@@ -145,14 +145,14 @@
_p('FLAGS += /t:%s %s', csc.getkind(prj):lower(), table.implode(_MAKE.esc(prj.libdirs), "/lib:", "", " "))
_p('REFERENCES += %s', table.implode(_MAKE.esc(premake.getlinks(prj, "system", "basename")), "/r:", ".dll", " "))
_p('')
-
+
-- list source files
_p('SOURCES := \\')
for _, fname in ipairs(sources) do
_p('\t%s \\', _MAKE.esc(path.translate(fname)))
end
_p('')
-
+
_p('EMBEDFILES := \\')
for _, fname in ipairs(embedded) do
_p('\t%s \\', getresourcefilename(prj, fname))
@@ -184,10 +184,10 @@
-- main build rule(s)
_p('.PHONY: clean prebuild prelink')
_p('')
-
+
_p('all: $(TARGETDIR) $(OBJDIR) prebuild $(EMBEDFILES) $(COPYFILES) prelink $(TARGET)')
_p('')
-
+
_p('$(TARGET): $(SOURCES) $(EMBEDFILES) $(DEPENDS)')
_p('\t$(SILENT) $(CSC) /nologo /out:$@ $(FLAGS) $(REFERENCES) $(SOURCES) $(patsubst %%,/resource:%%,$(EMBEDFILES))')
_p('\t$(POSTBUILDCMDS)')
@@ -197,7 +197,7 @@
-- escaping, causing issues with spaces and parenthesis
_p('$(TARGETDIR):')
premake.make_mkdirrule("$(TARGETDIR)")
-
+
_p('$(OBJDIR):')
premake.make_mkdirrule("$(OBJDIR)")
@@ -205,7 +205,7 @@
_p('clean:')
_p('\t@echo Cleaning %s', prj.name)
_p('ifeq (posix,$(SHELLTYPE))')
- _p('\t$(SILENT) rm -f $(TARGETDIR)/%s.* $(COPYFILES)', prj.buildtarget.basename)
+ _p('\t$(SILENT) rm -f $(TARGET) $(COPYFILES)')
_p('\t$(SILENT) rm -rf $(OBJDIR)')
_p('else')
_p('\t$(SILENT) if exist $(subst /,\\\\,$(TARGETDIR)/%s.*) del $(subst /,\\\\,$(TARGETDIR)/%s.*)', prj.buildtarget.basename, prj.buildtarget.basename)
@@ -223,7 +223,7 @@
_p('prebuild:')
_p('\t$(PREBUILDCMDS)')
_p('')
-
+
_p('prelink:')
_p('\t$(PRELINKCMDS)')
_p('')
@@ -238,21 +238,21 @@
_p('endif')
_p('')
end
-
+
_p('# Copied file rules')
for target, source in pairs(copypairs) do
premake.make_copyrule(source, target)
end
_p('# Embedded file rules')
- for _, fname in ipairs(embedded) do
+ for _, fname in ipairs(embedded) do
if path.getextension(fname) == ".resx" then
_p('%s: %s', getresourcefilename(prj, fname), _MAKE.esc(fname))
_p('\t$(SILENT) $(RESGEN) $^ $@')
end
_p('')
end
-
+
end
@@ -261,35 +261,37 @@
--
function premake.gmake_cs_config(cfg, csc, cfglibs)
-
+
+ local targetDir = _MAKE.esc(cfg.buildtarget.directory)
+
_p('ifneq (,$(findstring %s,$(config)))', _MAKE.esc(cfg.name:lower()))
- _p(' TARGETDIR := %s', _MAKE.esc(cfg.buildtarget.directory))
+ _p(' TARGETDIR := %s', iif(targetDir == "", ".", targetDir))
_p(' OBJDIR := %s', _MAKE.esc(cfg.objectsdir))
_p(' DEPENDS := %s', table.concat(_MAKE.esc(premake.getlinks(cfg, "dependencies", "fullpath")), " "))
_p(' REFERENCES := %s', table.implode(_MAKE.esc(cfglibs[cfg]), "/r:", "", " "))
_p(' FLAGS += %s %s', table.implode(cfg.defines, "/d:", "", " "), table.concat(table.join(csc.getflags(cfg), cfg.buildoptions), " "))
-
+
_p(' define PREBUILDCMDS')
if #cfg.prebuildcommands > 0 then
_p('\t@echo Running pre-build commands')
_p('\t%s', table.implode(cfg.prebuildcommands, "", "", "\n\t"))
end
_p(' endef')
-
+
_p(' define PRELINKCMDS')
if #cfg.prelinkcommands > 0 then
_p('\t@echo Running pre-link commands')
_p('\t%s', table.implode(cfg.prelinkcommands, "", "", "\n\t"))
end
_p(' endef')
-
+
_p(' define POSTBUILDCMDS')
if #cfg.postbuildcommands > 0 then
_p('\t@echo Running post-build commands')
_p('\t%s', table.implode(cfg.postbuildcommands, "", "", "\n\t"))
end
_p(' endef')
-
+
_p('endif')
_p('')
diff --git a/3rdparty/genie/src/actions/ninja/ninja_base.lua b/3rdparty/genie/src/actions/ninja/ninja_base.lua
index 8c4e4c215b2..c4a174f306e 100644
--- a/3rdparty/genie/src/actions/ninja/ninja_base.lua
+++ b/3rdparty/genie/src/actions/ninja/ninja_base.lua
@@ -113,13 +113,15 @@ function new_cfg_proxy(cfg)
location = new,
objectsdir = path.rebase(cfg.objectsdir, old, new),
buildtarget = rebasekeys(table.deepcopy(cfg.buildtarget), keys, old, new),
- linktarget = rebasekeys(table.deepcopy(cfg.buildtarget), keys, old, new),
+ linktarget = rebasekeys(table.deepcopy(cfg.linktarget), keys, old, new),
}
- v.files = rebasearray(cfg.files, old, new)
- v.includedirs = rebasearray(cfg.includedirs, old, new)
- v.userincludedirs = rebasearray(cfg.userincludedirs, old, new)
- v.swiftmodulemaps = rebasearray(cfg.swiftmodulemaps, old, new)
+ v.files = rebasearray(cfg.files, old, new)
+ v.includedirs = rebasearray(cfg.includedirs, old, new)
+ v.libdirs = rebasearray(cfg.libdirs, old, new)
+ v.userincludedirs = rebasearray(cfg.userincludedirs, old, new)
+ v.systemincludedirs = rebasearray(cfg.systemincludedirs, old, new)
+ v.swiftmodulemaps = rebasearray(cfg.swiftmodulemaps, old, new)
return setmetatable(v, cfg_proxy)
end
diff --git a/3rdparty/genie/src/actions/ninja/ninja_cpp.lua b/3rdparty/genie/src/actions/ninja/ninja_cpp.lua
index 4007c117948..14cbf5d0456 100644
--- a/3rdparty/genie/src/actions/ninja/ninja_cpp.lua
+++ b/3rdparty/genie/src/actions/ninja/ninja_cpp.lua
@@ -8,6 +8,14 @@ local ninja = premake.ninja
local cpp = premake.ninja.cpp
local p = premake
+local function wrap_ninja_cmd(c)
+ if os.is("windows") then
+ return 'cmd /c "' .. c .. '"'
+ else
+ return c
+ end
+end
+
-- generate project + config build file
function ninja.generate_cpp(prj)
local pxy = ninja.get_proxy("prj", prj)
@@ -36,7 +44,7 @@ local p = premake
local flags = {
defines = ninja.list(tool.getdefines(cfg.defines)),
- includes = ninja.list(table.join(tool.getincludedirs(cfg.includedirs), tool.getquoteincludedirs(cfg.userincludedirs))),
+ includes = ninja.list(table.join(tool.getincludedirs(cfg.includedirs), tool.getquoteincludedirs(cfg.userincludedirs), tool.getsystemincludedirs(cfg.systemincludedirs))),
cppflags = ninja.list(tool.getcppflags(cfg)),
asmflags = ninja.list(table.join(tool.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_asm)),
cflags = ninja.list(table.join(tool.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)),
@@ -48,35 +56,67 @@ local p = premake
_p("# core rules for " .. cfg.name)
_p("rule cc")
- _p(" command = " .. tool.cc .. " $defines $includes $flags -MMD -MF $out.d -c -o $out $in")
+ _p(" command = " .. wrap_ninja_cmd(tool.cc .. " $defines $includes $flags -MMD -MF $out.d -c -o $out $in"))
_p(" description = cc $out")
- _p(" depfile = $out.d")
- _p(" deps = gcc")
+ _p(" depfile = $out.d")
+ _p(" deps = gcc")
_p("")
_p("rule cxx")
- _p(" command = " .. tool.cxx .. " $defines $includes $flags -MMD -MF $out.d -c -o $out $in")
+ _p(" command = " .. wrap_ninja_cmd(tool.cxx .. " $defines $includes $flags -MMD -MF $out.d -c -o $out $in"))
_p(" description = cxx $out")
- _p(" depfile = $out.d")
- _p(" deps = gcc")
+ _p(" depfile = $out.d")
+ _p(" deps = gcc")
_p("")
_p("rule ar")
- _p(" command = " .. tool.ar .. " $flags $out $in $libs " .. (os.is("MacOSX") and " 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'" or ""))
- _p(" description = ar $out")
+ _p(" command = " .. wrap_ninja_cmd(tool.ar .. " $flags $out @$out.rsp " .. (os.is("MacOSX") and " 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'" or "")))
+ _p(" description = ar $out")
+ _p(" rspfile = $out.rsp")
+ _p(" rspfile_content = $in $libs")
_p("")
local link = iif(cfg.language == "C", tool.cc, tool.cxx)
_p("rule link")
- _p(" command = " .. link .. " -o $out @$out.rsp $all_ldflags $libs")
- _p(" rspfile = $out.rsp")
- _p(" rspfile_content = $all_outputfiles")
- _p(" description = link $out")
+ local startgroup = ''
+ local endgroup = ''
+ if (cfg.flags.LinkSupportCircularDependencies) then
+ startgroup = '-Wl,--start-group'
+ endgroup = '-Wl,--end-group'
+ end
+ _p(" command = " .. wrap_ninja_cmd("$pre_link " .. link .. " -o $out @$out.rsp $all_ldflags $post_build"))
+ _p(" description = link $out")
+ _p(" rspfile = $out.rsp")
+ _p(" rspfile_content = $all_outputfiles " .. string.format("%s $libs %s", startgroup, endgroup))
+ _p("")
+
+ _p("rule exec")
+ _p(" command = " .. wrap_ninja_cmd("$command"))
+ _p(" description = Run $type commands")
_p("")
+ if #cfg.prebuildcommands > 0 then
+ _p("build __prebuildcommands_" .. premake.esc(prj.name) .. ": exec")
+ _p(1, "command = " .. wrap_ninja_cmd("echo Running pre-build commands && " .. table.implode(cfg.prebuildcommands, "", "", " && ")))
+ _p(1, "type = pre-build")
+ _p("")
+ end
+
+ cfg.pchheader_full = cfg.pchheader
+ for _, incdir in ipairs(cfg.includedirs) do
+ -- convert this back to an absolute path for os.isfile()
+ local abspath = path.getabsolute(path.join(cfg.project.location, cfg.shortname, incdir))
+
+ local testname = path.join(abspath, cfg.pchheader_full)
+ if os.isfile(testname) then
+ cfg.pchheader_full = path.getrelative(cfg.location, testname)
+ break
+ end
+ end
+
cpp.custombuildtask(prj, cfg)
cpp.dependencyRules(prj, cfg)
- cpp.file_rules(cfg, flags)
+ cpp.file_rules(prj, cfg, flags)
local objfiles = {}
@@ -98,6 +138,8 @@ local p = premake
local command_by_name = {}
local command_files = {}
+ local prebuildsuffix = #cfg.prebuildcommands > 0 and "||__prebuildcommands_" .. premake.esc(prj.name) or ""
+
for _, custombuildtask in ipairs(prj.custombuildtask or {}) do
for _, buildtask in ipairs(custombuildtask or {}) do
for _, cmd in ipairs(buildtask[4] or {}) do
@@ -156,7 +198,7 @@ local p = premake
_p("# custom build rules")
for command, details in pairs(seen_commands) do
_p("rule " .. details.name)
- _p(1, "command = " .. command)
+ _p(1, "command = " .. wrap_ninja_cmd(command))
end
for cmd_index, cmdsets in ipairs(command_files) do
@@ -167,7 +209,7 @@ local p = premake
for i, dep in ipairs(cmdset[3]) do
deps = deps .. path.getrelative(cfg.location, dep) .. ' '
end
- _p("build " .. file_out .. ': ' .. cmdset[4] .. ' ' .. file_in .. ' | ' .. deps)
+ _p("build " .. file_out .. ': ' .. cmdset[4] .. ' ' .. file_in .. ' | ' .. deps .. prebuildsuffix)
_p("")
end
end
@@ -175,6 +217,8 @@ local p = premake
function cpp.dependencyRules(prj, cfg)
local extra_deps = {}
+ local order_deps = {}
+ local extra_flags = {}
for _, dependency in ipairs(prj.dependency or {}) do
for _, dep in ipairs(dependency or {}) do
@@ -191,38 +235,90 @@ local p = premake
end
end
+ local pchfilename = cfg.pchheader_full and cpp.pchname(cfg, cfg.pchheader_full) or ''
+ for _, file in ipairs(cfg.files) do
+ local objfilename = file == cfg.pchheader and cpp.pchname(cfg, file) or cpp.objectname(cfg, file)
+ if path.issourcefile(file) or file == cfg.pchheader then
+ if #cfg.prebuildcommands > 0 then
+ if order_deps[objfilename] == nil then
+ order_deps[objfilename] = {}
+ end
+ table.insert(order_deps[objfilename], '__prebuildcommands_' .. premake.esc(prj.name))
+ end
+ end
+ if path.issourcefile(file) then
+ if cfg.pchheader_full and not cfg.flags.NoPCH then
+ local nopch = table.icontains(prj.nopch, file)
+ if not nopch then
+ local suffix = path.isobjcfile(file) and '_objc' or ''
+ if extra_deps[objfilename] == nil then
+ extra_deps[objfilename] = {}
+ end
+ table.insert(extra_deps[objfilename], pchfilename .. suffix .. ".gch")
+
+ if extra_flags[objfilename] == nil then
+ extra_flags[objfilename] = {}
+ end
+ table.insert(extra_flags[objfilename], '-include ' .. pchfilename .. suffix)
+ end
+ end
+ end
+ end
+
-- store prepared deps for file_rules() phase
cfg.extra_deps = extra_deps
+ cfg.order_deps = order_deps
+ cfg.extra_flags = extra_flags
end
function cpp.objectname(cfg, file)
return path.join(cfg.objectsdir, path.trimdots(path.removeext(file)) .. ".o")
end
- function cpp.file_rules(cfg, flags)
+ function cpp.pchname(cfg, file)
+ return path.join(cfg.objectsdir, path.trimdots(file))
+ end
+
+ function cpp.file_rules(prj,cfg, flags)
_p("# build files")
for _, file in ipairs(cfg.files) do
_p("# FILE: " .. file)
- if path.issourcefile(file) then
+ if cfg.pchheader_full == file then
+ local pchfilename = cpp.pchname(cfg, file)
+ local extra_deps = #cfg.extra_deps and '| ' .. table.concat(cfg.extra_deps[pchfilename] or {}, ' ') or ''
+ local order_deps = #cfg.order_deps and '|| ' .. table.concat(cfg.order_deps[pchfilename] or {}, ' ') or ''
+ local extra_flags = #cfg.extra_flags and ' ' .. table.concat(cfg.extra_flags[pchfilename] or {}, ' ') or ''
+ _p("build " .. pchfilename .. ".gch : cxx " .. file .. extra_deps .. order_deps)
+ _p(1, "flags = " .. flags['cxxflags'] .. extra_flags .. iif(prj.language == "C", "-x c-header", "-x c++-header"))
+ _p(1, "includes = " .. flags.includes)
+ _p(1, "defines = " .. flags.defines)
+
+ _p("build " .. pchfilename .. "_objc.gch : cxx " .. file .. extra_deps .. order_deps)
+ _p(1, "flags = " .. flags['objcflags'] .. extra_flags .. iif(prj.language == "C", "-x objective-c-header", "-x objective-c++-header"))
+ _p(1, "includes = " .. flags.includes)
+ _p(1, "defines = " .. flags.defines)
+ elseif path.issourcefile(file) then
local objfilename = cpp.objectname(cfg, file)
local extra_deps = #cfg.extra_deps and '| ' .. table.concat(cfg.extra_deps[objfilename] or {}, ' ') or ''
+ local order_deps = #cfg.order_deps and '|| ' .. table.concat(cfg.order_deps[objfilename] or {}, ' ') or ''
+ local extra_flags = #cfg.extra_flags and ' ' .. table.concat(cfg.extra_flags[objfilename] or {}, ' ') or ''
local cflags = "cflags"
if path.isobjcfile(file) then
- _p("build " .. objfilename .. ": cxx " .. file .. extra_deps)
+ _p("build " .. objfilename .. ": cxx " .. file .. extra_deps .. order_deps)
cflags = "objcflags"
elseif path.isasmfile(file) then
- _p("build " .. objfilename .. ": cc " .. file .. extra_deps)
+ _p("build " .. objfilename .. ": cc " .. file .. extra_deps .. order_deps)
cflags = "asmflags"
elseif path.iscfile(file) and not cfg.options.ForceCPP then
- _p("build " .. objfilename .. ": cc " .. file .. extra_deps)
+ _p("build " .. objfilename .. ": cc " .. file .. extra_deps .. order_deps)
else
- _p("build " .. objfilename .. ": cxx " .. file .. extra_deps)
+ _p("build " .. objfilename .. ": cxx " .. file .. extra_deps .. order_deps)
cflags = "cxxflags"
end
- _p(1, "flags = " .. flags[cflags])
+ _p(1, "flags = " .. flags[cflags] .. extra_flags)
_p(1, "includes = " .. flags.includes)
_p(1, "defines = " .. flags.defines)
elseif path.isresourcefile(file) then
@@ -238,26 +334,34 @@ local p = premake
local lddeps = ninja.list(premake.getlinks(cfg, "siblings", "fullpath"))
local libs = lddeps .. " " .. ninja.list(tool.getlinkflags(cfg))
+ local prebuildsuffix = #cfg.prebuildcommands > 0 and "||__prebuildcommands" or ""
+
local function writevars()
- _p(1, "all_ldflags = " .. all_ldflags)
- _p(1, "libs = " .. libs)
+ _p(1, "all_ldflags = " .. all_ldflags)
+ _p(1, "libs = " .. libs)
_p(1, "all_outputfiles = " .. table.concat(objfiles, " "))
+ if #cfg.prelinkcommands > 0 then
+ _p(1, 'pre_link = echo Running pre-link commands && ' .. table.implode(cfg.prelinkcommands, "", "", " && ") .. " && ")
+ end
+ if #cfg.postbuildcommands > 0 then
+ _p(1, 'post_build = && echo Running post-build commands && ' .. table.implode(cfg.postbuildcommands, "", "", " && "))
+ end
end
if cfg.kind == "StaticLib" then
local ar_flags = ninja.list(tool.getarchiveflags(cfg, cfg, false))
_p("# link static lib")
- _p("build " .. cfg:getoutputfilename() .. ": ar " .. table.concat(objfiles, " ") .. " | " .. lddeps)
+ _p("build " .. cfg:getoutputfilename() .. ": ar " .. table.concat(objfiles, " ") .. " | " .. lddeps .. prebuildsuffix)
_p(1, "flags = " .. ninja.list(tool.getarchiveflags(cfg, cfg, false)))
_p(1, "all_outputfiles = " .. table.concat(objfiles, " "))
- elseif cfg.kind == "SharedLib" then
+ elseif cfg.kind == "SharedLib" or cfg.kind == "Bundle" then
local output = cfg:getoutputfilename()
_p("# link shared lib")
- _p("build " .. output .. ": link " .. table.concat(objfiles, " ") .. " | " .. libs)
+ _p("build " .. output .. ": link " .. table.concat(objfiles, " ") .. " | " .. lddeps .. prebuildsuffix)
writevars()
elseif (cfg.kind == "ConsoleApp") or (cfg.kind == "WindowedApp") then
_p("# link executable")
- _p("build " .. cfg:getoutputfilename() .. ": link " .. table.concat(objfiles, " ") .. " | " .. lddeps)
+ _p("build " .. cfg:getoutputfilename() .. ": link " .. table.concat(objfiles, " ") .. " | " .. lddeps .. prebuildsuffix)
writevars()
else
p.error("ninja action doesn't support this kind of target " .. cfg.kind)
diff --git a/3rdparty/genie/src/actions/qbs/_qbs.lua b/3rdparty/genie/src/actions/qbs/_qbs.lua
index eddaee9dcb3..8f1ba4b5e0b 100644
--- a/3rdparty/genie/src/actions/qbs/_qbs.lua
+++ b/3rdparty/genie/src/actions/qbs/_qbs.lua
@@ -19,7 +19,7 @@ newaction
valid_kinds = {"ConsoleApp", "WindowedApp", "StaticLib", "SharedLib", "Bundle"},
valid_languages = {"C", "C++"},
valid_tools = {
- cc = { "gcc" },
+ cc = { "gcc", "msc" },
},
-- Solution and project generation logic
diff --git a/3rdparty/genie/src/actions/qbs/qbs_cpp.lua b/3rdparty/genie/src/actions/qbs/qbs_cpp.lua
index 1dd1d109d3c..4d76e178728 100644
--- a/3rdparty/genie/src/actions/qbs/qbs_cpp.lua
+++ b/3rdparty/genie/src/actions/qbs/qbs_cpp.lua
@@ -31,9 +31,10 @@ function qbs.generate_project(prj)
if prj.kind == "ConsoleApp" then
_p(indent, 'CppApplication {')
- _p(indent, 'consoleApplication: true')
+ _p(indent + 1, 'consoleApplication: true')
elseif prj.kind == "WindowedApp" then
_p(indent, 'CppApplication {')
+ _p(indent + 1, 'consoleApplication: false')
elseif prj.kind == "StaticLib" then
_p(indent, 'StaticLibrary {')
elseif prj.kind == "SharedLib" then
@@ -43,7 +44,6 @@ function qbs.generate_project(prj)
indent = indent + 1
_p(indent, 'name: "' .. prj.name .. '"')
- _p(indent, 'cpp.cxxLanguageVersion: "c++11"')
-- _p(indent, 'cpp.enableReproducibleBuilds: true')
_p(indent, 'Depends { name: "cpp" }')
@@ -99,6 +99,26 @@ function qbs.generate_project(prj)
-- , cc.getcppflags(cfg)
-- )
+ if cfg.flags.Cpp11 then
+ _p(indent, 'cpp.cxxLanguageVersion: "c++11"')
+ elseif cfg.flags.Cpp14 then
+ _p(indent, 'cpp.cxxLanguageVersion: "c++14"')
+ elseif cfg.flags.Cpp17 then
+ _p(indent, 'cpp.cxxLanguageVersion: "c++17"')
+ else
+ _p(indent, 'cpp.cxxLanguageVersion: "c++98"')
+ end
+
+ if os.is("windows") then
+ if not cfg.flags.WinMain and (cfg.kind == 'ConsoleApp' or cfg.kind == 'WindowedApp') then
+ if cfg.flags.Unicode then
+ _p(indent, 'cpp.entryPoint: "wmainCRTStartup"')
+ else
+ _p(indent, 'cpp.entryPoint: "mainCRTStartup"')
+ end
+ end
+ end
+
qbs.list(
indent
, "cpp.commonCompilerFlags"
@@ -199,18 +219,7 @@ function qbs.generate_project(prj)
, cfg.defines
)
- local sortedincdirs = {}
- for _, includedir in ipairs(cfg.userincludedirs) do
- if includedir ~= nil then
- table.insert(sortedincdirs, includedir)
- end
- end
- for _, includedir in ipairs(cfg.includedirs) do
- if includedir ~= nil then
- table.insert(sortedincdirs, includedir)
- end
- end
-
+ local sortedincdirs = table.join(cfg.userincludedirs, cfg.includedirs, cfg.systemincludedirs)
table.sort(sortedincdirs, includesort)
qbs.list(
indent
@@ -243,6 +252,7 @@ function qbs.generate_project(prj)
if path.iscfile(file)
or path.iscppfile(file)
or path.isobjcfile(file)
+ or path.isresourcefile(file)
or path.iscppheader(file) then
if not is_excluded(prj, cfg, file) then
_p(indent+1, '"%s",', file)
diff --git a/3rdparty/genie/src/actions/vstudio/_vstudio.lua b/3rdparty/genie/src/actions/vstudio/_vstudio.lua
index d9b8538c4ea..94bf748dc57 100644
--- a/3rdparty/genie/src/actions/vstudio/_vstudio.lua
+++ b/3rdparty/genie/src/actions/vstudio/_vstudio.lua
@@ -16,10 +16,12 @@
vs2013 = "v120",
vs2015 = "v140",
vs2017 = "v141",
+ vs2019 = "v142",
vsllvm = "llvm",
}
premake.vstudio.toolset = toolsets[_ACTION] or "unknown?"
premake.vstudio.splashpath = ''
+ premake.vstudio.xpwarning = true
local vstudio = premake.vstudio
@@ -41,6 +43,10 @@
ARM = "ARM",
Orbis = "ORBIS",
Durango = "Durango",
+ TegraAndroid = "Tegra-Android",
+ NX32 = "NX32",
+ NX64 = "NX64",
+ Emscripten = "Emscripten",
}
diff --git a/3rdparty/genie/src/actions/vstudio/vs2017.lua b/3rdparty/genie/src/actions/vstudio/vs2017.lua
index 80c02c7d817..ae515f43cc8 100644
--- a/3rdparty/genie/src/actions/vstudio/vs2017.lua
+++ b/3rdparty/genie/src/actions/vstudio/vs2017.lua
@@ -59,6 +59,6 @@
toolsVersion = "15.0",
windowsTargetPlatformVersion = "8.1",
supports64bitEditContinue = true,
- intDirAbsolute = true,
+ intDirAbsolute = false,
}
}
diff --git a/3rdparty/genie/src/actions/vstudio/vs2019.lua b/3rdparty/genie/src/actions/vstudio/vs2019.lua
new file mode 100644
index 00000000000..dbe2458bba1
--- /dev/null
+++ b/3rdparty/genie/src/actions/vstudio/vs2019.lua
@@ -0,0 +1,64 @@
+--
+-- vs2015.lua
+-- Baseline support for Visual Studio 2019.
+--
+
+ premake.vstudio.vc2019 = {}
+ local vc2019 = premake.vstudio.vc2019
+ local vstudio = premake.vstudio
+
+
+---
+-- Register a command-line action for Visual Studio 2019.
+---
+
+ newaction
+ {
+ trigger = "vs2019",
+ shortname = "Visual Studio 2019",
+ description = "Generate Microsoft Visual Studio 2019 project files",
+ os = "windows",
+
+ valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib", "Bundle" },
+
+ valid_languages = { "C", "C++", "C#" },
+
+ valid_tools = {
+ cc = { "msc" },
+ dotnet = { "msnet" },
+ },
+
+ onsolution = function(sln)
+ premake.generate(sln, "%%.sln", vstudio.sln2005.generate)
+ end,
+
+ onproject = function(prj)
+ if premake.isdotnetproject(prj) then
+ premake.generate(prj, "%%.csproj", vstudio.cs2005.generate)
+ premake.generate(prj, "%%.csproj.user", vstudio.cs2005.generate_user)
+ else
+ premake.vstudio.needAppxManifest = false
+ premake.generate(prj, "%%.vcxproj", premake.vs2010_vcxproj)
+ premake.generate(prj, "%%.vcxproj.user", premake.vs2010_vcxproj_user)
+ premake.generate(prj, "%%.vcxproj.filters", vstudio.vc2010.generate_filters)
+
+ if premake.vstudio.needAppxManifest then
+ premake.generate(prj, "%%/Package.appxmanifest", premake.vs2010_appxmanifest)
+ end
+ end
+ end,
+
+
+ oncleansolution = premake.vstudio.cleansolution,
+ oncleanproject = premake.vstudio.cleanproject,
+ oncleantarget = premake.vstudio.cleantarget,
+
+ vstudio = {
+ solutionVersion = "12",
+ targetFramework = "4.7.2",
+ toolsVersion = "16.0",
+ windowsTargetPlatformVersion = "10.0",
+ supports64bitEditContinue = true,
+ intDirAbsolute = false,
+ }
+ }
diff --git a/3rdparty/genie/src/actions/vstudio/vstudio_solution.lua b/3rdparty/genie/src/actions/vstudio/vstudio_solution.lua
index e6d7e06c684..8115798c8a2 100644
--- a/3rdparty/genie/src/actions/vstudio/vstudio_solution.lua
+++ b/3rdparty/genie/src/actions/vstudio/vstudio_solution.lua
@@ -131,6 +131,8 @@
function sln2005.projectdependencies(prj)
local deps = premake.getdependencies(prj)
if #deps > 0 then
+ local function compareuuid(a, b) return a.uuid < b.uuid end
+ table.sort(deps, compareuuid)
_p('\tProjectSection(ProjectDependencies) = postProject')
for _, dep in ipairs(deps) do
_p('\t\t{%s} = {%s}', dep.uuid, dep.uuid)
diff --git a/3rdparty/genie/src/actions/vstudio/vstudio_vcxproj.lua b/3rdparty/genie/src/actions/vstudio/vstudio_vcxproj.lua
index 0c2c6e08f0f..106996909da 100644
--- a/3rdparty/genie/src/actions/vstudio/vstudio_vcxproj.lua
+++ b/3rdparty/genie/src/actions/vstudio/vstudio_vcxproj.lua
@@ -10,6 +10,15 @@
local function vs2010_config(prj)
+ -- only include this bit if there's a Tegra platform in there
+ for _, cfginfo in ipairs(prj.solution.vstudio_configs) do
+ if cfginfo.src_platform == "TegraAndroid" then
+ _p(1,'<PropertyGroup Label="NsightTegraProject">')
+ _p(2,'<NsightTegraProjectRevisionNumber>11</NsightTegraProjectRevisionNumber>')
+ _p(1,'</PropertyGroup>')
+ break
+ end
+ end
_p(1,'<ItemGroup Label="ProjectConfigurations">')
for _, cfginfo in ipairs(prj.solution.vstudio_configs) do
_p(2,'<ProjectConfiguration Include="%s">', premake.esc(cfginfo.name))
@@ -51,11 +60,7 @@
else
_p(2, '<AppContainerApplication>true</AppContainerApplication>')
_p(2, '<MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>')
- if vstudio.toolset == "v120_wp81" then
- _p(2, '<ApplicationType>Windows Phone</ApplicationType>')
- else
- _p(2, '<ApplicationType>Windows Store</ApplicationType>')
- end
+ _p(2, '<ApplicationType>Windows Store</ApplicationType>')
_p(2, '<ApplicationTypeRevision>%s</ApplicationTypeRevision>', vstudio.storeapp)
end
else
@@ -69,6 +74,10 @@
_p(2,'<VCToolsVersion>14.14.26428</VCToolsVersion>')
end
+ if not vstudio.xpwarning then
+ _p(2, '<XPDeprecationWarning>false</XPDeprecationWarning>')
+ end
+
_p(1,'</PropertyGroup>')
end
@@ -110,12 +119,23 @@
--
function vc2010.configurationPropertyGroup(cfg, cfginfo)
- _p(1,'<PropertyGroup '..if_config_and_platform() ..' Label="Configuration">'
- , premake.esc(cfginfo.name))
- _p(2,'<ConfigurationType>%s</ConfigurationType>',vc2010.config_type(cfg))
- _p(2,'<UseDebugLibraries>%s</UseDebugLibraries>', iif(optimisation(cfg) == "Disabled","true","false"))
+ _p(1, '<PropertyGroup '..if_config_and_platform() ..' Label="Configuration">'
+ , premake.esc(cfginfo.name))
+
+ local is2019 = premake.action.current() == premake.action.get("vs2019")
+ if is2019 then
+ _p(2, '<VCProjectVersion>%s</VCProjectVersion>', action.vstudio.toolsVersion)
+ if cfg.flags.UnitySupport then
+ _p(2, '<EnableUnitySupport>true</EnableUnitySupport>')
+ end
+ end
+ _p(2, '<ConfigurationType>%s</ConfigurationType>', vc2010.config_type(cfg))
+ _p(2, '<UseDebugLibraries>%s</UseDebugLibraries>', iif(optimisation(cfg) == "Disabled","true","false"))
+ _p(2, '<PlatformToolset>%s</PlatformToolset>', premake.vstudio.toolset)
- _p(2,'<PlatformToolset>%s</PlatformToolset>', premake.vstudio.toolset)
+ if os.is64bit() then
+ _p(2, '<PreferredToolArchitecture>x64</PreferredToolArchitecture>')
+ end
if cfg.flags.MFC then
_p(2,'<UseOfMfc>%s</UseOfMfc>', iif(cfg.flags.StaticRuntime, "Static", "Dynamic"))
@@ -132,6 +152,41 @@
if cfg.flags.Managed then
_p(2,'<CLRSupport>true</CLRSupport>')
end
+
+ if cfg.platform == "TegraAndroid" then
+ if cfg.androidtargetapi then
+ _p(2,'<AndroidTargetAPI>android-%s</AndroidTargetAPI>', cfg.androidtargetapi)
+ end
+ if cfg.androidminapi then
+ _p(2,'<AndroidMinAPI>android-%s</AndroidMinAPI>', cfg.androidminapi)
+ end
+ if cfg.androidarch then
+ _p(2,'<AndroidArch>%s</AndroidArch>', cfg.androidarch)
+ end
+ if cfg.androidndktoolchainversion then
+ _p(2,'<NdkToolchainVersion>%s</NdkToolchainVersion>', cfg.androidndktoolchainversion)
+ end
+ if cfg.androidstltype then
+ _p(2,'<AndroidStlType>%s</AndroidStlType>', cfg.androidstltype)
+ end
+ end
+
+ if cfg.platform == "NX32" or cfg.platform == "NX64" then
+ _p(2,'<NintendoSdkRoot>$(NINTENDO_SDK_ROOT)\\</NintendoSdkRoot>')
+ _p(2,'<NintendoSdkSpec>NX</NintendoSdkSpec>')
+ --TODO: Allow specification of the 'Develop' build type
+ if premake.config.isdebugbuild(cfg) then
+ _p(2,'<NintendoSdkBuildType>Debug</NintendoSdkBuildType>')
+ else
+ _p(2,'<NintendoSdkBuildType>Release</NintendoSdkBuildType>')
+ end
+ end
+
+ -- Workaround for https://github.com/Microsoft/msbuild/issues/2353
+ if cfg.flags.Symbols and (premake.action.current() == premake.action.get("vs2017") or is2019) then
+ _p(2, '<DebugSymbols>true</DebugSymbols>')
+ end
+
_p(1,'</PropertyGroup>')
end
@@ -215,6 +270,10 @@
_p(2,'<LinkIncremental>%s</LinkIncremental>', tostring(premake.config.isincrementallink(cfg)))
end
+ if cfg.applicationdatadir ~= nil then
+ _p(2,'<ApplicationDataDir>%s</ApplicationDataDir>', premake.esc(cfg.applicationdatadir))
+ end
+
if cfg.flags.NoManifest then
_p(2,'<GenerateManifest>false</GenerateManifest>')
end
@@ -243,17 +302,30 @@
end
end
- local function preprocessor(indent,cfg)
+ local function preprocessor(indent,cfg,escape)
if #cfg.defines > 0 then
- _p(indent,'<PreprocessorDefinitions>%s;%%(PreprocessorDefinitions)</PreprocessorDefinitions>'
- ,premake.esc(table.concat(cfg.defines, ";")))
+ -- Visual Studio requires escaping of command line arguments to RC.
+ local defines = table.concat(cfg.defines, ";")
+ if escape then
+ defines = defines:gsub('"', '\\"')
+ end
+
+ -- do not add `%(PreprocessorDefinitions)` if it's already part of defines
+ local isPreprocessorDefinitionPresent = string.find(defines, "%%%(PreprocessorDefinitions%)")
+ if isPreprocessorDefinitionPresent then
+ _p(indent,'<PreprocessorDefinitions>%s</PreprocessorDefinitions>'
+ ,premake.esc(defines))
+ else
+ _p(indent,'<PreprocessorDefinitions>%s;%%(PreprocessorDefinitions)</PreprocessorDefinitions>'
+ ,premake.esc(defines))
+ end
else
_p(indent,'<PreprocessorDefinitions></PreprocessorDefinitions>')
end
end
local function include_dirs(indent,cfg)
- local includedirs = table.join(cfg.userincludedirs, cfg.includedirs)
+ local includedirs = table.join(cfg.userincludedirs, cfg.includedirs, cfg.systemincludedirs)
if #includedirs> 0 then
_p(indent,'<AdditionalIncludeDirectories>%s;%%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>'
@@ -270,18 +342,39 @@
local function resource_compile(cfg)
_p(2,'<ResourceCompile>')
- preprocessor(3,cfg)
+ preprocessor(3,cfg,true)
include_dirs(3,cfg)
_p(2,'</ResourceCompile>')
end
+ local function cppstandard_vs2017_or_2019(cfg)
+ if cfg.flags.CppLatest then
+ _p(3, '<LanguageStandard>stdcpplatest</LanguageStandard>')
+ _p(3, '<EnableModules>true</EnableModules>')
+ elseif cfg.flags.Cpp17 then
+ _p(3, '<LanguageStandard>stdcpp17</LanguageStandard>')
+ elseif cfg.flags.Cpp14 then
+ _p(3, '<LanguageStandard>stdcpp14</LanguageStandard>')
+ end
+ end
+
local function exceptions(cfg)
- if cfg.flags.NoExceptions then
- _p(3, '<ExceptionHandling>false</ExceptionHandling>')
- elseif cfg.flags.SEH then
- _p(3, '<ExceptionHandling>Async</ExceptionHandling>')
- --SEH is not required for Managed and is implied
+ if cfg.platform == "Orbis" then
+ if cfg.flags.NoExceptions then
+ _p(3, '<CppExceptions>false</CppExceptions>')
+ end
+ elseif cfg.platform == "TegraAndroid" then
+ if cfg.flags.NoExceptions then
+ _p(3, '<GccExceptionHandling>false</GccExceptionHandling>')
+ end
+ else
+ if cfg.flags.NoExceptions then
+ _p(3, '<ExceptionHandling>false</ExceptionHandling>')
+ elseif cfg.flags.SEH then
+ _p(3, '<ExceptionHandling>Async</ExceptionHandling>')
+ --SEH is not required for Managed and is implied
+ end
end
end
@@ -320,10 +413,18 @@
end
local function floating_point(cfg)
- if cfg.flags.FloatFast then
- _p(3,'<FloatingPointModel>Fast</FloatingPointModel>')
- elseif cfg.flags.FloatStrict and not cfg.flags.Managed then
- _p(3,'<FloatingPointModel>Strict</FloatingPointModel>')
+ if cfg.platform == "Orbis" then
+ if cfg.flags.FloatFast then
+ _p(3,'<FastMath>true</FastMath>')
+ end
+ elseif cfg.platform == "TegraAndroid" then
+ -- TODO: tegra setting
+ else
+ if cfg.flags.FloatFast then
+ _p(3,'<FloatingPointModel>Fast</FloatingPointModel>')
+ elseif cfg.flags.FloatStrict and not cfg.flags.Managed then
+ _p(3,'<FloatingPointModel>Strict</FloatingPointModel>')
+ end
end
end
@@ -339,9 +440,7 @@
if cfg.flags.C7DebugInfo then
debug_info = "OldStyle"
elseif (action.vstudio.supports64bitEditContinue == false and cfg.platform == "x64")
- or cfg.flags.Managed
- or premake.config.isoptimizedbuild(cfg.flags)
- or cfg.flags.NoEditAndContinue
+ or not premake.config.iseditandcontinue(cfg)
then
debug_info = "ProgramDatabase"
else
@@ -396,26 +495,72 @@
_p(3,'<AdditionalOptions>%s %s%%(AdditionalOptions)</AdditionalOptions>'
, table.concat(premake.esc(buildoptions), " ")
- , iif(cfg.flags.UnsignedChar, unsignedChar, " ")
+ , iif(cfg.flags.UnsignedChar and cfg.platform ~= "TegraAndroid", unsignedChar, " ")
)
- _p(3,'<Optimization>%s</Optimization>',optimisation(cfg))
+ if cfg.platform == "TegraAndroid" then
+ _p(3,'<SignedChar>%s</SignedChar>', tostring(cfg.flags.UnsignedChar == nil))
+ _p(3,'<GenerateDebugInformation>%s</GenerateDebugInformation>', tostring(cfg.flags.Symbols ~= nil))
+ if cfg.androidcppstandard then
+ _p(3,'<CppLanguageStandard>%s</CppLanguageStandard>', cfg.androidcppstandard)
+ end
+ end
+
+ if cfg.platform == "Orbis" then
+ local opt = optimisation(cfg)
+ if opt == "Disabled" then
+ _p(3,'<OptimizationLevel>Level0</OptimizationLevel>')
+ elseif opt == "MinSpace" then
+ _p(3,'<OptimizationLevel>Levelz</OptimizationLevel>') -- Oz is more aggressive than Os
+ elseif opt == "MaxSpeed" then
+ _p(3,'<OptimizationLevel>Level3</OptimizationLevel>')
+ else
+ _p(3,'<OptimizationLevel>Level2</OptimizationLevel>')
+ end
+ elseif cfg.platform == "TegraAndroid" then
+ local opt = optimisation(cfg)
+ if opt == "Disabled" then
+ _p(3,'<OptimizationLevel>O0</OptimizationLevel>')
+ elseif opt == "MinSpace" then
+ _p(3,'<OptimizationLevel>Os</OptimizationLevel>')
+ elseif opt == "MaxSpeed" then
+ _p(3,'<OptimizationLevel>O3</OptimizationLevel>')
+ else
+ _p(3,'<OptimizationLevel>O2</OptimizationLevel>')
+ end
+ else
+ _p(3,'<Optimization>%s</Optimization>', optimisation(cfg))
+ end
include_dirs(3, cfg)
using_dirs(3, cfg)
preprocessor(3, cfg)
minimal_build(cfg)
- if not premake.config.isoptimizedbuild(cfg.flags) then
- if not cfg.flags.Managed then
+ if premake.config.isoptimizedbuild(cfg.flags) then
+ -- Edit and continue is unstable with release/optimized projects. If the current project
+ -- is optimized, but linker optimizations are disabled and has opted out of edit and continue
+ -- support, then ensure that function level linking is disabled. This ensures that libs that
+ -- do have edit and continue enabled don't run into undefined behavior at runtime when linking
+ -- in optimized libs.
+ if cfg.flags.NoOptimizeLink and cfg.flags.NoEditAndContinue then
+ _p(3, '<StringPooling>false</StringPooling>')
+ _p(3, '<FunctionLevelLinking>false</FunctionLevelLinking>')
+ else
+ _p(3, '<StringPooling>true</StringPooling>')
+ _p(3, '<FunctionLevelLinking>true</FunctionLevelLinking>')
+ end
+ else
+ _p(3, '<FunctionLevelLinking>true</FunctionLevelLinking>')
+ if cfg.flags.NoRuntimeChecks then
+ _p(3, '<BasicRuntimeChecks>Default</BasicRuntimeChecks>')
+ elseif not cfg.flags.Managed then
_p(3, '<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>')
end
if cfg.flags.ExtraWarnings then
-- _p(3, '<SmallerTypeCheck>true</SmallerTypeCheck>')
end
- else
- _p(3, '<StringPooling>true</StringPooling>')
end
if cfg.platform == "Durango" or cfg.flags.NoWinRT then
@@ -428,7 +573,7 @@
_p(3, '<BufferSecurityCheck>false</BufferSecurityCheck>')
end
- _p(3,'<FunctionLevelLinking>true</FunctionLevelLinking>')
+
-- If we aren't running NoMultiprocessorCompilation and not wanting a minimal rebuild,
-- then enable MultiProcessorCompilation.
@@ -440,20 +585,55 @@
precompiled_header(cfg)
- if cfg.flags.PedanticWarnings then
- _p(3, '<WarningLevel>EnableAllWarnings</WarningLevel>')
- elseif cfg.flags.ExtraWarnings then
- _p(3, '<WarningLevel>Level4</WarningLevel>')
- elseif cfg.flags.MinimumWarnings then
- _p(3, '<WarningLevel>Level1</WarningLevel>')
+ if cfg.platform == "Orbis" then
+ if cfg.flags.PedanticWarnings then
+ _p(3, '<Warnings>MoreWarnings</Warnings>')
+ _p(3, '<ExtraWarnings>true</ExtraWarnings>')
+ elseif cfg.flags.ExtraWarnings then
+ _p(3, '<Warnings>NormalWarnings</Warnings>')
+ _p(3, '<ExtraWarnings>true</ExtraWarnings>')
+ elseif cfg.flags.MinimumWarnings then
+ _p(3, '<Warnings>WarningsOff</Warnings>')
+ _p(3, '<ExtraWarnings>false</ExtraWarnings>')
+ else
+ _p(3, '<Warnings>NormalWarnings</Warnings>')
+ _p(3, '<ExtraWarnings>false</ExtraWarnings>')
+ end
+ if cfg.flags.FatalWarnings then
+ _p(3, '<WarningsAsErrors>true</WarningsAsErrors>')
+ end
+ elseif cfg.platform == "TegraAndroid" then
+ if cfg.flags.PedanticWarnings or cfg.flags.ExtraWarnings then
+ _p(3, '<Warnings>AllWarnings</Warnings>')
+ elseif cfg.flags.MinimumWarnings then
+ _p(3, '<Warnings>DisableAllWarnings</Warnings>')
+ else
+ _p(3, '<Warnings>NormalWarnings</Warnings>')
+ end
+ if cfg.flags.FatalWarnings then
+ _p(3, '<WarningsAsErrors>true</WarningsAsErrors>')
+ end
else
- _p(3 ,'<WarningLevel>Level3</WarningLevel>')
+ if cfg.flags.PedanticWarnings then
+ _p(3, '<WarningLevel>EnableAllWarnings</WarningLevel>')
+ elseif cfg.flags.ExtraWarnings then
+ _p(3, '<WarningLevel>Level4</WarningLevel>')
+ elseif cfg.flags.MinimumWarnings then
+ _p(3, '<WarningLevel>Level1</WarningLevel>')
+ else
+ _p(3 ,'<WarningLevel>Level3</WarningLevel>')
+ end
end
if cfg.flags.FatalWarnings then
_p(3, '<TreatWarningAsError>true</TreatWarningAsError>')
end
+ if premake.action.current() == premake.action.get("vs2017") or
+ premake.action.current() == premake.action.get("vs2019") then
+ cppstandard_vs2017_or_2019(cfg)
+ end
+
exceptions(cfg)
rtti(cfg)
calling_convention(cfg)
@@ -466,12 +646,25 @@
_p(3,'<SupportJustMyCode>false</SupportJustMyCode>')
end
- if cfg.flags.Symbols
- and _ACTION:sub(3) ~= "2017" and _ACTION:sub(3) ~= "llvm"
- then
- _p(3, '<ProgramDataBaseFileName>$(OutDir)%s.pdb</ProgramDataBaseFileName>'
- , path.getbasename(cfg.buildtarget.name)
- )
+ if cfg.flags.Symbols then
+ -- The compiler pdb should be different than the linker pdb, and
+ -- the linker pdb is what should be distributed and used for
+ -- debugging. But in the case of static libraries, they have no
+ -- linker pdb, so then the compiler pdb should be in the output
+ -- dir instead...
+ if cfg.kind == "StaticLib" then
+ _p(3, '<ProgramDataBaseFileName>$(OutDir)%s.pdb</ProgramDataBaseFileName>'
+ , path.getbasename(cfg.buildtarget.name)
+ )
+ else
+ _p(3, '<ProgramDataBaseFileName>$(IntDir)%s.compile.pdb</ProgramDataBaseFileName>'
+ , path.getbasename(cfg.buildtarget.name)
+ )
+ end
+ end
+
+ if cfg.flags.Hotpatchable then
+ _p(3, '<CreateHotpatchableImage>true</CreateHotpatchableImage>')
end
if cfg.flags.NoFramePointer then
@@ -482,9 +675,20 @@
_p(3, '<UseFullPaths>true</UseFullPaths>')
end
+ if cfg.flags.NoJMC then
+ _p(3,'<SupportJustMyCode>false</SupportJustMyCode>' )
+ end
+
compile_language(cfg)
forcedinclude_files(3,cfg);
+
+ if vstudio.diagformat then
+ _p(3, '<DiagnosticsFormat>%s</DiagnosticsFormat>', vstudio.diagformat)
+ else
+ _p(3, '<DiagnosticsFormat>Caret</DiagnosticsFormat>')
+ end
+
_p(2,'</ClCompile>')
end
@@ -550,6 +754,60 @@
return #files > 0
end
+ local function ismanagedprj(prj, cfgname, pltname)
+ local cfg = premake.getconfig(prj, cfgname, pltname)
+ return cfg.flags.Managed == true
+ end
+
+ local function getcfglinks(cfg)
+ local haswholearchive = #cfg.wholearchive > 0
+ local msvcnaming = premake.getnamestyle(cfg) == "windows"
+ local iscppprj = premake.iscppproject(cfg)
+ local isnetprj = premake.isdotnetproject(cfg)
+ local linkobjs = {}
+ local links = iif(haswholearchive
+ , premake.getlinks(cfg, "all", "object")
+ , premake.getlinks(cfg, "system", "fullpath")
+ )
+
+ for _, link in ipairs(links) do
+ local name = nil
+ local directory = nil
+ local whole = nil
+
+ if type(link) == "table" then
+ -- if the link is to a managed project, we should ignore it
+ -- as managed projects don't have lib files.
+ if not ismanagedprj(link.project, cfg.name, cfg.platform) then
+ -- project config
+ name = link.linktarget.basename
+ directory = path.rebase(link.linktarget.directory, link.location, cfg.location)
+ whole = table.icontains(cfg.wholearchive, link.project.name)
+ end
+ else
+ -- link name
+ name = link
+ whole = table.icontains(cfg.wholearchive, link)
+ end
+
+ if name then
+ -- If we called premake.getlinks with "object", we need to
+ -- re-add the file extensions since it didn't do it for us.
+ if haswholearchive and msvcnaming then
+ if iscppprj then
+ name = name .. ".lib"
+ elseif isnetprj then
+ name = name .. ".dll"
+ end
+ end
+
+ table.insert(linkobjs, {name=name, directory=directory, wholearchive=whole})
+ end
+ end
+
+ return linkobjs
+ end
+
local function vs10_masm(prj, cfg)
if hasmasmfiles(prj) then
_p(2, '<MASM>')
@@ -558,7 +816,7 @@
, table.concat(premake.esc(table.join(cfg.buildoptions, cfg.buildoptions_asm)), " ")
)
- local includedirs = table.join(cfg.userincludedirs, cfg.includedirs)
+ local includedirs = table.join(cfg.userincludedirs, cfg.includedirs, cfg.systemincludedirs)
if #includedirs > 0 then
_p(3, '<IncludePaths>%s;%%(IncludePaths)</IncludePaths>'
@@ -597,40 +855,67 @@
end
end
+ local function additional_manifest(cfg)
+ if(cfg.dpiawareness ~= nil) then
+ _p(2,'<Manifest>')
+ if(cfg.dpiawareness == "None") then
+ _p(3, '<EnableDpiAwareness>false</EnableDpiAwareness>')
+ end
+ if(cfg.dpiawareness == "High") then
+ _p(3, '<EnableDpiAwareness>true</EnableDpiAwareness>')
+ end
+ if(cfg.dpiawareness == "HighPerMonitor") then
+ _p(3, '<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>')
+ end
+ _p(2,'</Manifest>')
+ end
+ end
+
--
-- Generate the <Link> element and its children.
--
function vc2010.link(cfg)
+ local vs2017OrLater = premake.action.current() == premake.action.get("vs2017") or
+ premake.action.current() == premake.action.get("vs2019")
+ local vsllvm = premake.action.current() == premake.action.get("vsllvm")
+ local links = getcfglinks(cfg)
+
_p(2,'<Link>')
_p(3,'<SubSystem>%s</SubSystem>', iif(cfg.kind == "ConsoleApp", "Console", "Windows"))
- _p(3,'<GenerateDebugInformation>%s</GenerateDebugInformation>',
- iif(cfg.flags.Symbols ~= nil, iif(_ACTION:sub(3) ~= "llvm", "true", "DebugFull"), "false")
- )
+ if (vs2017OrLater or vsllvm) and cfg.flags.FullSymbols then
+ _p(3,'<GenerateDebugInformation>DebugFull</GenerateDebugInformation>')
+ else
+ _p(3,'<GenerateDebugInformation>%s</GenerateDebugInformation>', tostring(cfg.flags.Symbols ~= nil))
+ end
- if cfg.flags.Symbols
- and (_ACTION:sub(3) == "2017" or _ACTION:sub(3) == "llvm")
- then
- _p(3, '<ProgramDataBaseFileName>$(OutDir)%s.pdb</ProgramDataBaseFileName>'
+ if cfg.flags.Symbols then
+ _p(3, '<ProgramDatabaseFile>$(OutDir)%s.pdb</ProgramDatabaseFile>'
, path.getbasename(cfg.buildtarget.name)
)
end
- if premake.config.isoptimizedbuild(cfg.flags) then
- _p(3,'<EnableCOMDATFolding>true</EnableCOMDATFolding>')
- _p(3,'<OptimizeReferences>true</OptimizeReferences>')
+ if premake.config.islinkeroptimizedbuild(cfg.flags) then
+ if cfg.platform == "Orbis" then
+ _p(3,'<DataStripping>StripFuncsAndData</DataStripping>')
+ _p(3,'<DuplicateStripping>true</DuplicateStripping>')
+ else
+ _p(3,'<EnableCOMDATFolding>true</EnableCOMDATFolding>')
+ _p(3,'<OptimizeReferences>true</OptimizeReferences>')
+ end
+ elseif cfg.platform == "Orbis" and premake.config.iseditandcontinue(cfg) then
+ _p(3,'<EditAndContinue>true</EditAndContinue>')
+ end
+
+ if cfg.finalizemetasource ~= nil then
+ _p(3,'<FinalizeMetaSource>%s</FinalizeMetaSource>', premake.esc(cfg.finalizemetasource))
end
if cfg.kind ~= 'StaticLib' then
- vc2010.additionalDependencies(3,cfg)
+ vc2010.additionalDependencies(3, cfg, links)
+ vc2010.additionalLibraryDirectories(3, cfg, links)
_p(3,'<OutputFile>$(OutDir)%s</OutputFile>', cfg.buildtarget.name)
- if #cfg.libdirs > 0 then
- _p(3,'<AdditionalLibraryDirectories>%s;%%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>'
- , premake.esc(path.translate(table.concat(cfg.libdirs, ';'), '\\'))
- )
- end
-
if vc2010.config_type(cfg) == 'Application' and not cfg.flags.WinMain and not cfg.flags.Managed then
if cfg.flags.Unicode then
_p(3,'<EntryPointSymbol>wmainCRTStartup</EntryPointSymbol>')
@@ -654,26 +939,80 @@
end
end
+ if cfg.platform == "TegraAndroid" then
+ if cfg.androidlinker then
+ _p(3,'<UseLinker>%s</UseLinker>',cfg.androidlinker)
+ end
+ end
+
+ if cfg.flags.Hotpatchable then
+ _p(3, '<CreateHotPatchableImage>Enabled</CreateHotPatchableImage>')
+ end
+
_p(2,'</Link>')
+
+ -- If any libraries are to be linked as whole archive, we need to
+ -- handle the linking manually, since there is no project configuration
+ -- option for that.
+ if #cfg.wholearchive > 0 then
+ _p(2, '<ProjectReference>')
+ _p(3, '<LinkLibraryDependencies>false</LinkLibraryDependencies>')
+ _p(2, '</ProjectReference>')
+ end
end
+ function vc2010.additionalLibraryDirectories(tab, cfg, links)
+ local dirs = cfg.libdirs
+
+ for _, link in ipairs(links) do
+ if link.directory and not table.icontains(dirs, link.directory) then
+ table.insert(dirs, link.directory)
+ end
+ end
+
+ _p(tab, '<AdditionalLibraryDirectories>%s;%%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>'
+ , premake.esc(path.translate(table.concat(dirs, ';'), '\\'))
+ )
+ end
+
--
-- Generate the <Link/AdditionalDependencies> element, which links in system
-- libraries required by the project (but not sibling projects; that's handled
-- by an <ItemGroup/ProjectReference>).
--
- function vc2010.additionalDependencies(tab,cfg)
- local links = premake.getlinks(cfg, "system", "fullpath")
+ function vc2010.additionalDependencies(tab, cfg, links)
if #links > 0 then
local deps = ""
+
if cfg.platform == "Orbis" then
- for _, v in ipairs(links) do
- deps = deps .. "-l" .. v .. ";"
+ local iswhole = false
+ for _, link in ipairs(links) do
+ if link.wholearchive and not iswhole then
+ deps = deps .. "--whole-archive;"
+ iswhole = true
+ elseif not link.wholearchive and iswhole then
+ deps = deps .. "--no-whole-archive;"
+ iswhole = false
+ end
+
+ deps = deps .. "-l" .. link.name .. ";"
end
else
- deps = table.concat(links, ";")
+ for _, link in ipairs(links) do
+ if link.wholearchive then
+ deps = deps .. "/WHOLEARCHIVE:" .. link.name .. ";"
+ else
+ deps = deps .. link.name .. ";"
+ end
+ end
+ end
+
+ -- On Android, we need to shove a linking group in to resolve libs
+ -- with circular deps.
+ if cfg.platform == "TegraAndroid" then
+ deps = "-Wl,--start-group;" .. deps .. ";-Wl,--end-group"
end
_p(tab, '<AdditionalDependencies>%s;%s</AdditionalDependencies>'
@@ -688,6 +1027,49 @@
end
end
+--
+-- Generate the <AntBuild> element and its children.
+--
+
+ function ant_build(prj, cfg)
+ -- only include this bit for Tegra
+ if cfg.platform == "TegraAndroid" then
+ local files = vc2010.getfilegroup(prj, "AndroidBuild")
+ _p(2,'<AntBuild>')
+ if #files > 0 then
+ _p(3,'<AndroidManifestLocation>%s</AndroidManifestLocation>',path.translate(files[1].name))
+ end
+ local isdebugbuild = premake.config.isdebugbuild(cfg)
+ _p(3,'<AntBuildType>%s</AntBuildType>',iif(isdebugbuild, 'Debug','Release'))
+ _p(3,'<Debuggable>%s</Debuggable>',tostring(cfg.flags.AntBuildDebuggable ~= nil))
+ if #cfg.antbuildjavasourcedirs > 0 then
+ local dirs = table.concat(cfg.antbuildjavasourcedirs,";")
+ _p(3,'<JavaSourceDir>%s</JavaSourceDir>',dirs)
+ end
+ if #cfg.antbuildjardirs > 0 then
+ local dirs = table.concat(cfg.antbuildjardirs,";")
+ _p(3,'<JarDirectories>%s</JarDirectories>',dirs)
+ end
+ if #cfg.antbuildjardependencies > 0 then
+ local dirs = table.concat(cfg.antbuildjardependencies,";")
+ _p(3,'<JarDependencies>%s</JarDependencies>',dirs)
+ end
+ if #cfg.antbuildnativelibdirs > 0 then
+ local dirs = table.concat(cfg.antbuildnativelibdirs,";")
+ _p(3,'<NativeLibDirectories>%s</NativeLibDirectories>',dirs)
+ end
+ if #cfg.antbuildnativelibdependencies > 0 then
+ local dirs = table.concat(cfg.antbuildnativelibdependencies,";")
+ _p(3,'<NativeLibDependencies>%s</NativeLibDependencies>',dirs)
+ end
+ if #cfg.antbuildassetsdirs > 0 then
+ local dirs = table.concat(cfg.antbuildassetsdirs,";")
+ _p(3,'<AssetsDirectories>%s</AssetsDirectories>',dirs)
+ end
+ _p(2,'</AntBuild>')
+ end
+ end
+
local function item_definitions(prj)
for _, cfginfo in ipairs(prj.solution.vstudio_configs) do
@@ -698,16 +1080,18 @@
resource_compile(cfg)
item_def_lib(prj, cfg)
vc2010.link(cfg)
+ ant_build(prj, cfg)
event_hooks(cfg)
vs10_masm(prj, cfg)
+ additional_manifest(cfg)
_p(1,'</ItemDefinitionGroup>')
end
end
--
--- Retrieve a list of files for a particular build group, one of
--- "ClInclude", "ClCompile", "ResourceCompile", "MASM", and "None".
+-- Retrieve a list of files for a particular build group, like
+-- "ClInclude", "ClCompile", "ResourceCompile", "MASM", "None", etc.
--
function vc2010.getfilegroup(prj, group)
@@ -717,9 +1101,11 @@
ClCompile = {},
ClInclude = {},
MASM = {},
+ Object = {},
None = {},
ResourceCompile = {},
AppxManifest = {},
+ AndroidBuild = {},
Natvis = {},
Image = {},
DeploymentContent = {}
@@ -733,6 +1119,8 @@
if not table.icontains(prj.removefiles, file) then
table.insert(sortedfiles.ClInclude, file)
end
+ elseif path.isobjectfile(file.name) then
+ table.insert(sortedfiles.Object, file)
elseif path.isresourcefile(file.name) then
table.insert(sortedfiles.ResourceCompile, file)
elseif path.isimagefile(file.name) then
@@ -740,6 +1128,8 @@
elseif path.isappxmanifest(file.name) then
foundAppxManifest = true
table.insert(sortedfiles.AppxManifest, file)
+ elseif path.isandroidbuildfile(file.name) then
+ table.insert(sortedfiles.AndroidBuild, file)
elseif path.isnatvis(file.name) then
table.insert(sortedfiles.Natvis, file)
elseif path.isasmfile(file.name) then
@@ -797,10 +1187,12 @@
function vc2010.files(prj)
vc2010.simplefilesgroup(prj, "ClInclude")
vc2010.compilerfilesgroup(prj)
+ vc2010.simplefilesgroup(prj, "Object")
vc2010.simplefilesgroup(prj, "None")
vc2010.customtaskgroup(prj)
vc2010.simplefilesgroup(prj, "ResourceCompile")
vc2010.simplefilesgroup(prj, "AppxManifest")
+ vc2010.simplefilesgroup(prj, "AndroidBuild")
vc2010.simplefilesgroup(prj, "Natvis")
vc2010.deploymentcontentgroup(prj, "Image")
vc2010.deploymentcontentgroup(prj, "DeploymentContent", "None")
@@ -819,16 +1211,20 @@
if #files > 0 then
_p(1,'<ItemGroup>')
local groupedBuildTasks = {}
+ local buildTaskNames = {}
+
for _, custombuildtask in ipairs(prj.custombuildtask or {}) do
for _, buildtask in ipairs(custombuildtask or {}) do
if (groupedBuildTasks[buildtask[1]] == nil) then
groupedBuildTasks[buildtask[1]] = {}
+ table.insert(buildTaskNames, buildtask[1])
end
table.insert(groupedBuildTasks[buildtask[1]], buildtask)
end
end
- for name, custombuildtask in pairs(groupedBuildTasks or {}) do
+ for _, name in ipairs(buildTaskNames) do
+ custombuildtask = groupedBuildTasks[name]
_p(2,'<CustomBuild Include=\"%s\">', path.translate(path.getrelative(prj.location,name), "\\"))
_p(3,'<FileType>Text</FileType>')
local cmd = ""
@@ -858,18 +1254,62 @@
end
function vc2010.simplefilesgroup(prj, section, subtype)
+ local configs = prj.solution.vstudio_configs
local files = vc2010.getfilegroup(prj, section)
+
if #files > 0 then
+ local config_mappings = {}
+
+ for _, cfginfo in ipairs(configs) do
+ local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)
+ if cfg.pchheader and cfg.pchsource and not cfg.flags.NoPCH then
+ config_mappings[cfginfo] = path.translate(cfg.pchsource, "\\")
+ end
+ end
+
_p(1,'<ItemGroup>')
+
for _, file in ipairs(files) do
- if subtype then
- _p(2,'<%s Include=\"%s\">', section, path.translate(file.name, "\\"))
- _p(3,'<SubType>%s</SubType>', subtype)
+ local prjexcluded = table.icontains(prj.excludes, file.name)
+ local excludedcfgs = {}
+
+ if not prjexcluded then
+ for _, vsconfig in ipairs(configs) do
+ local cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)
+ local fileincfg = table.icontains(cfg.files, file.name)
+ local cfgexcluded = table.icontains(cfg.excludes, file.name)
+
+ if not fileincfg or cfgexcluded then
+ table.insert(excludedcfgs, vsconfig.name)
+ end
+ end
+ end
+
+ if subtype or prjexcluded or #excludedcfgs > 0 then
+ _p(2, '<%s Include=\"%s\">', section, path.translate(file.name, "\\"))
+
+ if prjexcluded then
+ _p(3, '<ExcludedFromBuild>true</ExcludedFromBuild>')
+ else
+ for _, cfgname in ipairs(excludedcfgs) do
+ _p(3, '<ExcludedFromBuild '
+ .. if_config_and_platform()
+ .. '>true</ExcludedFromBuild>'
+ , premake.esc(cfgname)
+ )
+ end
+ end
+
+ if subtype then
+ _p(3, '<SubType>%s</SubType>', subtype)
+ end
+
_p(2,'</%s>', section)
else
- _p(2,'<%s Include=\"%s\" />', section, path.translate(file.name, "\\"))
+ _p(2, '<%s Include=\"%s\" />', section, path.translate(file.name, "\\"))
end
end
+
_p(1,'</ItemGroup>')
end
end
@@ -906,12 +1346,29 @@
end
_p(1,'<ItemGroup>')
+ local existingBasenames = {};
for _, file in ipairs(files) do
+ -- Having unique ObjectFileName for each file subverts MSBuilds ability to parallelize compilation with the /MP flag.
+ -- Instead we detect duplicates and partition them in subfolders only if needed.
+ local filename = string.lower(path.getbasename(file.name))
+ local disambiguation = existingBasenames[filename] or 0;
+ existingBasenames[filename] = disambiguation + 1
+
local translatedpath = path.translate(file.name, "\\")
_p(2, '<ClCompile Include=\"%s\">', translatedpath)
- _p(3, '<ObjectFileName>$(IntDir)%s\\</ObjectFileName>'
- , premake.esc(path.translate(path.trimdots(path.getdirectory(file.name))))
- )
+
+ for _, vsconfig in ipairs(configs) do
+ -- Android and NX need a full path to an object file, not a dir.
+ local cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)
+ local namestyle = premake.getnamestyle(cfg)
+ if namestyle == "TegraAndroid" or namestyle == "NX" then
+ _p(3, '<ObjectFileName '.. if_config_and_platform() .. '>$(IntDir)%s.o</ObjectFileName>', premake.esc(vsconfig.name), premake.esc(path.translate(path.trimdots(path.removeext(file.name)))) )
+ else
+ if disambiguation > 0 then
+ _p(3, '<ObjectFileName '.. if_config_and_platform() .. '>$(IntDir)%s\\</ObjectFileName>', premake.esc(vsconfig.name), tostring(disambiguation))
+ end
+ end
+ end
if path.iscxfile(file.name) then
_p(3, '<CompileAsWinRT>true</CompileAsWinRT>')
@@ -1055,11 +1512,8 @@
item_definitions(prj)
- if prj.flags.Managed then
- vc2010.clrReferences(prj)
- end
-
vc2010.files(prj)
+ vc2010.clrReferences(prj)
vc2010.projectReferences(prj)
vc2010.sdkReferences(prj)
vc2010.masmfiles(prj)
@@ -1109,6 +1563,12 @@
return
end
+ -- Sort dependencies by uuid to keep the project files from changing
+ -- unnecessarily.
+ local function compareuuid(a, b) return a.uuid < b.uuid end
+ table.sort(deps, compareuuid)
+ table.sort(table.join(prj.vsimportreferences), compareuuid)
+
_p(1,'<ItemGroup>')
for _, dep in ipairs(deps) do
@@ -1122,8 +1582,11 @@
end
for _, ref in ipairs(prj.vsimportreferences) do
- local iprj = premake.vstudio.getimportprj(ref, prj.solution)
- _p(2,'<ProjectReference Include=\"%s\">', iprj.relpath)
+ -- Convert the path from being relative to the project to being
+ -- relative to the solution, for lookup.
+ local slnrelpath = path.rebase(ref, prj.location, sln.location)
+ local iprj = premake.vstudio.getimportprj(slnrelpath, prj.solution)
+ _p(2,'<ProjectReference Include=\"%s\">', ref)
_p(3,'<Project>{%s}</Project>', iprj.uuid)
_p(2,'</ProjectReference>')
end
@@ -1151,11 +1614,15 @@
--
function vc2010.debugdir(cfg)
+ local isnx = (cfg.platform == "NX32" or cfg.platform == "NX64")
local debuggerFlavor =
- iif(cfg.platform == "Orbis", 'ORBISDebugger'
- , iif(cfg.platform == "Durango", 'XboxOneVCppDebugger'
- , 'WindowsLocalDebugger'
- ))
+ iif(isnx, 'OasisNXDebugger'
+ , iif(cfg.platform == "Orbis", 'ORBISDebugger'
+ , iif(cfg.platform == "Durango", 'XboxOneVCppDebugger'
+ , iif(cfg.platform == "TegraAndroid", 'AndroidDebugger'
+ , iif(vstudio.iswinrt(), 'AppHostLocalDebugger'
+ , 'WindowsLocalDebugger'
+ )))))
_p(2, '<DebuggerFlavor>%s</DebuggerFlavor>', debuggerFlavor)
if cfg.debugdir and not vstudio.iswinrt() then
@@ -1164,6 +1631,10 @@
)
end
+ if cfg.debugcmd then
+ _p(2, '<LocalDebuggerCommand>%s</LocalDebuggerCommand>', cfg.debugcmd)
+ end
+
if cfg.debugargs then
_p(2, '<LocalDebuggerCommandArguments>%s</LocalDebuggerCommandArguments>'
, table.concat(cfg.debugargs, " ")
@@ -1181,7 +1652,15 @@
end
if cfg.deploymode then
- _p(' <DeployMode>%s</DeployMode>', cfg.deploymode)
+ _p(2, '<DeployMode>%s</DeployMode>', cfg.deploymode)
+ end
+
+ if cfg.platform == "TegraAndroid" then
+ if cfg.androiddebugintentparams then
+ _p(2, '<IntentParams>%s</IntentParams>'
+ , table.concat(cfg.androiddebugintentparams, " ")
+ )
+ end
end
end
@@ -1222,22 +1701,25 @@
io.indent = " "
io.eol = "\r\n"
_p('<?xml version="1.0" encoding="utf-8"?>')
- if vstudio.toolset == "v120_wp81" then
- _p('<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest" xmlns:m3="http://schemas.microsoft.com/appx/2014/manifest" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest">')
- elseif vstudio.storeapp == "8.1" then
- _p('<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m3="http://schemas.microsoft.com/appx/2013/manifest">')
+ if vstudio.storeapp == "10.0" then
+ _p('<Package')
+ _p(1, 'xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"')
+ _p(1, 'xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"')
+ _p(1, 'xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"')
+ _p(1, 'IgnorableNamespaces="uap mp">')
elseif vstudio.storeapp == "durango" then
_p('<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:mx="http://schemas.microsoft.com/appx/2013/xbox/manifest" IgnorableNamespaces="mx">')
- else
- _p('<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:m3="http://schemas.microsoft.com/appx/manifest/uap/windows10">')
end
- _p(1,'<Identity Name="' .. prj.uuid .. '"')
- _p(2,'Publisher="CN=Publisher"')
- _p(2,'Version="1.0.0.0" />')
+ _p(1, '<Identity')
+ _p(2, 'Name="' .. prj.uuid .. '"')
+ _p(2, 'Publisher="CN=Publisher"')
+ _p(2, 'Version="1.0.0.0" />')
- if vstudio.toolset == "v120_wp81" or vstudio.storeapp == "8.2" then
- _p(1,'<mp:PhoneIdentity PhoneProductId="' .. prj.uuid .. '" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>')
+ if vstudio.storeapp == "10.0" then
+ _p(1, '<mp:PhoneIdentity')
+ _p(2, 'PhoneProductId="' .. prj.uuid .. '"')
+ _p(2, 'PhonePublisherId="00000000-0000-0000-0000-000000000000"/>')
end
_p(1, '<Properties>')
@@ -1249,7 +1731,7 @@
_p(1,'</Properties>')
- if vstudio.storeapp == "8.2" then
+ if vstudio.storeapp == "10.0" then
_p(1, '<Dependencies>')
_p(2, '<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.10069.0" MaxVersionTested="10.0.10069.0" />')
_p(1, '</Dependencies>')
@@ -1258,22 +1740,34 @@
_p(2, '<OSMinVersion>6.2</OSMinVersion>')
_p(2, '<OSMaxVersionTested>6.2</OSMaxVersionTested>')
_p(1, '</Prerequisites>')
- else
- _p(1, '<Prerequisites>')
- _p(2, '<OSMinVersion>6.3.0</OSMinVersion>')
- _p(2, '<OSMaxVersionTested>6.3.0</OSMaxVersionTested>')
- _p(1, '</Prerequisites>')
end
- _p(1,'<Resources>')
- _p(2,'<Resource Language="en-us"/>')
- _p(1,'</Resources>')
+ _p(1, '<Resources>')
+ _p(2, '<Resource Language="en-us"/>')
+ _p(1, '</Resources>')
- _p(1,'<Applications>')
- _p(2,'<Application Id="App"')
- _p(3,'Executable="$targetnametoken$.exe"')
- _p(3,'EntryPoint="' .. prj.name .. '.App">')
- if vstudio.storeapp == "durango" then
+ _p(1, '<Applications>')
+ _p(2, '<Application Id="App"')
+ _p(3, 'Executable="$targetnametoken$.exe"')
+ _p(3, 'EntryPoint="' .. prj.name .. '.App">')
+ if vstudio.storeapp == "10.0" then
+ _p(3, '<uap:VisualElements')
+ _p(4, 'DisplayName="' .. prj.name .. '"')
+ _p(4, 'Square150x150Logo="' .. prj.name .. '\\Logo.png"')
+ png1x1(prj, "%%/Logo.png")
+ if vstudio.storeapp == "10.0" then
+ _p(4, 'Square44x44Logo="' .. prj.name .. '\\SmallLogo.png"')
+ png1x1(prj, "%%/SmallLogo.png")
+ else
+ _p(4, 'Square30x30Logo="' .. prj.name .. '\\SmallLogo.png"')
+ png1x1(prj, "%%/SmallLogo.png")
+ end
+ _p(4, 'Description="' .. prj.name .. '"')
+ _p(4, 'BackgroundColor="transparent">')
+ _p(4, '<uap:SplashScreen Image="' .. prj.name .. '\\SplashScreen.png" />')
+ png1x1(prj, "%%/SplashScreen.png")
+ _p(3, '</uap:VisualElements>')
+ elseif vstudio.storeapp == "durango" then
_p(3, '<VisualElements')
_p(4, 'DisplayName="' .. prj.name .. '"')
_p(4, 'Logo="' .. prj.name .. '\\Logo.png"')
@@ -1291,27 +1785,9 @@
_p(4, '<mx:XboxSystemResources />')
_p(4, '</mx:Extension>')
_p(3, '</Extensions>')
- else
- _p(3, '<m3:VisualElements')
- _p(4, 'DisplayName="' .. prj.name .. '"')
- _p(4, 'Square150x150Logo="' .. prj.name .. '\\Logo.png"')
- png1x1(prj, "%%/Logo.png")
- if vstudio.toolset == "v120_wp81" or vstudio.storeapp == "8.2" then
- _p(4, 'Square44x44Logo="' .. prj.name .. '\\SmallLogo.png"')
- png1x1(prj, "%%/SmallLogo.png")
- else
- _p(4, 'Square30x30Logo="' .. prj.name .. '\\SmallLogo.png"')
- png1x1(prj, "%%/SmallLogo.png")
- end
- _p(4, 'Description="' .. prj.name .. '"')
- _p(4, 'ForegroundText="light"')
- _p(4, 'BackgroundColor="transparent">')
- _p(4, '<m3:SplashScreen Image="' .. prj.name .. '\\SplashScreen.png" />')
- png1x1(prj, "%%/SplashScreen.png")
- _p(3, '</m3:VisualElements>')
end
- _p(2,'</Application>')
- _p(1,'</Applications>')
+ _p(2, '</Application>')
+ _p(1, '</Applications>')
_p('</Package>')
end
diff --git a/3rdparty/genie/src/actions/vstudio/vstudio_vcxproj_filters.lua b/3rdparty/genie/src/actions/vstudio/vstudio_vcxproj_filters.lua
index 5df1f80db35..0515f2a8993 100644
--- a/3rdparty/genie/src/actions/vstudio/vstudio_vcxproj_filters.lua
+++ b/3rdparty/genie/src/actions/vstudio/vstudio_vcxproj_filters.lua
@@ -133,6 +133,7 @@
vc2010.filefiltergroup(prj, "None")
vc2010.filefiltergroup(prj, "ClInclude")
vc2010.filefiltergroup(prj, "ClCompile")
+ vc2010.filefiltergroup(prj, "Object")
vc2010.filefiltergroup(prj, "ResourceCompile")
vc2010.filefiltergroup(prj, "CustomBuild")
vc2010.filefiltergroup(prj, "AppxManifest")
diff --git a/3rdparty/genie/src/actions/xcode/_xcode.lua b/3rdparty/genie/src/actions/xcode/_xcode.lua
index f14e8d7300e..406486f796a 100644
--- a/3rdparty/genie/src/actions/xcode/_xcode.lua
+++ b/3rdparty/genie/src/actions/xcode/_xcode.lua
@@ -5,8 +5,6 @@
--
premake.xcode = { }
- premake.xcode.xcode6 = { }
-
--
-- Verify only single target kind for Xcode project
@@ -15,7 +13,7 @@
-- Project to be analyzed
--
- local function checkproject(prj)
+ function premake.xcode.checkproject(prj)
-- Xcode can't mix target kinds within a project
local last
for cfg in premake.eachconfig(prj) do
@@ -31,87 +29,3 @@
--
premake.xcode.toolset = "macosx"
-
- newaction
- {
- trigger = "xcode3",
- shortname = "Xcode 3",
- description = "Generate Apple Xcode 3 project files (experimental)",
- os = "macosx",
-
- valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib", "Bundle" },
-
- valid_languages = { "C", "C++" },
-
- valid_tools = {
- cc = { "gcc" },
- },
-
- valid_platforms = {
- Native = "Native",
- x32 = "Native 32-bit",
- x64 = "Native 64-bit",
- Universal32 = "32-bit Universal",
- Universal64 = "64-bit Universal",
- Universal = "Universal",
- },
-
- default_platform = "Universal",
-
- onsolution = function(sln)
- -- Assign IDs needed for inter-project dependencies
- premake.xcode.preparesolution(sln)
- end,
-
- onproject = function(prj)
- premake.generate(prj, "%%.xcodeproj/project.pbxproj", premake.xcode.project)
- end,
-
- oncleanproject = function(prj)
- premake.clean.directory(prj, "%%.xcodeproj")
- end,
-
- oncheckproject = checkproject,
- }
-
- newaction
- {
- trigger = "xcode4",
- shortname = "Xcode 4",
- description = "Generate Apple Xcode 4 project files (experimental)",
- os = "macosx",
-
- valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib", "Bundle" },
-
- valid_languages = { "C", "C++" },
-
- valid_tools = {
- cc = { "gcc" },
- },
-
- valid_platforms = {
- Native = "Native",
- x32 = "Native 32-bit",
- x64 = "Native 64-bit",
- Universal32 = "32-bit Universal",
- Universal64 = "64-bit Universal",
- Universal = "Universal",
- },
-
- default_platform = "Universal",
-
- onsolution = function(sln)
- premake.generate(sln, "%%.xcworkspace/contents.xcworkspacedata", premake.xcode4.workspace_generate)
- end,
-
- onproject = function(prj)
- premake.generate(prj, "%%.xcodeproj/project.pbxproj", premake.xcode.project)
- end,
-
- oncleanproject = function(prj)
- premake.clean.directory(prj, "%%.xcodeproj")
- premake.clean.directory(prj, "%%.xcworkspace")
- end,
-
- oncheckproject = checkproject,
- }
diff --git a/3rdparty/genie/src/actions/xcode/xcode10.lua b/3rdparty/genie/src/actions/xcode/xcode10.lua
new file mode 100644
index 00000000000..f8ae0b42cac
--- /dev/null
+++ b/3rdparty/genie/src/actions/xcode/xcode10.lua
@@ -0,0 +1,116 @@
+--
+-- xcode10.lua
+-- Define the Apple XCode 10.0 action and support functions.
+--
+
+ local premake = premake
+ premake.xcode10 = { }
+
+ local xcode = premake.xcode
+ local xcode8 = premake.xcode8
+ local xcode9 = premake.xcode9
+ local xcode10 = premake.xcode10
+
+ function xcode10.XCBuildConfiguration_Project(tr, prj, cfg)
+ local options = xcode9.XCBuildConfiguration_Project(tr, prj, cfg)
+
+ return table.merge(options, {
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = "YES",
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = "YES",
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = "YES",
+ CLANG_WARN_COMMA = "YES",
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = "YES",
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = "YES",
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = "YES",
+ CLANG_WARN_STRICT_PROTOTYPES = "YES",
+ })
+ end
+
+ function xcode10.XCBuildConfiguration_Target(tr, target, cfg)
+ local options = xcode8.XCBuildConfiguration_Target(tr, target, cfg)
+
+ if not cfg.flags.ObjcARC then
+ options.CLANG_ENABLE_OBJC_WEAK = "YES"
+ end
+
+ return options
+ end
+
+ function xcode10.project(prj)
+ local tr = xcode.buildprjtree(prj)
+ xcode.Header(tr, 48)
+ xcode.PBXBuildFile(tr)
+ xcode.PBXContainerItemProxy(tr)
+ xcode.PBXFileReference(tr,prj)
+ xcode.PBXFrameworksBuildPhase(tr)
+ xcode.PBXGroup(tr)
+ xcode.PBXNativeTarget(tr)
+ xcode.PBXProject(tr, "8.0")
+ xcode.PBXReferenceProxy(tr)
+ xcode.PBXResourcesBuildPhase(tr)
+ xcode.PBXShellScriptBuildPhase(tr)
+ xcode.PBXCopyFilesBuildPhase(tr)
+ xcode.PBXSourcesBuildPhase(tr,prj)
+ xcode.PBXVariantGroup(tr)
+ xcode.PBXTargetDependency(tr)
+ xcode.XCBuildConfiguration(tr, prj, {
+ ontarget = xcode10.XCBuildConfiguration_Target,
+ onproject = xcode10.XCBuildConfiguration_Project,
+ })
+ xcode.XCBuildConfigurationList(tr)
+ xcode.Footer(tr)
+ end
+
+
+--
+-- xcode10 action
+--
+
+ newaction
+ {
+ trigger = "xcode10",
+ shortname = "Xcode 10",
+ description = "Generate Apple Xcode 10 project files (experimental)",
+ os = "macosx",
+
+ valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib", "Bundle" },
+
+ valid_languages = { "C", "C++" },
+
+ valid_tools = {
+ cc = { "gcc" },
+ },
+
+ valid_platforms = {
+ Native = "Native",
+ x32 = "Native 32-bit",
+ x64 = "Native 64-bit",
+ Universal = "Universal",
+ },
+
+ default_platform = "Native",
+
+ onsolution = function(sln)
+ premake.generate(sln, "%%.xcworkspace/contents.xcworkspacedata", xcode.workspace_generate)
+ premake.generate(sln, "%%.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings", xcode.workspace_settings)
+ premake.generate(sln, "%%.xcworkspace/xcshareddata/xcschemes/-ALL-.xcscheme", xcode.workspace_scheme)
+ end,
+
+ onproject = function(prj)
+ premake.generate(prj, "%%.xcodeproj/project.pbxproj", xcode10.project)
+ xcode.generate_schemes(prj, "%%.xcodeproj/xcshareddata/xcschemes")
+ end,
+
+ oncleanproject = function(prj)
+ premake.clean.directory(prj, "%%.xcodeproj")
+ premake.clean.directory(prj, "%%.xcworkspace")
+ end,
+
+ oncheckproject = xcode.checkproject,
+
+ xcode = {
+ iOSTargetPlatformVersion = nil,
+ macOSTargetPlatformVersion = nil,
+ tvOSTargetPlatformVersion = nil,
+ },
+ }
diff --git a/3rdparty/genie/src/actions/xcode/xcode4_workspace.lua b/3rdparty/genie/src/actions/xcode/xcode4_workspace.lua
deleted file mode 100644
index 726a306dc6f..00000000000
--- a/3rdparty/genie/src/actions/xcode/xcode4_workspace.lua
+++ /dev/null
@@ -1,100 +0,0 @@
-premake.xcode4 = {}
-
-local xcode4 = premake.xcode4
-
-function xcode4.workspace_head()
- _p('<?xml version="1.0" encoding="UTF-8"?>')
- _p('<Workspace')
- _p(1,'version = "1.0">')
-
-end
-
-function xcode4.workspace_tail()
- _p('</Workspace>')
-end
-
-function xcode4.workspace_file_ref(prj, indent)
-
- local projpath = path.getrelative(prj.solution.location, prj.location)
- if projpath == '.' then projpath = ''
- else projpath = projpath ..'/'
- end
- _p(indent, '<FileRef')
- _p(indent + 1, 'location = "group:%s">', projpath .. prj.name .. '.xcodeproj')
- _p(indent, '</FileRef>')
-end
-
-function xcode4.workspace_group(grp, indent)
- _p(indent, '<Group')
- _p(indent + 1, 'location = "container:"')
- _p(indent + 1, 'name = "%s">', grp.name)
-
- for _, child in ipairs(grp.groups) do
- xcode4.workspace_group(child, indent + 1)
- end
-
- for _, prj in ipairs(grp.projects) do
- xcode4.workspace_file_ref(prj, indent + 1)
- end
-
- _p(indent, '</Group>')
-end
-
-function xcode4.workspace_generate(sln)
- premake.xcode.preparesolution(sln)
-
- xcode4.workspace_head()
-
- xcode4.reorderProjects(sln)
-
- for grp in premake.solution.eachgroup(sln) do
- if grp.parent == nil then
- xcode4.workspace_group(grp, 1)
- end
- end
-
- for prj in premake.solution.eachproject(sln) do
- if prj.group == nil then
- xcode4.workspace_file_ref(prj, 1)
- end
- end
-
- xcode4.workspace_tail()
-end
-
---
--- If a startup project is specified, move it to the front of the project list.
--- This will make Visual Studio treat it like a startup project.
---
-
-function xcode4.reorderProjects(sln)
- if sln.startproject then
- for i, prj in ipairs(sln.projects) do
- if sln.startproject == prj.name then
- -- Move group tree containing the project to start of group list
- local cur = prj.group
- while cur ~= nil do
- -- Remove group from array
- for j, group in ipairs(sln.groups) do
- if group == cur then
- table.remove(sln.groups, j)
- break
- end
- end
-
- -- Add back at start
- table.insert(sln.groups, 1, cur)
- cur = cur.parent
- end
- -- Move the project itself to start
- table.remove(sln.projects, i)
- table.insert(sln.projects, 1, prj)
- break
- end
- end
- end
-end
-
-
-
-
diff --git a/3rdparty/genie/src/actions/xcode/xcode6_config.lua b/3rdparty/genie/src/actions/xcode/xcode6_config.lua
deleted file mode 100644
index 74be0e16f06..00000000000
--- a/3rdparty/genie/src/actions/xcode/xcode6_config.lua
+++ /dev/null
@@ -1,10 +0,0 @@
-local xcode6 = premake.xcode.xcode6
-
-function xcode6.generate_project_config(prj)
- _p("PRODUCT_NAME = $(TARGET_NAME)")
-
- if premake.isswiftproject(prj) then
- _p("OTHER_SWIFT_FLAGS = -DXcode")
- _p("USE_HEADERMAP = NO")
- end
-end \ No newline at end of file
diff --git a/3rdparty/genie/src/actions/xcode/xcode6_project.lua b/3rdparty/genie/src/actions/xcode/xcode6_project.lua
deleted file mode 100644
index 3ee73127e2a..00000000000
--- a/3rdparty/genie/src/actions/xcode/xcode6_project.lua
+++ /dev/null
@@ -1,247 +0,0 @@
---
--- xcode4_project.lua
--- Generate an Xcode4 C/C++ project.
--- Copyright (c) 2009 Jason Perkins and the Premake project
---
-
-local xcode = premake.xcode
-local xcode6 = xcode.xcode6
-local tree = premake.tree
-
---
--- Create a tree corresponding to what is shown in the Xcode project browser
--- pane, with nodes for files and folders, resources, frameworks, and products.
---
--- @param prj
--- The project being generated.
--- @returns
--- A tree, loaded with metadata, which mirrors Xcode's view of the project.
---
-
-function xcode6.buildprjtree(prj)
- local tr = premake.project.buildsourcetree(prj)
-
- -- create a list of build configurations and assign IDs
- tr.configs = {}
- for _, cfgname in ipairs(prj.solution.configurations) do
- for _, platform in ipairs(prj.solution.xcode.platforms) do
- local cfg = premake.getconfig(prj, cfgname, platform)
- cfg.xcode = {}
- cfg.xcode.targetid = xcode.newid(prj.xcode.projectnode, cfgname)
- cfg.xcode.projectid = xcode.newid(tr, cfgname)
- table.insert(tr.configs, cfg)
- end
- end
-
- -- convert localized resources from their filesystem layout (English.lproj/MainMenu.xib)
- -- to Xcode's display layout (MainMenu.xib/English).
- tree.traverse(tr, {
- onbranch = function(node)
- if path.getextension(node.name) == ".lproj" then
- local lang = path.getbasename(node.name) -- "English", "French", etc.
-
- -- create a new language group for each file it contains
- for _, filenode in ipairs(node.children) do
- local grpnode = node.parent.children[filenode.name]
- if not grpnode then
- grpnode = tree.insert(node.parent, tree.new(filenode.name))
- grpnode.kind = "vgroup"
- end
-
- -- convert the file node to a language node and add to the group
- filenode.name = path.getbasename(lang)
- tree.insert(grpnode, filenode)
- end
-
- -- remove this directory from the tree
- tree.remove(node)
- end
- end
- })
-
- -- fix .xcassets files, they should be treated as a file, not a folder
- tree.traverse(tr, {
- onbranch = function(node)
- if path.getextension(node.name) == ".xcassets" then
- node.children = {}
- end
- end
- })
-
- -- the special folder "Frameworks" lists all linked frameworks
- tr.frameworks = tree.new("Frameworks")
- for cfg in premake.eachconfig(prj) do
- for _, link in ipairs(premake.getlinks(cfg, "system", "fullpath")) do
- local name = path.getname(link)
- if xcode.isframework(name) and not tr.frameworks.children[name] then
- node = tree.insert(tr.frameworks, tree.new(name))
- node.path = link
- end
- end
- end
-
- -- only add it to the tree if there are frameworks to link
- if #tr.frameworks.children > 0 then
- tree.insert(tr, tr.frameworks)
- end
-
- -- the special folder "Products" holds the target produced by the project; this
- -- is populated below
- tr.products = tree.insert(tr, tree.new("Products"))
-
- -- the special folder "Projects" lists sibling project dependencies
- tr.projects = tree.new("Projects")
- for _, dep in ipairs(premake.getdependencies(prj, "sibling", "object")) do
- -- create a child node for the dependency's xcodeproj
- local xcpath = xcode.getxcodeprojname(dep)
- local xcnode = tree.insert(tr.projects, tree.new(path.getname(xcpath)))
- xcnode.path = xcpath
- xcnode.project = dep
- xcnode.productgroupid = xcode.newid(xcnode, "prodgrp")
- xcnode.productproxyid = xcode.newid(xcnode, "prodprox")
- xcnode.targetproxyid = xcode.newid(xcnode, "targprox")
- xcnode.targetdependid = xcode.newid(xcnode, "targdep")
-
- -- create a grandchild node for the dependency's link target
- local cfg = premake.getconfig(dep, prj.configurations[1])
- node = tree.insert(xcnode, tree.new(cfg.linktarget.name))
- node.path = cfg.linktarget.fullpath
- node.cfg = cfg
- end
-
- if #tr.projects.children > 0 then
- tree.insert(tr, tr.projects)
- end
-
- -- Final setup
- tree.traverse(tr, {
- onnode = function(node)
- -- assign IDs to every node in the tree
- node.id = xcode.newid(node)
-
- -- assign build IDs to buildable files
- if xcode.getbuildcategory(node) then
- node.buildid = xcode.newid(node, "build")
- end
-
- -- remember key files that are needed elsewhere
- if string.endswith(node.name, "Info.plist") then
- tr.infoplist = node
- end
- if string.endswith(node.name, ".entitlements") then
- tr.entitlements = node
- end
- end
- }, true)
-
- -- Plug in the product node into the Products folder in the tree. The node
- -- was built in xcode.preparesolution() in xcode_common.lua; it contains IDs
- -- that are necessary for inter-project dependencies
- node = tree.insert(tr.products, prj.xcode.projectnode)
- node.kind = "product"
- node.path = node.cfg.buildtarget.fullpath
- node.cfgsection = xcode.newid(node, "cfg")
- node.resstageid = xcode.newid(node, "rez")
- node.sourcesid = xcode.newid(node, "src")
- node.fxstageid = xcode.newid(node, "fxs")
-
- return tr
-end
-
-
---
--- Generate an Xcode4 .xcodeproj for a Premake project.
---
--- @param prj
--- The Premake project to generate.
---
-
-function xcode6.project(prj)
- local tr = xcode6.buildprjtree(prj)
-
- xcode6.Header(tr)
- xcode6.PBXProject(tr)
-
- xcode.PBXBuildFile(tr)
- xcode.PBXContainerItemProxy(tr)
- xcode.PBXFileReference(tr,prj)
- xcode.PBXFrameworksBuildPhase(tr)
- xcode.PBXGroup(tr)
- xcode.PBXNativeTarget(tr)
- xcode.PBXReferenceProxy(tr)
- xcode.PBXResourcesBuildPhase(tr)
- xcode.PBXShellScriptBuildPhase(tr)
- xcode.PBXSourcesBuildPhase(tr,prj)
- xcode.PBXVariantGroup(tr)
- xcode.PBXTargetDependency(tr)
- xcode.XCBuildConfiguration(tr)
- xcode.XCBuildConfigurationList(tr)
-
- xcode6.PBXConfigsGroup()
- xcode6.Footer(tr)
-end
-
----------------------------------------------------------------------------
--- Section generator functions, in the same order in which they appear
--- in the .pbxproj file
----------------------------------------------------------------------------
-
-function xcode6.Header()
- _p('// !$*UTF8*$!')
- _p('{')
- _p(1,'archiveVersion = 1;')
- _p(1,'classes = {}')
- _p(1,'objectVersion = 46;')
- _p(1,'rootObject = __RootObject_;')
- _p(1,'objects = {')
-end
-
-function xcode6.PBXProject(tr)
- _p(2,'__RootObject_ = {')
- _p(3,'isa = PBXProject;')
- _p(3,'attributes = {LastUpgradeCheck = 9999;};')
- _p(3,'buildConfigurationList = ___RootConfs_;', tr.name)
- _p(3,'compatibilityVersion = "Xcode 3.2";')
- _p(3,'developmentRegion = English;')
- _p(3,'hasScannedForEncodings = 0;')
- _p(3,'knownRegions = (en);')
- _p(3,'mainGroup = ___RootGroup_;')
- _p(3,'projectDirPath = "";')
- _p(3,'projectRoot = "";')
-
- _p(3,'targets = (')
- for _, node in ipairs(tr.products.children) do
- _p(4,'%s /* %s */,', node.targetid, node.name)
- end
- _p(3,');')
-
- if #tr.projects.children > 0 then
- _p(3,'projectReferences = (')
- for _, node in ipairs(tr.projects.children) do
- _p(4,'{')
- _p(5,'ProductGroup = %s /* Products */;', node.productgroupid)
- _p(5,'ProjectRef = %s /* %s */;', node.id, path.getname(node.path))
- _p(4,'},')
- end
- _p(3,');')
- end
-
- _p(2,'};')
- _p('')
-end
-
-function xcode6.PBXConfigsGroup()
- _p(2, "_____Configs_ = {")
- _p(3, "isa = PBXGroup;")
- _p(3, "children = (")
- -- '__PBXFileRef_SGLMath.xcodeproj/Configs/Project.xcconfig'
- _p(3, ");")
- _p(3, "name = Configs;")
- _p(3, "sourceTree = '<group>';")
- _p(2, "};")
-end
-
-function xcode6.Footer()
- _p(1,'};')
- _p('}')
-end
diff --git a/3rdparty/genie/src/actions/xcode/xcode8.lua b/3rdparty/genie/src/actions/xcode/xcode8.lua
new file mode 100644
index 00000000000..5a658c992fd
--- /dev/null
+++ b/3rdparty/genie/src/actions/xcode/xcode8.lua
@@ -0,0 +1,362 @@
+--
+-- _xcode8.lua
+-- Define the Apple XCode 8.0 action and support functions.
+--
+
+ local premake = premake
+ premake.xcode8 = { }
+
+ local xcode = premake.xcode
+ local xcode8 = premake.xcode8
+
+ function xcode8.XCBuildConfiguration_Target(tr, target, cfg)
+ local cfgname = xcode.getconfigname(cfg)
+ local installpaths = {
+ ConsoleApp = "/usr/local/bin",
+ WindowedApp = "$(HOME)/Applications",
+ SharedLib = "/usr/local/lib",
+ StaticLib = "/usr/local/lib",
+ Bundle = "$(LOCAL_LIBRARY_DIR)/Bundles",
+ }
+
+ -- options table to return
+ local options = {
+ ALWAYS_SEARCH_USER_PATHS = "NO",
+ GCC_DYNAMIC_NO_PIC = "NO",
+ GCC_MODEL_TUNING = "G5",
+ INSTALL_PATH = installpaths[cfg.kind],
+ PRODUCT_NAME = cfg.buildtarget.basename,
+ }
+
+ if not cfg.flags.Symbols then
+ options.DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"
+ end
+
+ if cfg.kind ~= "StaticLib" and cfg.buildtarget.prefix ~= "" then
+ options.EXECUTABLE_PREFIX = cfg.buildtarget.prefix
+ end
+
+ if cfg.targetextension then
+ local ext = cfg.targetextension
+ options.EXECUTABLE_EXTENSION = iif(ext:startswith("."), ext:sub(2), ext)
+ end
+
+ if cfg.flags.ObjcARC then
+ options.CLANG_ENABLE_OBJC_ARC = "YES"
+ end
+
+ local outdir = path.getdirectory(cfg.buildtarget.bundlepath)
+ if outdir ~= "." then
+ options.CONFIGURATION_BUILD_DIR = outdir
+ end
+
+ if tr.infoplist then
+ options.INFOPLIST_FILE = tr.infoplist.cfg.name
+ end
+
+ local infoplist_file = nil
+
+ for _, v in ipairs(cfg.files) do
+ -- for any file named *info.plist, use it as the INFOPLIST_FILE
+ if (string.find (string.lower (v), 'info.plist') ~= nil) then
+ infoplist_file = string.format('$(SRCROOT)/%s', v)
+ end
+ end
+
+ if infoplist_file ~= nil then
+ options.INFOPLIST_FILE = infoplist_file
+ end
+
+ local action = premake.action.current()
+ local get_opt = function(opt, def)
+ return (opt and #opt > 0) and opt or def
+ end
+
+ local iosversion = get_opt(cfg.iostargetplatformversion, action.xcode.iOSTargetPlatformVersion)
+ local macosversion = get_opt(cfg.macostargetplatformversion, action.xcode.macOSTargetPlatformVersion)
+ local tvosversion = get_opt(cfg.tvostargetplatformversion, action.xcode.tvOSTargetPlatformVersion)
+
+ if iosversion then
+ options.IPHONEOS_DEPLOYMENT_TARGET = iosversion
+ elseif macosversion then
+ options.MACOSX_DEPLOYMENT_TARGET = macosversion
+ elseif tvosversion then
+ options.TVOS_DEPLOYMENT_TARGET = tvosversion
+ end
+
+ if cfg.kind == "Bundle" and not cfg.options.SkipBundling then
+ options.PRODUCT_BUNDLE_IDENTIFIER = "genie." .. cfg.buildtarget.basename:gsub("%s+", ".") --replace spaces with .
+ local ext = cfg.targetextension
+ if ext then
+ options.WRAPPER_EXTENSION = iif(ext:startswith("."), ext:sub(2), ext)
+ else
+ options.WRAPPER_EXTENSION = "bundle"
+ end
+ end
+
+ return options
+ end
+
+ function xcode8.XCBuildConfiguration_Project(tr, prj, cfg)
+ local cfgname = xcode.getconfigname(cfg)
+ local archs = {
+ Native = nil,
+ x32 = "i386",
+ x64 = "x86_64",
+ Universal32 = "$(ARCHS_STANDARD_32_BIT)",
+ Universal64 = "$(ARCHS_STANDARD_64_BIT)",
+ Universal = "$(ARCHS_STANDARD_32_64_BIT)",
+ }
+
+ -- build list of "other" C/C++ flags
+ local checks = {
+ ["-ffast-math"] = cfg.flags.FloatFast,
+ ["-ffloat-store"] = cfg.flags.FloatStrict,
+ ["-fomit-frame-pointer"] = cfg.flags.NoFramePointer,
+ }
+
+ local cflags = { }
+ for flag, check in pairs(checks) do
+ if check then
+ table.insert(cflags, flag)
+ end
+ end
+
+ -- build list of "other" linked flags. All libraries that aren't frameworks
+ -- are listed here, so I don't have to try and figure out if they are ".a"
+ -- or ".dylib", which Xcode requires to list in the Frameworks section
+ local ldflags = { }
+ for _, lib in ipairs(premake.getlinks(cfg, "system")) do
+ if not xcode.isframework(lib) then
+ table.insert(ldflags, "-l" .. lib)
+ end
+ end
+
+ -- options table to return
+ local options = {
+ ARCHS = archs[cfg.platform],
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = "YES",
+ CLANG_WARN_BOOL_CONVERSION = "YES",
+ CLANG_WARN_CONSTANT_CONVERSION = "YES",
+ CLANG_WARN_EMPTY_BODY = "YES",
+ CLANG_WARN_ENUM_CONVERSION = "YES",
+ CLANG_WARN_INFINITE_RECURSION = "YES",
+ CLANG_WARN_INT_CONVERSION = "YES",
+ CLANG_WARN_SUSPICIOUS_MOVE = "YES",
+ CLANG_WARN_UNREACHABLE_CODE = "YES",
+ CONFIGURATION_TEMP_DIR = "$(OBJROOT)",
+ ENABLE_STRICT_OBJC_MSGSEND = "YES",
+ ENABLE_TESTABILITY = "YES",
+ GCC_C_LANGUAGE_STANDARD = "gnu99",
+ GCC_NO_COMMON_BLOCKS = "YES",
+ GCC_PREPROCESSOR_DEFINITIONS = cfg.defines,
+ GCC_SYMBOLS_PRIVATE_EXTERN = "NO",
+ GCC_WARN_64_TO_32_BIT_CONVERSION = "YES",
+ GCC_WARN_ABOUT_RETURN_TYPE = "YES",
+ GCC_WARN_UNDECLARED_SELECTOR = "YES",
+ GCC_WARN_UNINITIALIZED_AUTOS = "YES",
+ GCC_WARN_UNUSED_FUNCTION = "YES",
+ GCC_WARN_UNUSED_VARIABLE = "YES",
+ HEADER_SEARCH_PATHS = table.join(cfg.includedirs, cfg.systemincludedirs),
+ LIBRARY_SEARCH_PATHS = cfg.libdirs,
+ OBJROOT = cfg.objectsdir,
+ ONLY_ACTIVE_ARCH = "YES",
+ OTHER_CFLAGS = table.join(cflags, cfg.buildoptions, cfg.buildoptions_c),
+ OTHER_CPLUSPLUSFLAGS = table.join(cflags, cfg.buildoptions, cfg.buildoptions_cpp),
+ OTHER_LDFLAGS = table.join(ldflags, cfg.linkoptions),
+ SDKROOT = xcode.toolset,
+ USER_HEADER_SEARCH_PATHS = cfg.userincludedirs,
+ }
+
+ if tr.entitlements then
+ options.CODE_SIGN_ENTITLEMENTS = tr.entitlements.cfg.name
+ end
+
+ local targetdir = path.getdirectory(cfg.buildtarget.bundlepath)
+ if targetdir ~= "." then
+ options.CONFIGURATION_BUILD_DIR = "$(SYMROOT)"
+ options.SYMROOT = targetdir
+ end
+
+ if cfg.flags.Symbols then
+ options.COPY_PHASE_STRIP = "NO"
+ end
+
+ local excluded = xcode.cfg_excluded_files(prj, cfg)
+ if #excluded > 0 then
+ options.EXCLUDED_SOURCE_FILE_NAMES = excluded
+ end
+
+ if cfg.flags.NoExceptions then
+ options.GCC_ENABLE_CPP_EXCEPTIONS = "NO"
+ end
+
+ if cfg.flags.NoRTTI then
+ options.GCC_ENABLE_CPP_RTTI = "NO"
+ end
+
+ if cfg.flags.Symbols and not cfg.flags.NoEditAndContinue then
+ options.GCC_ENABLE_FIX_AND_CONTINUE = "YES"
+ end
+
+ if cfg.flags.NoExceptions then
+ options.GCC_ENABLE_OBJC_EXCEPTIONS = "NO"
+ end
+
+ if cfg.flags.Optimize or cfg.flags.OptimizeSize then
+ options.GCC_OPTIMIZATION_LEVEL = "s"
+ elseif cfg.flags.OptimizeSpeed then
+ options.GCC_OPTIMIZATION_LEVEL = 3
+ else
+ options.GCC_OPTIMIZATION_LEVEL = 0
+ end
+
+ if cfg.pchheader and not cfg.flags.NoPCH then
+ options.GCC_PRECOMPILE_PREFIX_HEADER = "YES"
+
+ -- Visual Studio requires the PCH header to be specified in the same way
+ -- it appears in the #include statements used in the source code; the PCH
+ -- source actual handles the compilation of the header. GCC compiles the
+ -- header file directly, and needs the file's actual file system path in
+ -- order to locate it.
+
+ -- To maximize the compatibility between the two approaches, see if I can
+ -- locate the specified PCH header on one of the include file search paths
+ -- and, if so, adjust the path automatically so the user doesn't have
+ -- add a conditional configuration to the project script.
+
+ local pch = cfg.pchheader
+ for _, incdir in ipairs(cfg.includedirs) do
+
+ -- convert this back to an absolute path for os.isfile()
+ local abspath = path.getabsolute(path.join(cfg.project.location, incdir))
+
+ local testname = path.join(abspath, pch)
+ if os.isfile(testname) then
+ pch = path.getrelative(cfg.location, testname)
+ break
+ end
+ end
+
+ options.GCC_PREFIX_HEADER = pch
+ end
+
+ if cfg.flags.FatalWarnings then
+ options.GCC_TREAT_WARNINGS_AS_ERRORS = "YES"
+ end
+
+ if cfg.kind == "Bundle" then
+ options.MACH_O_TYPE = "mh_bundle"
+ end
+
+ if cfg.flags.StaticRuntime then
+ options.STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = "static"
+ end
+
+ if cfg.flags.PedanticWarnings or cfg.flags.ExtraWarnings then
+ options.WARNING_CFLAGS = "-Wall"
+ end
+
+ if cfg.flags.Cpp11 then
+ options.CLANG_CXX_LANGUAGE_STANDARD = "c++11"
+ elseif cfg.flags.Cpp14 or cfg.flags.CppLatest then
+ options.CLANG_CXX_LANGUAGE_STANDARD = "c++14"
+ elseif cfg.flags.Cpp17 then
+ -- XCode8 does not support C++17, but other actions use this as
+ -- base that *do* support C++17, so check if this is the current
+ -- action before erroring.
+ if premake.action.current() == premake.action.get("xcode8") then
+ error("XCode8 does not support C++17.")
+ end
+ end
+
+ for _, val in ipairs(premake.xcode.parameters) do
+ local eqpos = string.find(val, "=")
+ if eqpos ~= nil then
+ local key = string.trim(string.sub(val, 1, eqpos - 1))
+ local value = string.trim(string.sub(val, eqpos + 1))
+ options[key] = value
+ end
+ end
+
+ return options
+ end
+
+ function xcode8.project(prj)
+ local tr = xcode.buildprjtree(prj)
+ xcode.Header(tr, 48)
+ xcode.PBXBuildFile(tr)
+ xcode.PBXContainerItemProxy(tr)
+ xcode.PBXFileReference(tr,prj)
+ xcode.PBXFrameworksBuildPhase(tr)
+ xcode.PBXGroup(tr)
+ xcode.PBXNativeTarget(tr)
+ xcode.PBXProject(tr, "8.0")
+ xcode.PBXReferenceProxy(tr)
+ xcode.PBXResourcesBuildPhase(tr)
+ xcode.PBXShellScriptBuildPhase(tr)
+ xcode.PBXCopyFilesBuildPhase(tr)
+ xcode.PBXSourcesBuildPhase(tr,prj)
+ xcode.PBXVariantGroup(tr)
+ xcode.PBXTargetDependency(tr)
+ xcode.XCBuildConfiguration(tr, prj, {
+ ontarget = xcode8.XCBuildConfiguration_Target,
+ onproject = xcode8.XCBuildConfiguration_Project,
+ })
+ xcode.XCBuildConfigurationList(tr)
+ xcode.Footer(tr)
+ end
+
+
+--
+-- xcode8 action
+--
+
+ newaction
+ {
+ trigger = "xcode8",
+ shortname = "Xcode 8",
+ description = "Generate Apple Xcode 8 project files",
+ os = "macosx",
+
+ valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib", "Bundle" },
+
+ valid_languages = { "C", "C++" },
+
+ valid_tools = {
+ cc = { "gcc" },
+ },
+
+ valid_platforms = {
+ Native = "Native",
+ x32 = "Native 32-bit",
+ x64 = "Native 64-bit",
+ Universal = "Universal",
+ },
+
+ default_platform = "Native",
+
+ onsolution = function(sln)
+ premake.generate(sln, "%%.xcworkspace/contents.xcworkspacedata", xcode.workspace_generate)
+ premake.generate(sln, "%%.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings", xcode.workspace_settings)
+ premake.generate(sln, "%%.xcworkspace/xcshareddata/xcschemes/-ALL-.xcscheme", xcode.workspace_scheme)
+ end,
+
+ onproject = function(prj)
+ premake.generate(prj, "%%.xcodeproj/project.pbxproj", xcode8.project)
+ xcode.generate_schemes(prj, "%%.xcodeproj/xcshareddata/xcschemes")
+ end,
+
+ oncleanproject = function(prj)
+ premake.clean.directory(prj, "%%.xcodeproj")
+ premake.clean.directory(prj, "%%.xcworkspace")
+ end,
+
+ oncheckproject = xcode.checkproject,
+
+ xcode = {
+ iOSTargetPlatformVersion = nil,
+ macOSTargetPlatformVersion = nil,
+ tvOSTargetPlatformVersion = nil,
+ },
+ }
diff --git a/3rdparty/genie/src/actions/xcode/xcode9.lua b/3rdparty/genie/src/actions/xcode/xcode9.lua
new file mode 100644
index 00000000000..aa70275bdda
--- /dev/null
+++ b/3rdparty/genie/src/actions/xcode/xcode9.lua
@@ -0,0 +1,107 @@
+--
+-- xcode9.lua
+-- Define the Apple XCode 9.0 action and support functions.
+--
+
+ local premake = premake
+ premake.xcode9 = { }
+
+ local xcode = premake.xcode
+ local xcode8 = premake.xcode8
+ local xcode9 = premake.xcode9
+
+ function xcode9.XCBuildConfiguration_Project(tr, prj, cfg)
+ local options = xcode8.XCBuildConfiguration_Project(tr, prj, cfg)
+
+ if cfg.flags.Cpp17 or cfg.flags.CppLatest then
+ options.CLANG_CXX_LANGUAGE_STANDARD = "c++17"
+ end
+
+ return table.merge(options, {
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = "YES",
+ CLANG_WARN_COMMA = "YES",
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = "YES",
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = "YES",
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = "YES",
+ CLANG_WARN_STRICT_PROTOTYPES = "YES",
+ })
+ end
+
+ function xcode9.project(prj)
+ local tr = xcode.buildprjtree(prj)
+ xcode.Header(tr, 48)
+ xcode.PBXBuildFile(tr)
+ xcode.PBXContainerItemProxy(tr)
+ xcode.PBXFileReference(tr,prj)
+ xcode.PBXFrameworksBuildPhase(tr)
+ xcode.PBXGroup(tr)
+ xcode.PBXNativeTarget(tr)
+ xcode.PBXProject(tr, "8.0")
+ xcode.PBXReferenceProxy(tr)
+ xcode.PBXResourcesBuildPhase(tr)
+ xcode.PBXShellScriptBuildPhase(tr)
+ xcode.PBXCopyFilesBuildPhase(tr)
+ xcode.PBXSourcesBuildPhase(tr,prj)
+ xcode.PBXVariantGroup(tr)
+ xcode.PBXTargetDependency(tr)
+ xcode.XCBuildConfiguration(tr, prj, {
+ ontarget = xcode8.XCBuildConfiguration_Target,
+ onproject = xcode9.XCBuildConfiguration_Project,
+ })
+ xcode.XCBuildConfigurationList(tr)
+ xcode.Footer(tr)
+ end
+
+
+--
+-- xcode9 action
+--
+
+ newaction
+ {
+ trigger = "xcode9",
+ shortname = "Xcode 9",
+ description = "Generate Apple Xcode 9 project files",
+ os = "macosx",
+
+ valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib", "Bundle" },
+
+ valid_languages = { "C", "C++" },
+
+ valid_tools = {
+ cc = { "gcc" },
+ },
+
+ valid_platforms = {
+ Native = "Native",
+ x32 = "Native 32-bit",
+ x64 = "Native 64-bit",
+ Universal = "Universal",
+ },
+
+ default_platform = "Native",
+
+ onsolution = function(sln)
+ premake.generate(sln, "%%.xcworkspace/contents.xcworkspacedata", xcode.workspace_generate)
+ premake.generate(sln, "%%.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings", xcode.workspace_settings)
+ premake.generate(sln, "%%.xcworkspace/xcshareddata/xcschemes/-ALL-.xcscheme", xcode.workspace_scheme)
+ end,
+
+ onproject = function(prj)
+ premake.generate(prj, "%%.xcodeproj/project.pbxproj", xcode9.project)
+ xcode.generate_schemes(prj, "%%.xcodeproj/xcshareddata/xcschemes")
+ end,
+
+ oncleanproject = function(prj)
+ premake.clean.directory(prj, "%%.xcodeproj")
+ premake.clean.directory(prj, "%%.xcworkspace")
+ end,
+
+ oncheckproject = xcode.checkproject,
+
+ xcode = {
+ iOSTargetPlatformVersion = nil,
+ macOSTargetPlatformVersion = nil,
+ tvOSTargetPlatformVersion = nil,
+ },
+ }
diff --git a/3rdparty/genie/src/actions/xcode/xcode_common.lua b/3rdparty/genie/src/actions/xcode/xcode_common.lua
index b3f925273b8..762c27aada1 100644
--- a/3rdparty/genie/src/actions/xcode/xcode_common.lua
+++ b/3rdparty/genie/src/actions/xcode/xcode_common.lua
@@ -18,10 +18,16 @@
function xcode.getbuildcategory(node)
local categories = {
[".a"] = "Frameworks",
+ [".h"] = "Headers",
+ [".hh"] = "Headers",
+ [".hpp"] = "Headers",
+ [".hxx"] = "Headers",
+ [".inl"] = "Headers",
[".c"] = "Sources",
[".cc"] = "Sources",
[".cpp"] = "Sources",
[".cxx"] = "Sources",
+ [".c++"] = "Sources",
[".dylib"] = "Frameworks",
[".bundle"] = "Frameworks",
[".framework"] = "Frameworks",
@@ -39,7 +45,8 @@
[".xcdatamodeld"] = "Sources",
[".swift"] = "Sources",
}
- return categories[path.getextension(node.name)]
+ return categories[path.getextension(node.name)] or
+ categories[string.lower(path.getextension(node.name))]
end
@@ -78,12 +85,17 @@
[".cpp"] = "sourcecode.cpp.cpp",
[".css"] = "text.css",
[".cxx"] = "sourcecode.cpp.cpp",
+ [".c++"] = "sourcecode.cpp.cpp",
[".entitlements"] = "text.xml",
[".bundle"] = "wrapper.cfbundle",
[".framework"] = "wrapper.framework",
[".tbd"] = "sourcecode.text-based-dylib-definition",
[".gif"] = "image.gif",
[".h"] = "sourcecode.c.h",
+ [".hh"] = "sourcecode.cpp.h",
+ [".hpp"] = "sourcecode.cpp.h",
+ [".hxx"] = "sourcecode.cpp.h",
+ [".inl"] = "sourcecode.cpp.h",
[".html"] = "text.html",
[".lua"] = "sourcecode.lua",
[".m"] = "sourcecode.c.objc",
@@ -101,7 +113,8 @@
[".xcdatamodeld"] = "wrapper.xcdatamodeld",
[".swift"] = "sourcecode.swift",
}
- return types[path.getextension(node.path)] or "text"
+ return types[path.getextension(node.path)] or
+ (types[string.lower(path.getextension(node.path))] or "text")
end
--
@@ -120,12 +133,17 @@
[".cpp"] = "sourcecode.cpp.cpp",
[".css"] = "text.css",
[".cxx"] = "sourcecode.cpp.cpp",
+ [".c++"] = "sourcecode.cpp.cpp",
[".entitlements"] = "text.xml",
[".bundle"] = "wrapper.cfbundle",
[".framework"] = "wrapper.framework",
[".tbd"] = "wrapper.framework",
[".gif"] = "image.gif",
[".h"] = "sourcecode.cpp.h",
+ [".hh"] = "sourcecode.cpp.h",
+ [".hpp"] = "sourcecode.cpp.h",
+ [".hxx"] = "sourcecode.cpp.h",
+ [".inl"] = "sourcecode.cpp.h",
[".html"] = "text.html",
[".lua"] = "sourcecode.lua",
[".m"] = "sourcecode.cpp.objcpp",
@@ -142,7 +160,8 @@
[".xcdatamodeld"] = "wrapper.xcdatamodeld",
[".swift"] = "sourcecode.swift",
}
- return types[path.getextension(node.path)] or "text"
+ return types[path.getextension(node.path)] or
+ (types[string.lower(path.getextension(node.path))] or "text")
end
--
-- Return the Xcode product type, based target kind.
@@ -156,10 +175,10 @@
function xcode.getproducttype(node)
local types = {
ConsoleApp = "com.apple.product-type.tool",
- WindowedApp = "com.apple.product-type.application",
+ WindowedApp = node.cfg.options.SkipBundling and "com.apple.product-type.tool" or "com.apple.product-type.application",
StaticLib = "com.apple.product-type.library.static",
SharedLib = "com.apple.product-type.library.dynamic",
- Bundle = "com.apple.product-type.bundle",
+ Bundle = node.cfg.options.SkipBundling and "com.apple.product-type.tool" or "com.apple.product-type.bundle",
}
return types[node.cfg.kind]
end
@@ -177,10 +196,10 @@
function xcode.gettargettype(node)
local types = {
ConsoleApp = "\"compiled.mach-o.executable\"",
- WindowedApp = "wrapper.application",
+ WindowedApp = node.cfg.options.SkipBundling and "\"compiled.mach-o.executable\"" or "wrapper.application",
StaticLib = "archive.ar",
SharedLib = "\"compiled.mach-o.dylib\"",
- Bundle = "wrapper.cfbundle",
+ Bundle = node.cfg.options.SkipBundling and "\"compiled.mach-o.bundle\"" or "wrapper.cfbundle",
}
return types[node.cfg.kind]
end
@@ -216,6 +235,16 @@
return (path.getextension(fname) == ".framework" or path.getextension(fname) == ".tbd")
end
+--
+-- Generates a unique 12 byte ID.
+-- Parameter is optional
+--
+-- @returns
+-- A 24-character string representing the 12 byte ID.
+--
+ function xcode.uuid(param)
+ return os.uuid(param):upper():gsub('-',''):sub(0,24)
+ end
--
-- Retrieves a unique 12 byte ID for an object. This function accepts and ignores two
@@ -226,14 +255,77 @@
-- A 24-character string representing the 12 byte ID.
--
- function xcode.newid()
- return string.format("%04X%04X%04X%04X%04X%04X",
- math.random(0, 32767),
- math.random(0, 32767),
- math.random(0, 32767),
- math.random(0, 32767),
- math.random(0, 32767),
- math.random(0, 32767))
+ function xcode.newid(node, usage)
+ local base = ''
+
+ -- Seed the uuid with the project name and a project-specific counter.
+ -- This is to prevent matching strings from generating the same uuid,
+ -- while still generating the same uuid for the same properties across
+ -- runs.
+ local prj = node.project
+
+ if prj == nil then
+ local parent = node.parent
+ while parent ~= nil do
+ if parent.project ~= nil then
+ prj = parent.project
+ break
+ end
+ parent = parent.parent
+ end
+ end
+
+ if prj ~= nil then
+ prj.uuidcounter = (prj.uuidcounter or 0) + 1
+ base = base .. prj.name .. "$" .. prj.uuidcounter .. "$"
+ end
+
+ base = base .. "$" .. (node.path or node.name or "")
+ base = base .. "$" .. (usage or "")
+ return xcode.uuid(base)
+ end
+
+--
+-- Creates a label for a given scriptphase
+-- based on command and config
+-- such as the result looks like this:
+-- 'Script Phase <number> [cmd] (Config)', e.g. 'Script Phase 1 [rsync] (Debug)'
+--
+-- This function is used for generating `PBXShellScriptBuildPhase` from `xcodescriptphases`.
+-- (Thus required in more than 1 place).
+--
+-- @param cmd
+-- The command itself
+-- @param count
+-- counter to avoid having duplicate label names
+-- @param cfg
+-- The configuration the command is generated for
+--
+
+ function xcode.getscriptphaselabel(cmd, count, cfg)
+ return string.format("\"Script Phase %s [%s] (%s)\"", count, cmd:match("(%w+)(.+)"), iif(cfg, xcode.getconfigname(cfg), "all"))
+ end
+
+
+--
+-- Creates a label for a given copy phase
+-- based on target
+-- such as the result looks like this:
+-- 'Copy <type> <number> [target]', e.g. 'Copy Files 1 [assets]'
+--
+-- This function is used for generating `PBXCopyFilesPhase` from `xcodecopyresources`.
+-- (Thus required in more than 1 place).
+--
+-- @param type
+-- The copy type ('Resources' for now)
+-- @param count
+-- counter to avoid having duplicate label names
+-- @param target
+-- The target subfolder
+--
+
+ function xcode.getcopyphaselabel(type, count, target)
+ return string.format("\"Copy %s %s [%s]\"", type, count, target)
end
@@ -276,11 +368,14 @@
-- The Xcode specific list tag.
--
- function xcode.printlist(list, tag)
+ function xcode.printlist(list, tag, sort)
if #list > 0 then
+ if sort ~= nil and sort == true then
+ table.sort(list)
+ end
_p(4,'%s = (', tag)
for _, item in ipairs(list) do
- local escaped_item = item:gsub("\"", "\\\"")
+ local escaped_item = item:gsub("\"", "\\\\\\\""):gsub("'", "\\\\'")
_p(5, '"%s",', escaped_item)
end
_p(4,');')
@@ -288,24 +383,66 @@
end
+--
+-- Escape a string for use in an Xcode project file.
+--
+
+ function xcode.quotestr(str)
+ -- simple strings don't need quotes
+ if str:match("[^a-zA-Z0-9$._/]") == nil then
+ return str
+ end
+
+ return "\"" .. str:gsub("[\"\\\"]", "\\%0") .. "\""
+ end
+
+
+
---------------------------------------------------------------------------
-- Section generator functions, in the same order in which they appear
-- in the .pbxproj file
---------------------------------------------------------------------------
- function xcode.Header()
- _p('// !$*UTF8*$!')
- _p('{')
- _p(1,'archiveVersion = 1;')
- _p(1,'classes = {')
- _p(1,'};')
- _p(1,'objectVersion = 45;')
- _p(1,'objects = {')
- _p('')
- end
+function xcode.Header(tr, objversion)
+ _p('// !$*UTF8*$!')
+ _p('{')
+ _p(1,'archiveVersion = 1;')
+ _p(1,'classes = {')
+ _p(1,'};')
+ _p(1,'objectVersion = %d;', objversion)
+ _p(1,'objects = {')
+ _p('')
+end
function xcode.PBXBuildFile(tr)
+ local function gatherCopyFiles(which)
+ local copyfiles = {}
+ local targets = tr.project[which]
+ if #targets > 0 then
+ for _, t in ipairs(targets) do
+ for __, tt in ipairs(t) do
+ table.insertflat(copyfiles, tt[2])
+ end
+ end
+ end
+ return table.translate(copyfiles, path.getname)
+ end
+
+ local function gatherCopyFrameworks(which)
+ local copyfiles = {}
+ local targets = tr.project[which]
+ if #targets > 0 then
+ table.insertflat(copyfiles, targets)
+ end
+ return table.translate(copyfiles, path.getname)
+ end
+
+ local copyfiles = table.flatten({
+ gatherCopyFiles('xcodecopyresources'),
+ gatherCopyFrameworks('xcodecopyframeworks')
+ })
+
_p('/* Begin PBXBuildFile section */')
tree.traverse(tr, {
onnode = function(node)
@@ -313,6 +450,15 @@
_p(2,'%s /* %s in %s */ = {isa = PBXBuildFile; fileRef = %s /* %s */; };',
node.buildid, node.name, xcode.getbuildcategory(node), node.id, node.name)
end
+
+ -- adds duplicate PBXBuildFile file entry as 'CopyFiles' for files marked to be copied
+ -- for frameworks: add signOnCopy flag
+ if table.icontains(copyfiles, node.name) then
+ _p(2,'%s /* %s in %s */ = {isa = PBXBuildFile; fileRef = %s /* %s */; %s };',
+ xcode.uuid(node.name .. 'in CopyFiles'), node.name, 'CopyFiles', node.id, node.name,
+ iif(xcode.isframework(node.name), "settings = {ATTRIBUTES = (CodeSignOnCopy, ); };", "")
+ )
+ end
end
})
_p('/* End PBXBuildFile section */')
@@ -381,7 +527,8 @@
end
if string.find(nodePath,'/') then
if string.find(nodePath,'^%.')then
- error('relative paths are not currently supported for frameworks')
+ --error('relative paths are not currently supported for frameworks')
+ nodePath = path.getabsolute(path.join(tr.project.location, nodePath))
end
pth = nodePath
elseif path.getextension(nodePath)=='.tbd' then
@@ -404,9 +551,13 @@
-- something else; probably a source code file
src = "<group>"
- -- if the parent node is virtual, it won't have a local path
- -- of its own; need to use full relative path from project
- if node.parent.isvpath then
+ if node.location then
+ pth = node.location
+ elseif node.parent.isvpath then
+ -- if the parent node is virtual, it won't have a local path
+ -- of its own; need to use full relative path from project
+ -- (in fact, often almost all paths are virtual because vpath
+ -- trims the leading dots from the full path)
pth = node.cfg.name
else
pth = tree.getlocalpath(node)
@@ -486,7 +637,10 @@
_p(3,'name = Products;')
else
_p(3,'name = "%s";', node.name)
- if node.path and not node.isvpath then
+
+ if node.location then
+ _p(3,'path = "%s";', node.location)
+ elseif node.path and not node.isvpath then
local p = node.path
if node.parent.path then
p = path.getrelative(node.parent.path, node.path)
@@ -527,22 +681,85 @@
end
end
+ local function dobuildblock(id, label, which, action)
+ if hasBuildCommands(which) then
+ local commandcount = 0
+ for _, cfg in ipairs(tr.configs) do
+ commandcount = commandcount + #cfg[which]
+ end
+ if commandcount > 0 then
+ action(id, label)
+ end
+ end
+ end
+
+ local function doscriptphases(which, action)
+ local i = 0
+ for _, cfg in ipairs(tr.configs) do
+ local cfgcmds = cfg[which]
+ if cfgcmds ~= nil then
+ for __, scripts in ipairs(cfgcmds) do
+ for ___, script in ipairs(scripts) do
+ local cmd = script[1]
+ local label = xcode.getscriptphaselabel(cmd, i, cfg)
+ local id = xcode.uuid(label)
+ action(id, label)
+ i = i + 1
+ end
+ end
+ end
+ end
+ end
+
+ local function docopyresources(which, action)
+ if hasBuildCommands(which) then
+ local targets = tr.project[which]
+ if #targets > 0 then
+ local i = 0
+ for _, t in ipairs(targets) do
+ for __, tt in ipairs(t) do
+ local label = xcode.getcopyphaselabel('Resources', i, tt[1])
+ local id = xcode.uuid(label)
+ action(id, label)
+ i = i + 1
+ end
+ end
+ end
+ end
+ end
+
+ local function docopyframeworks(which, action)
+ if hasBuildCommands(which) then
+ local targets = tr.project[which]
+ if #targets > 0 then
+ local label = "Copy Frameworks"
+ local id = xcode.uuid(label)
+ action(id, label)
+ end
+ end
+ end
+
+ local function _p_label(id, label)
+ _p(4, '%s /* %s */,', id, label)
+ end
+
+
_p(2,'%s /* %s */ = {', node.targetid, name)
_p(3,'isa = PBXNativeTarget;')
_p(3,'buildConfigurationList = %s /* Build configuration list for PBXNativeTarget "%s" */;', node.cfgsection, name)
_p(3,'buildPhases = (')
- if hasBuildCommands('prebuildcommands') then
- _p(4,'9607AE1010C857E500CD1376 /* Prebuild */,')
- end
+ dobuildblock('9607AE1010C857E500CD1376', 'Prebuild', 'prebuildcommands', _p_label)
_p(4,'%s /* Resources */,', node.resstageid)
_p(4,'%s /* Sources */,', node.sourcesid)
- if hasBuildCommands('prelinkcommands') then
- _p(4,'9607AE3510C85E7E00CD1376 /* Prelink */,')
- end
+ dobuildblock('9607AE3510C85E7E00CD1376', 'Prelink', 'prelinkcommands', _p_label)
_p(4,'%s /* Frameworks */,', node.fxstageid)
- if hasBuildCommands('postbuildcommands') then
- _p(4,'9607AE3710C85E8F00CD1376 /* Postbuild */,')
+ dobuildblock('9607AE3710C85E8F00CD1376', 'Postbuild', 'postbuildcommands', _p_label)
+ doscriptphases("xcodescriptphases", _p_label)
+ docopyresources("xcodecopyresources", _p_label)
+ if tr.project.kind == "WindowedApp" then
+ docopyframeworks("xcodecopyframeworks", _p_label)
end
+
_p(3,');')
_p(3,'buildRules = (')
_p(3,');')
@@ -575,12 +792,12 @@
end
- function xcode.PBXProject(tr)
+ function xcode.PBXProject(tr, compatVersion)
_p('/* Begin PBXProject section */')
_p(2,'__RootObject_ /* Project object */ = {')
_p(3,'isa = PBXProject;')
_p(3,'buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "%s" */;', tr.name)
- _p(3,'compatibilityVersion = "Xcode 3.2";')
+ _p(3,'compatibilityVersion = "Xcode %s";', compatVersion)
_p(3,'hasScannedForEncodings = 1;')
_p(3,'mainGroup = %s /* %s */;', tr.id, tr.name)
_p(3,'projectDirPath = "";')
@@ -653,47 +870,91 @@
function xcode.PBXShellScriptBuildPhase(tr)
local wrapperWritten = false
- local function doblock(id, name, which)
+ local function doblock(id, name, commands, files)
+ if commands ~= nil then
+ commands = table.flatten(commands)
+ end
+ if #commands > 0 then
+ if not wrapperWritten then
+ _p('/* Begin PBXShellScriptBuildPhase section */')
+ wrapperWritten = true
+ end
+ _p(2,'%s /* %s */ = {', id, name)
+ _p(3,'isa = PBXShellScriptBuildPhase;')
+ _p(3,'buildActionMask = 2147483647;')
+ _p(3,'files = (')
+ _p(3,');')
+ _p(3,'inputPaths = (');
+ if files ~= nil then
+ files = table.flatten(files)
+ if #files > 0 then
+ for _, file in ipairs(files) do
+ _p(4, '"%s",', file)
+ end
+ end
+ end
+ _p(3,');');
+ _p(3,'name = %s;', name);
+ _p(3,'outputPaths = (');
+ _p(3,');');
+ _p(3,'runOnlyForDeploymentPostprocessing = 0;');
+ _p(3,'shellPath = /bin/sh;');
+ _p(3,'shellScript = "%s";', table.concat(commands, "\\n"):gsub('"', '\\"'))
+ _p(2,'};')
+ end
+ end
+
+ local function wrapcommands(cmds, cfg)
+ local commands = {}
+ if #cmds > 0 then
+ table.insert(commands, 'if [ "${CONFIGURATION}" = "' .. xcode.getconfigname(cfg) .. '" ]; then')
+ for i = 1, #cmds do
+ local cmd = cmds[i]
+ cmd = cmd:gsub('\\','\\\\')
+ table.insert(commands, cmd)
+ end
+ table.insert(commands, 'fi')
+ end
+ return commands
+ end
+
+ local function dobuildblock(id, name, which)
-- see if there are any commands to add for each config
local commands = {}
for _, cfg in ipairs(tr.configs) do
- local cfgcmds = cfg[which]
+ local cfgcmds = wrapcommands(cfg[which], cfg)
if #cfgcmds > 0 then
- table.insert(commands, 'if [ "${CONFIGURATION}" = "' .. xcode.getconfigname(cfg) .. '" ]; then')
- for i = 1, #cfgcmds do
- local cmd = cfgcmds[i]
- cmd = cmd:gsub('\\','\\\\')
+ for i, cmd in ipairs(cfgcmds) do
table.insert(commands, cmd)
end
- table.insert(commands, 'fi')
end
end
+ doblock(id, name, commands)
+ end
- if #commands > 0 then
- if not wrapperWritten then
- _p('/* Begin PBXShellScriptBuildPhase section */')
- wrapperWritten = true
+ local function doscriptphases(which)
+ local i = 0
+ for _, cfg in ipairs(tr.configs) do
+ local cfgcmds = cfg[which]
+ if cfgcmds ~= nil then
+ for __, scripts in ipairs(cfgcmds) do
+ for ___, script in ipairs(scripts) do
+ local cmd = script[1]
+ local files = script[2]
+ local label = xcode.getscriptphaselabel(cmd, i, cfg)
+ local id = xcode.uuid(label)
+ doblock(id, label, wrapcommands({cmd}, cfg), files)
+ i = i + 1
+ end
+ end
end
- _p(2,'%s /* %s */ = {', id, name)
- _p(3,'isa = PBXShellScriptBuildPhase;')
- _p(3,'buildActionMask = 2147483647;')
- _p(3,'files = (')
- _p(3,');')
- _p(3,'inputPaths = (');
- _p(3,');');
- _p(3,'name = %s;', name);
- _p(3,'outputPaths = (');
- _p(3,');');
- _p(3,'runOnlyForDeploymentPostprocessing = 0;');
- _p(3,'shellPath = /bin/sh;');
- _p(3,'shellScript = "%s";', table.concat(commands, "\\n"):gsub('"', '\\"'))
- _p(2,'};')
end
end
- doblock("9607AE1010C857E500CD1376", "Prebuild", "prebuildcommands")
- doblock("9607AE3510C85E7E00CD1376", "Prelink", "prelinkcommands")
- doblock("9607AE3710C85E8F00CD1376", "Postbuild", "postbuildcommands")
+ dobuildblock("9607AE1010C857E500CD1376", "Prebuild", "prebuildcommands")
+ dobuildblock("9607AE3510C85E7E00CD1376", "Prelink", "prelinkcommands")
+ dobuildblock("9607AE3710C85E8F00CD1376", "Postbuild", "postbuildcommands")
+ doscriptphases("xcodescriptphases")
if wrapperWritten then
_p('/* End PBXShellScriptBuildPhase section */')
@@ -725,6 +986,82 @@
_p('')
end
+ -- copyresources leads to this
+ -- xcodeembedframeworks
+ function xcode.PBXCopyFilesBuildPhase(tr)
+ local wrapperWritten = false
+
+ local function doblock(id, name, folderSpec, path, files)
+ -- note: folder spec:
+ -- 0: Absolute Path
+ -- 1: Wrapper
+ -- 6: Executables
+ -- 7: Resources
+ -- 10: Frameworks
+ -- 16: Products Directory
+ -- category: 'Frameworks' or 'CopyFiles'
+
+ if #files > 0 then
+ if not wrapperWritten then
+ _p('/* Begin PBXCopyFilesBuildPhase section */')
+ wrapperWritten = true
+ end
+ _p(2,'%s /* %s */ = {', id, name)
+ _p(3,'isa = PBXCopyFilesBuildPhase;')
+ _p(3,'buildActionMask = 2147483647;')
+ _p(3,'dstPath = \"%s\";', path)
+ _p(3,'dstSubfolderSpec = \"%s\";', folderSpec)
+ _p(3,'files = (')
+ tree.traverse(tr, {
+ onleaf = function(node)
+ -- print(node.name)
+ if table.icontains(files, node.name) then
+ _p(4,'%s /* %s in %s */,',
+ xcode.uuid(node.name .. 'in CopyFiles'), node.name, 'CopyFiles')
+ end
+ end
+ })
+ _p(3,');')
+ _p(3,'runOnlyForDeploymentPostprocessing = 0;');
+ _p(2,'};')
+ end
+ end
+
+ local function docopyresources(which)
+ local targets = tr.project[which]
+ if #targets > 0 then
+ local i = 0
+ for _, t in ipairs(targets) do
+ for __, tt in ipairs(t) do
+ local label = xcode.getcopyphaselabel('Resources', i, tt[1])
+ local id = xcode.uuid(label)
+ local files = table.translate(table.flatten(tt[2]), path.getname)
+ doblock(id, label, 7, tt[1], files)
+ i = i + 1
+ end
+ end
+ end
+ end
+
+ local function docopyframeworks(which)
+ local targets = tr.project[which]
+ if #targets > 0 then
+ local label = "Copy Frameworks"
+ local id = xcode.uuid(label)
+ local files = table.translate(table.flatten(targets), path.getname)
+ doblock(id, label, 10, "", files)
+ end
+ end
+
+ docopyresources("xcodecopyresources")
+ if tr.project.kind == "WindowedApp" then
+ docopyframeworks("xcodecopyframeworks")
+ end
+
+ if wrapperWritten then
+ _p('/* End PBXCopyFilesBuildPhase section */')
+ end
+ end
function xcode.PBXVariantGroup(tr)
_p('/* Begin PBXVariantGroup section */')
@@ -767,83 +1104,7 @@
end
- function xcode.XCBuildConfiguration_Target(tr, target, cfg)
- local cfgname = xcode.getconfigname(cfg)
-
- _p(2,'%s /* %s */ = {', cfg.xcode.targetid, cfgname)
- _p(3,'isa = XCBuildConfiguration;')
- _p(3,'buildSettings = {')
- _p(4,'ALWAYS_SEARCH_USER_PATHS = NO;')
-
- if not cfg.flags.Symbols then
- _p(4,'DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";')
- end
-
- if cfg.kind ~= "StaticLib" and cfg.buildtarget.prefix ~= "" then
- _p(4,'EXECUTABLE_PREFIX = %s;', cfg.buildtarget.prefix)
- end
-
- if cfg.targetextension then
- local ext = cfg.targetextension
- ext = iif(ext:startswith("."), ext:sub(2), ext)
- _p(4,'EXECUTABLE_EXTENSION = %s;', ext)
- end
-
- if cfg.flags.ObjcARC then
- _p(4,'CLANG_ENABLE_OBJC_ARC = YES;')
- end
-
- local outdir = path.getdirectory(cfg.buildtarget.bundlepath)
- if outdir ~= "." then
- _p(4,'CONFIGURATION_BUILD_DIR = %s;', outdir)
- end
-
- _p(4,'GCC_DYNAMIC_NO_PIC = NO;')
- _p(4,'GCC_MODEL_TUNING = G5;')
-
- if tr.infoplist then
- _p(4,'INFOPLIST_FILE = "%s";', tr.infoplist.cfg.name)
- end
-
- installpaths = {
- ConsoleApp = '/usr/local/bin',
- WindowedApp = '"$(HOME)/Applications"',
- SharedLib = '/usr/local/lib',
- StaticLib = '/usr/local/lib',
- Bundle = '"$(LOCAL_LIBRARY_DIR)/Bundles"',
- }
- _p(4,'INSTALL_PATH = %s;', installpaths[cfg.kind])
-
- local infoplist_file = nil
-
- for _, v in ipairs(cfg.files) do
- -- for any file named *info.plist, use it as the INFOPLIST_FILE
- if (string.find (string.lower (v), 'info.plist') ~= nil) then
- infoplist_file = string.format('$(SRCROOT)/%s', v)
- end
- end
-
- if infoplist_file ~= nil then
- _p(4,'INFOPLIST_FILE = "%s";', infoplist_file)
- end
-
- if cfg.kind == "Bundle" then
- _p(4, 'PRODUCT_BUNDLE_IDENTIFIER = "genie.%s";', cfg.buildtarget.basename:gsub("%s+", '.')) --replace spaces with .
- end
-
- _p(4,'PRODUCT_NAME = "%s";', cfg.buildtarget.basename)
-
- if cfg.kind == "Bundle" then
- _p(4, 'WRAPPER_EXTENSION = bundle;')
- end
-
- _p(3,'};')
- _p(3,'name = "%s";', cfgname)
- _p(2,'};')
- end
-
-
- local function cfg_excluded_files(prj, cfg)
+ function xcode.cfg_excluded_files(prj, cfg)
local excluded = {}
-- Converts a file path to a pattern with no relative parts, prefixed with `*`.
@@ -902,161 +1163,76 @@
end
- function xcode.XCBuildConfiguration_Project(tr, prj, cfg)
+ function xcode.XCBuildConfiguration_Impl(tr, id, opts, cfg)
local cfgname = xcode.getconfigname(cfg)
- _p(2,'%s /* %s */ = {', cfg.xcode.projectid, cfgname)
+ _p(2,'%s /* %s */ = {', id, cfgname)
_p(3,'isa = XCBuildConfiguration;')
_p(3,'buildSettings = {')
- local archs = {
- Native = "$(NATIVE_ARCH_ACTUAL)",
- x32 = "i386",
- x64 = "x86_64",
- Universal32 = "$(ARCHS_STANDARD_32_BIT)",
- Universal64 = "$(ARCHS_STANDARD_64_BIT)",
- Universal = "$(ARCHS_STANDARD_32_64_BIT)",
- }
- _p(4,'ARCHS = "%s";', archs[cfg.platform])
-
- _p(4,'SDKROOT = "%s";', xcode.toolset)
-
- if tr.entitlements then
- _p(4,'CODE_SIGN_ENTITLEMENTS = "%s";', tr.entitlements.cfg.name)
- end
-
- local targetdir = path.getdirectory(cfg.buildtarget.bundlepath)
- if targetdir ~= "." then
- _p(4,'CONFIGURATION_BUILD_DIR = "$(SYMROOT)";');
- end
-
- _p(4,'CONFIGURATION_TEMP_DIR = "$(OBJROOT)";')
+ for k, v in table.sortedpairs(opts) do
+ if type(v) == "table" then
+ if #v > 0 then
+ _p(4,'%s = (', k)
- if cfg.flags.Symbols then
- _p(4,'COPY_PHASE_STRIP = NO;')
- end
+ for i, v2 in ipairs(v) do
+ _p(5,'%s,', xcode.quotestr(tostring(v2)))
+ end
- local excluded = cfg_excluded_files(prj, cfg)
- if #excluded > 0 then
- _p(4, 'EXCLUDED_SOURCE_FILE_NAMES = (')
- for _, file in ipairs(excluded) do
- _p(5, '"' .. file .. '",')
+ _p(4,');')
+ end
+ else
+ _p(4,'%s = %s;', k, xcode.quotestr(tostring(v)))
end
- _p(4, ');')
- end
-
- _p(4,'GCC_C_LANGUAGE_STANDARD = gnu99;')
-
- if cfg.flags.NoExceptions then
- _p(4,'GCC_ENABLE_CPP_EXCEPTIONS = NO;')
- end
-
- if cfg.flags.NoRTTI then
- _p(4,'GCC_ENABLE_CPP_RTTI = NO;')
- end
-
- if _ACTION ~= "xcode4" and cfg.flags.Symbols and not cfg.flags.NoEditAndContinue then
- _p(4,'GCC_ENABLE_FIX_AND_CONTINUE = YES;')
- end
-
- if cfg.flags.NoExceptions then
- _p(4,'GCC_ENABLE_OBJC_EXCEPTIONS = NO;')
- end
-
- if cfg.flags.Optimize or cfg.flags.OptimizeSize then
- _p(4,'GCC_OPTIMIZATION_LEVEL = s;')
- elseif cfg.flags.OptimizeSpeed then
- _p(4,'GCC_OPTIMIZATION_LEVEL = 3;')
- else
- _p(4,'GCC_OPTIMIZATION_LEVEL = 0;')
- end
-
- if cfg.pchheader and not cfg.flags.NoPCH then
- _p(4,'GCC_PRECOMPILE_PREFIX_HEADER = YES;')
- _p(4,'GCC_PREFIX_HEADER = "%s";', cfg.pchheader)
- end
-
- xcode.printlist(cfg.defines, 'GCC_PREPROCESSOR_DEFINITIONS')
-
- _p(4,'GCC_SYMBOLS_PRIVATE_EXTERN = NO;')
-
- if cfg.flags.FatalWarnings then
- _p(4,'GCC_TREAT_WARNINGS_AS_ERRORS = YES;')
end
- _p(4,'GCC_WARN_ABOUT_RETURN_TYPE = YES;')
- _p(4,'GCC_WARN_UNUSED_VARIABLE = YES;')
-
- xcode.printlist(cfg.includedirs, 'HEADER_SEARCH_PATHS')
- xcode.printlist(cfg.userincludedirs, 'USER_HEADER_SEARCH_PATHS')
- xcode.printlist(cfg.libdirs, 'LIBRARY_SEARCH_PATHS')
-
- _p(4,'OBJROOT = "%s";', cfg.objectsdir)
-
- _p(4,'ONLY_ACTIVE_ARCH = %s;',iif(premake.config.isdebugbuild(cfg),'YES','NO'))
-
- -- build list of "other" C/C++ flags
- local checks = {
- ["-ffast-math"] = cfg.flags.FloatFast,
- ["-ffloat-store"] = cfg.flags.FloatStrict,
- ["-fomit-frame-pointer"] = cfg.flags.NoFramePointer,
- }
+ _p(3,'};')
+ _p(3,'name = %s;', xcode.quotestr(cfgname))
+ _p(2,'};')
+ end
- local flags = { }
- for flag, check in pairs(checks) do
- if check then
- table.insert(flags, flag)
+ local function add_options(options, extras)
+ for _, tbl in ipairs(extras) do
+ for tkey, tval in pairs(tbl) do
+ options[tkey] = tval
end
end
+ end
- for _, val in ipairs(premake.xcode.parameters) do
- _p(4, val ..';')
- end
-
- xcode.printlist(table.join(flags, cfg.buildoptions, cfg.buildoptions_c), 'OTHER_CFLAGS')
- xcode.printlist(table.join(flags, cfg.buildoptions, cfg.buildoptions_cpp), 'OTHER_CPLUSPLUSFLAGS')
+ local function add_wholearchive_links(opts, cfg)
+ if #cfg.wholearchive > 0 then
+ local linkopts = {}
- -- build list of "other" linked flags. All libraries that aren't frameworks
- -- are listed here, so I don't have to try and figure out if they are ".a"
- -- or ".dylib", which Xcode requires to list in the Frameworks section
- flags = { }
- for _, lib in ipairs(premake.getlinks(cfg, "system")) do
- if not xcode.isframework(lib) then
- table.insert(flags, "-l" .. lib)
+ for _, depcfg in ipairs(premake.getlinks(cfg, "siblings", "object")) do
+ if table.icontains(cfg.wholearchive, depcfg.project.name) then
+ local linkpath = path.rebase(depcfg.linktarget.fullpath, depcfg.location, cfg.location)
+ table.insert(linkopts, "-force_load")
+ table.insert(linkopts, linkpath)
+ end
end
- end
- flags = table.join(flags, cfg.linkoptions)
- xcode.printlist(flags, 'OTHER_LDFLAGS')
-
- if cfg.flags.StaticRuntime then
- _p(4,'STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static;')
- end
- if targetdir ~= "." then
- _p(4,'SYMROOT = "%s";', targetdir)
- end
+ if opts.OTHER_LDFLAGS then
+ linkopts = table.join(linkopts, opts.OTHER_LDFLAGS)
+ end
- if cfg.flags.PedanticWarnings
- or cfg.flags.ExtraWarnings
- then
- _p(4,'WARNING_CFLAGS = "-Wall";')
+ opts.OTHER_LDFLAGS = linkopts
end
-
- _p(3,'};')
- _p(3,'name = "%s";', cfgname)
- _p(2,'};')
end
-
- function xcode.XCBuildConfiguration(tr, prj)
+ function xcode.XCBuildConfiguration(tr, prj, opts)
_p('/* Begin XCBuildConfiguration section */')
for _, target in ipairs(tr.products.children) do
for _, cfg in ipairs(tr.configs) do
- xcode.XCBuildConfiguration_Target(tr, target, cfg)
+ local values = opts.ontarget(tr, target, cfg)
+ add_options(values, cfg.xcodetargetopts)
+ xcode.XCBuildConfiguration_Impl(tr, cfg.xcode.targetid, values, cfg)
end
end
for _, cfg in ipairs(tr.configs) do
- xcode.XCBuildConfiguration_Project(tr, prj, cfg)
+ local values = opts.onproject(tr, prj, cfg)
+ add_options(values, cfg.xcodeprojectopts)
+ add_wholearchive_links(values, cfg)
+ xcode.XCBuildConfiguration_Impl(tr, cfg.xcode.projectid, values, cfg)
end
_p('/* End XCBuildConfiguration section */')
_p('')
diff --git a/3rdparty/genie/src/actions/xcode/xcode_project.lua b/3rdparty/genie/src/actions/xcode/xcode_project.lua
index 5a54d53ff5c..3a461ebdc16 100644
--- a/3rdparty/genie/src/actions/xcode/xcode_project.lua
+++ b/3rdparty/genie/src/actions/xcode/xcode_project.lua
@@ -26,8 +26,8 @@
for _, platform in ipairs(prj.solution.xcode.platforms) do
local cfg = premake.getconfig(prj, cfgname, platform)
cfg.xcode = {}
- cfg.xcode.targetid = xcode.newid(prj.xcode.projectnode, cfgname)
- cfg.xcode.projectid = xcode.newid(tr, cfgname)
+ cfg.xcode.targetid = xcode.newid(prj.xcode.projectnode, "tgt:"..platform..cfgname)
+ cfg.xcode.projectid = xcode.newid(tr, "prj:"..platform..cfgname)
table.insert(tr.configs, cfg)
end
end
@@ -112,6 +112,44 @@
tree.insert(tr, tr.projects)
end
+ -- Add intermediate paths so groups have sensible locations
+
+ -- find common prefixes going up the tree
+ tree.traverse(tr, {
+ onbranchexit = function(node)
+ for _, child in ipairs(node.children) do
+ if (child.location) then
+ if (node.location) then
+ while (not string.startswith(child.location, node.location)) do
+ node.location = path.getdirectory(node.location)
+ end
+ else
+ node.location = path.getdirectory(child.location)
+ end
+ end
+ end
+ end,
+ onleaf = function(node)
+ if (node.cfg) then
+ node.location = node.cfg.name
+ end
+ end
+ }, true)
+
+ -- now convert to relative where possible
+ tree.traverse(tr, {
+ onbranchexit = function(node, depth)
+ if (node.location and node.parent and node.parent.location) then
+ node.location = path.getrelative(node.parent.location, node.location)
+ end
+ end,
+ onleaf = function(node, depth)
+ if (node.location and node.parent and node.parent.location) then
+ node.location = path.getrelative(node.parent.location, node.location)
+ end
+ end
+ }, true)
+
-- Final setup
tree.traverse(tr, {
onnode = function(node)
@@ -146,32 +184,3 @@
return tr
end
-
-
---
--- Generate an Xcode .xcodeproj for a Premake project.
---
--- @param prj
--- The Premake project to generate.
---
-
- function premake.xcode.project(prj)
- local tr = xcode.buildprjtree(prj)
- xcode.Header(tr)
- xcode.PBXBuildFile(tr)
- xcode.PBXContainerItemProxy(tr)
- xcode.PBXFileReference(tr,prj)
- xcode.PBXFrameworksBuildPhase(tr)
- xcode.PBXGroup(tr)
- xcode.PBXNativeTarget(tr)
- xcode.PBXProject(tr)
- xcode.PBXReferenceProxy(tr)
- xcode.PBXResourcesBuildPhase(tr)
- xcode.PBXShellScriptBuildPhase(tr)
- xcode.PBXSourcesBuildPhase(tr,prj)
- xcode.PBXVariantGroup(tr)
- xcode.PBXTargetDependency(tr)
- xcode.XCBuildConfiguration(tr, prj)
- xcode.XCBuildConfigurationList(tr)
- xcode.Footer(tr)
- end
diff --git a/3rdparty/genie/src/actions/xcode/xcode_scheme.lua b/3rdparty/genie/src/actions/xcode/xcode_scheme.lua
new file mode 100644
index 00000000000..662582e2afb
--- /dev/null
+++ b/3rdparty/genie/src/actions/xcode/xcode_scheme.lua
@@ -0,0 +1,239 @@
+--
+-- xcode_scheme.lua
+--
+
+local premake = premake
+local xcode = premake.xcode
+
+
+--
+-- Print a BuildableReference element.
+--
+
+ local function buildableref(indent, prj, cfg)
+ cfg = cfg or premake.eachconfig(prj)()
+
+ _p(indent + 0, '<BuildableReference')
+ _p(indent + 1, 'BuildableIdentifier = "primary"')
+ _p(indent + 1, 'BlueprintIdentifier = "%s"', prj.xcode.projectnode.targetid)
+ _p(indent + 1, 'BuildableName = "%s"', cfg.buildtarget.name)
+ _p(indent + 1, 'BlueprintName = "%s"', prj.name)
+ _p(indent + 1, 'ReferencedContainer = "container:%s.xcodeproj">', prj.name)
+ _p(indent + 0, '</BuildableReference>')
+ end
+
+
+--
+-- Print a CommandLineArgs element, if needed by the provided config.
+--
+
+ local function cmdlineargs(indent, cfg)
+ if #cfg.debugargs > 0 then
+ _p(indent, '<CommandLineArguments>')
+ for _, arg in ipairs(cfg.debugargs) do
+ _p(indent + 1, '<CommandLineArgument')
+ _p(indent + 2, 'argument = "%s"', arg)
+ _p(indent + 2, 'isEnabled = "YES">')
+ _p(indent + 1, '</CommandLineArgument>')
+ end
+ _p(indent, '</CommandLineArguments>')
+ end
+ end
+
+
+--
+-- Print an EnvironmentVariables element, if needed by the provided config.
+
+ local function envvars(indent, cfg)
+ if #cfg.debugenvs > 0 then
+ _p(indent, '<EnvironmentVariables>')
+ for _, arg in ipairs(cfg.debugenvs) do
+ local eq = arg:find("=")
+ local k = arg:sub(1, eq)
+ local v = arg:sub(eq + 1)
+ _p(indent + 1, '<EnvironmentVariable')
+ _p(indent + 2, 'key = "%s"', arg:sub(1, eq))
+ _p(indent + 2, 'value = "%s"', arg:sub(eq))
+ _p(indent + 2, 'isEnabled = "YES">')
+ _p(indent + 1, '</EnvironmentVariable>')
+ end
+ _p(indent, '</EnvironmentVariables>')
+ end
+ end
+
+
+--
+-- Generate the customWorkingDir path from the given dir.
+--
+
+ local function workingdir(dir)
+ if not path.isabsolute(dir) then
+ dir = "$PROJECT_DIR/" .. dir
+ end
+ return dir
+ end
+
+
+--
+-- Determine the best matching configuration.
+--
+-- @param fordebug
+-- True to find a debug configuration.
+--
+
+ local function bestconfig(prj, fordebug)
+ local bestcfg = nil
+ local bestscore = -1
+
+ for cfg in premake.eachconfig(prj) do
+ local score = 0
+
+ if cfg.platform == "Native" then
+ score = score + 10
+ end
+
+ if fordebug and cfg.name == "Debug" then
+ score = score + 1
+ end
+
+ if not fordebug and cfg.name == "Release" then
+ score = score + 1
+ end
+
+ if score > bestscore then
+ bestcfg = cfg
+ bestscore = score
+ end
+ end
+
+ return bestcfg
+ end
+
+
+--
+-- Print out an xcscheme file.
+--
+-- @param tobuild
+-- The list of targets to build. Assumed to be sorted.
+-- @param primary
+-- The target to set as test/profile/launch target.
+--
+
+ function xcode.scheme(tobuild, primary, schemecfg)
+ _p('<?xml version="1.0" encoding="UTF-8"?>')
+ _p('<Scheme')
+ _p(1, 'LastUpgradeVersion = "0940"')
+ _p(1, 'version = "1.3">')
+ _p(1, '<BuildAction')
+ _p(2, 'parallelizeBuildables = "YES"')
+ _p(2, 'buildImplicitDependencies = "YES">')
+ _p(2, '<BuildActionEntries>')
+
+ for _, prj in ipairs(tobuild) do
+ _p(3, '<BuildActionEntry')
+ _p(4, 'buildForTesting = "YES"')
+ _p(4, 'buildForRunning = "YES"')
+ _p(4, 'buildForProfiling = "YES"')
+ _p(4, 'buildForArchiving = "YES"')
+ _p(4, 'buildForAnalyzing = "YES">')
+ buildableref(4, prj)
+ _p(3, '</BuildActionEntry>')
+ end
+
+ local debugcfg = schemecfg or bestconfig(primary, true)
+ local releasecfg = schemecfg or bestconfig(primary, false)
+ local debugname = xcode.getconfigname(debugcfg)
+ local releasename = xcode.getconfigname(releasecfg)
+
+ _p(2, '</BuildActionEntries>')
+ _p(1, '</BuildAction>')
+ _p(1, '<TestAction')
+ _p(2, 'buildConfiguration = "%s"', debugname)
+ _p(2, 'selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"')
+ _p(2, 'selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"')
+ _p(2, 'shouldUseLaunchSchemeArgsEnv = "YES">')
+ _p(2, '<Testables>')
+ _p(2, '</Testables>')
+ _p(2, '<MacroExpansion>')
+ buildableref(3, primary, debugcfg)
+ _p(2, '</MacroExpansion>')
+ _p(2, '<AdditionalOptions>')
+ _p(2, '</AdditionalOptions>')
+ _p(1, '</TestAction>')
+ _p(1, '<LaunchAction')
+ _p(2, 'buildConfiguration = "%s"', debugname)
+ _p(2, 'selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"')
+ _p(2, 'selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"')
+ _p(2, 'launchStyle = "0"')
+ if debugcfg.debugdir then
+ _p(2, 'useCustomWorkingDirectory = "YES"')
+ _p(2, 'customWorkingDirectory = "%s"', workingdir(debugcfg.debugdir))
+ else
+ _p(2, 'useCustomWorkingDirectory = "NO"')
+ end
+ _p(2, 'ignoresPersistentStateOnLaunch = "NO"')
+ _p(2, 'debugDocumentVersioning = "YES"')
+ _p(2, 'debugServiceExtension = "internal"')
+ _p(2, 'allowLocationSimulation = "YES">')
+ if debugcfg.debugcmd then
+ _p(2, '<PathRunnable')
+ _p(3, 'runnableDebuggingMode = "0"')
+ _p(3, 'FilePath = "%s">', debugcfg.debugcmd)
+ _p(2, '</PathRunnable>')
+ else
+ _p(2, '<BuildableProductRunnable')
+ _p(3, 'runnableDebuggingMode = "0">')
+ buildableref(3, primary, debugcfg)
+ _p(2, '</BuildableProductRunnable>')
+ end
+ cmdlineargs(2, debugcfg)
+ envvars(2, debugcfg)
+ _p(2, '<AdditionalOptions>')
+ _p(2, '</AdditionalOptions>')
+ _p(1, '</LaunchAction>')
+ _p(1, '<ProfileAction')
+ _p(2, 'buildConfiguration = "%s"', releasename)
+ _p(2, 'shouldUseLaunchSchemeArgsEnv = "YES"')
+ _p(2, 'savedToolIdentifier = ""')
+ if releasecfg.debugdir then
+ _p(2, 'useCustomWorkingDirectory = "YES"')
+ _p(2, 'customWorkingDirectory = "%s"', workingdir(releasecfg.debugdir))
+ else
+ _p(2, 'useCustomWorkingDirectory = "NO"')
+ end
+ _p(2, 'debugDocumentVersioning = "YES">')
+ _p(2, '<BuildableProductRunnable')
+ _p(3, 'runnableDebuggingMode = "0">')
+ buildableref(3, primary, releasecfg)
+ _p(2, '</BuildableProductRunnable>')
+ cmdlineargs(2, releasecfg)
+ envvars(2, releasecfg)
+ _p(1, '</ProfileAction>')
+ _p(1, '<AnalyzeAction')
+ _p(2, 'buildConfiguration = "%s">', debugname)
+ _p(1, '</AnalyzeAction>')
+ _p(1, '<ArchiveAction')
+ _p(2, 'buildConfiguration = "%s"', releasename)
+ _p(2, 'revealArchiveInOrganizer = "YES">')
+ _p(1, '</ArchiveAction>')
+ _p('</Scheme>')
+ end
+
+--
+-- Generate XCode schemes for the given project.
+--
+
+ function xcode.generate_schemes(prj, base_path)
+ if (prj.kind == "ConsoleApp" or prj.kind == "WindowedApp") or (prj.options and prj.options.XcodeLibrarySchemes) then
+
+ if prj.options and prj.options.XcodeSchemeNoConfigs then
+ premake.generate(prj, path.join(base_path, "%%.xcscheme"),
+ function(prj) xcode.scheme({prj}, prj) end)
+ else
+ for cfg in premake.eachconfig(prj) do
+ premake.generate(prj, path.join(base_path, "%% " .. cfg.name .. ".xcscheme"),
+ function(prj) xcode.scheme({prj}, prj, cfg) end)
+ end
+ end
+ end
+ end
diff --git a/3rdparty/genie/src/actions/xcode/xcode_workspace.lua b/3rdparty/genie/src/actions/xcode/xcode_workspace.lua
new file mode 100644
index 00000000000..ed0542258e7
--- /dev/null
+++ b/3rdparty/genie/src/actions/xcode/xcode_workspace.lua
@@ -0,0 +1,145 @@
+local premake = premake
+local xcode = premake.xcode
+
+xcode.allscheme = false
+
+function xcode.workspace_head()
+ _p('<?xml version="1.0" encoding="UTF-8"?>')
+ _p('<Workspace')
+ _p(1,'version = "1.0">')
+end
+
+function xcode.workspace_tail()
+ _p('</Workspace>')
+end
+
+function xcode.workspace_file_ref(prj, indent)
+ local projpath = path.getrelative(prj.solution.location, prj.location)
+ if projpath == '.' then projpath = ''
+ else projpath = projpath ..'/'
+ end
+ _p(indent, '<FileRef')
+ _p(indent + 1, 'location = "group:%s">', projpath .. prj.name .. '.xcodeproj')
+ _p(indent, '</FileRef>')
+end
+
+function xcode.workspace_group(grp, indent)
+ _p(indent, '<Group')
+ _p(indent + 1, 'location = "container:"')
+ _p(indent + 1, 'name = "%s">', grp.name)
+
+ local function comparenames(a, b)
+ return a.name < b.name
+ end
+
+ local groups = table.join(grp.groups)
+ local projects = table.join(grp.projects)
+ table.sort(groups, comparenames)
+ table.sort(projects, comparenames)
+
+ for _, child in ipairs(groups) do
+ xcode.workspace_group(child, indent + 1)
+ end
+
+ for _, prj in ipairs(projects) do
+ xcode.workspace_file_ref(prj, indent + 1)
+ end
+
+ _p(indent, '</Group>')
+end
+
+function xcode.workspace_generate(sln)
+ xcode.preparesolution(sln)
+ xcode.workspace_head()
+ xcode.reorderProjects(sln)
+
+ for grp in premake.solution.eachgroup(sln) do
+ if grp.parent == nil then
+ xcode.workspace_group(grp, 1)
+ end
+ end
+
+ for prj in premake.solution.eachproject(sln) do
+ if prj.group == nil then
+ xcode.workspace_file_ref(prj, 1)
+ end
+ end
+
+ xcode.workspace_tail()
+end
+
+
+--
+-- Generate the `-ALL` scheme, building all targets.
+--
+
+function xcode.workspace_scheme(sln)
+ if not xcode.allscheme then
+ return false
+ end
+
+ local projects = {}
+ local primary = nil
+
+ for prj in premake.solution.eachproject(sln) do
+ if not primary or (sln.startproject == prj.name) then
+ primary = prj
+ end
+ table.insert(projects, prj)
+ end
+
+ xcode.scheme(projects, primary)
+end
+
+--
+-- Generate the workspace settings file, preventing xcode from auto-generating
+-- schemes we have manually provided.
+--
+
+function xcode.workspace_settings(sln)
+ _p('<?xml version="1.0" encoding="UTF-8"?>')
+ _p('<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">')
+ _p('<plist version="1.0">')
+ _p('<dict>')
+ _p(1, '<key>IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded</key>')
+ _p(1, '<false/>')
+ _p('</dict>')
+ _p('</plist>')
+end
+
+--
+-- If a startup project is specified, move it to the front of the project list.
+-- This will make Visual Studio treat it like a startup project.
+--
+
+function xcode.reorderProjects(sln)
+ if sln.startproject then
+ for i, prj in ipairs(sln.projects) do
+ if sln.startproject == prj.name then
+ -- Move group tree containing the project to start of group list
+ local cur = prj.group
+ while cur ~= nil do
+ -- Remove group from array
+ for j, group in ipairs(sln.groups) do
+ if group == cur then
+ table.remove(sln.groups, j)
+ break
+ end
+ end
+
+ -- Add back at start
+ table.insert(sln.groups, 1, cur)
+ cur = cur.parent
+ end
+ -- Move the project itself to start
+ table.remove(sln.projects, i)
+ table.insert(sln.projects, 1, prj)
+ break
+ end
+ end
+ end
+end
+
+
+
+
diff --git a/3rdparty/genie/src/base/action.lua b/3rdparty/genie/src/base/action.lua
index 6adbcad85a4..cf8058e1ce2 100644
--- a/3rdparty/genie/src/base/action.lua
+++ b/3rdparty/genie/src/base/action.lua
@@ -54,10 +54,21 @@
if a.onsolution then
a.onsolution(sln)
end
+ if sln.postsolutioncallbacks then
+ for _,cb in ipairs(sln.postsolutioncallbacks) do
+ cb(sln)
+ end
+ end
+
for prj in premake.solution.eachproject(sln) do
if a.onproject then
a.onproject(prj)
end
+ if prj.postprojectcallbacks then
+ for _,cb in ipairs(prj.postprojectcallbacks) do
+ cb(prj)
+ end
+ end
end
end
diff --git a/3rdparty/genie/src/base/api.lua b/3rdparty/genie/src/base/api.lua
index 3a913ab9fdb..54ca768298d 100644
--- a/3rdparty/genie/src/base/api.lua
+++ b/3rdparty/genie/src/base/api.lua
@@ -4,708 +4,10 @@
-- Copyright (c) 2002-2011 Jason Perkins and the Premake project
--
+premake.fields = {}
---
--- Here I define all of the getter/setter functions as metadata. The actual
--- functions are built programmatically below.
---
-
- premake.fields =
- {
- archivesplit_size =
- {
- kind = "string",
- scope = "config",
- },
-
- basedir =
- {
- kind = "path",
- scope = "container",
- },
-
- buildaction =
- {
- kind = "string",
- scope = "config",
- allowed = {
- "Compile",
- "Copy",
- "Embed",
- "None"
- }
- },
-
- buildoptions =
- {
- kind = "list",
- scope = "config",
- },
-
- buildoptions_asm =
- {
- kind = "list",
- scope = "config",
- },
-
- buildoptions_c =
- {
- kind = "list",
- scope = "config",
- },
-
- buildoptions_cpp =
- {
- kind = "list",
- scope = "config",
- },
-
- buildoptions_objc =
- {
- kind = "list",
- scope = "config",
- },
-
- buildoptions_objcpp =
- {
- kind = "list",
- scope = "config",
- },
-
- buildoptions_vala =
- {
- kind = "list",
- scope = "config",
- },
-
- clrreferences =
- {
- kind = "list",
- scope = "container",
- },
-
- configurations =
- {
- kind = "list",
- scope = "solution",
- },
-
- custombuildtask =
- {
- kind = "table",
- scope = "config",
- },
-
- debugargs =
- {
- kind = "list",
- scope = "config",
- },
-
- debugdir =
- {
- kind = "path",
- scope = "config",
- },
-
- debugenvs =
- {
- kind = "list",
- scope = "config",
- },
-
- defines =
- {
- kind = "list",
- scope = "config",
- },
-
- deploymentoptions =
- {
- kind = "list",
- scope = "config",
- usagecopy = true,
- },
-
- dependency =
- {
- kind = "table",
- scope = "config",
- },
-
- deploymode =
- {
- kind = "string",
- scope = "config",
- },
-
- excludes =
- {
- kind = "filelist",
- scope = "config",
- },
-
- forcenative =
- {
- kind = "filelist",
- scope = "config",
- },
-
- nopch =
- {
- kind = "filelist",
- scope = "config",
- },
-
- files =
- {
- kind = "filelist",
- scope = "config",
- },
-
- removefiles =
- {
- kind = "filelist",
- scope = "config",
- },
-
- flags =
- {
- kind = "list",
- scope = "config",
- isflags = true,
- usagecopy = true,
- allowed = function(value)
-
- local allowed_flags = {
- ATL = 1,
- C7DebugInfo = 1,
- DebugEnvsDontMerge = 1,
- DebugEnvsInherit = 1,
- DeploymentContent = 1,
- EnableMinimalRebuild = 1,
- EnableSSE = 1,
- EnableSSE2 = 1,
- EnableAVX = 1,
- EnableAVX2 = 1,
- PedanticWarnings = 1,
- ExtraWarnings = 1,
- FatalWarnings = 1,
- FloatFast = 1,
- FloatStrict = 1,
- Managed = 1,
- MinimumWarnings = 1,
- MFC = 1,
- NativeWChar = 1,
- No64BitChecks = 1,
- NoBufferSecurityCheck = 1,
- NoEditAndContinue = 1,
- NoExceptions = 1,
- NoFramePointer = 1,
- NoImportLib = 1,
- NoIncrementalLink = 1,
- NoManifest = 1,
- NoMultiProcessorCompilation = 1,
- NoNativeWChar = 1,
- NoPCH = 1,
- NoRTTI = 1,
- NoWinMD = 1, -- explicitly disables Windows Metadata
- NoWinRT = 1, -- explicitly disables Windows Runtime Extension
- FastCall = 1,
- StdCall = 1,
- SingleOutputDir = 1,
- ObjcARC = 1,
- Optimize = 1,
- OptimizeSize = 1,
- OptimizeSpeed = 1,
- DebugRuntime = 1,
- ReleaseRuntime = 1,
- SEH = 1,
- StaticATL = 1,
- StaticRuntime = 1,
- Symbols = 1,
- Unicode = 1,
- Unsafe = 1,
- UnsignedChar = 1,
- UseFullPaths = 1,
- WinMain = 1,
- }
-
- local englishToAmericanSpelling =
- {
- optimise = 'optimize',
- optimisesize = 'optimizesize',
- optimisespeed = 'optimizespeed',
- }
-
- local lowervalue = value:lower()
- lowervalue = englishToAmericanSpelling[lowervalue] or lowervalue
- for v, _ in pairs(allowed_flags) do
- if v:lower() == lowervalue then
- return v
- end
- end
- return nil, "invalid flag"
- end,
- },
-
- framework =
- {
- kind = "string",
- scope = "container",
- allowed = {
- "1.0",
- "1.1",
- "2.0",
- "3.0",
- "3.5",
- "4.0",
- "4.5",
- "4.5.1",
- "4.5.2",
- "4.6",
- "4.6.1",
- "4.6.2",
- }
- },
-
- windowstargetplatformversion =
- {
- kind = "string",
- scope = "project",
- },
-
- windowstargetplatformminversion =
- {
- kind = "string",
- scope = "project",
- },
-
- forcedincludes =
- {
- kind = "list",
- scope = "config",
- },
-
- imagepath =
- {
- kind = "path",
- scope = "config",
- },
-
- imageoptions =
- {
- kind = "list",
- scope = "config",
- },
-
- implibdir =
- {
- kind = "path",
- scope = "config",
- },
-
- implibextension =
- {
- kind = "string",
- scope = "config",
- },
-
- implibname =
- {
- kind = "string",
- scope = "config",
- },
-
- implibprefix =
- {
- kind = "string",
- scope = "config",
- },
-
- implibsuffix =
- {
- kind = "string",
- scope = "config",
- },
-
- includedirs =
- {
- kind = "dirlist",
- scope = "config",
- usagecopy = true,
- },
-
- userincludedirs =
- {
- kind = "dirlist",
- scope = "config",
- usagecopy = true,
- },
-
- usingdirs =
- {
- kind = "dirlist",
- scope = "config",
- usagecopy = true,
- },
-
- kind =
- {
- kind = "string",
- scope = "config",
- allowed = {
- "ConsoleApp",
- "WindowedApp",
- "StaticLib",
- "SharedLib",
- "Bundle",
- }
- },
-
- language =
- {
- kind = "string",
- scope = "container",
- allowed = {
- "C",
- "C++",
- "C#",
- "Vala",
- "Swift",
- }
- },
-
- libdirs =
- {
- kind = "dirlist",
- scope = "config",
- linkagecopy = true,
- },
-
- linkoptions =
- {
- kind = "list",
- scope = "config",
- },
-
- links =
- {
- kind = "list",
- scope = "config",
- allowed = function(value)
- -- if library name contains a '/' then treat it as a path to a local file
- if value:find('/', nil, true) then
- value = path.getabsolute(value)
- end
- return value
- end,
- linkagecopy = true,
- mergecopiestotail = true,
- },
-
- location =
- {
- kind = "path",
- scope = "container",
- },
-
- makesettings =
- {
- kind = "list",
- scope = "config",
- },
-
-
- messageskip =
- {
- kind = "list",
- scope = "solution",
- isflags = true,
- usagecopy = true,
- allowed = function(value)
-
- local allowed_messages = {
- SkipCreatingMessage = 1,
- SkipBuildingMessage = 1,
- SkipCleaningMessage = 1,
- }
-
- local lowervalue = value:lower()
- for v, _ in pairs(allowed_messages) do
- if v:lower() == lowervalue then
- return v
- end
- end
- return nil, "invalid message to skip"
- end,
- },
-
- msgarchiving =
- {
- kind = "string",
- scope = "config",
- },
-
- msgcompile =
- {
- kind = "string",
- scope = "config",
- },
-
- msgprecompile =
- {
- kind = "string",
- scope = "config",
- },
-
- msgcompile_objc =
- {
- kind = "string",
- scope = "config",
- },
-
- msgresource =
- {
- kind = "string",
- scope = "config",
- },
-
- msglinking =
- {
- kind = "string",
- scope = "config",
- },
-
- objdir =
- {
- kind = "path",
- scope = "config",
- },
-
- options =
- {
- kind = "list",
- scope = "container",
- isflags = true,
- usagecopy = true,
- allowed = function(value)
-
- local allowed_options = {
- ForceCPP = 1,
- ArchiveSplit = 1
- }
-
- local lowervalue = value:lower()
- for v, _ in pairs(allowed_options) do
- if v:lower() == lowervalue then
- return v
- end
- end
- return nil, "invalid option"
- end,
- },
-
- pchheader =
- {
- kind = "string",
- scope = "config",
- },
-
- pchsource =
- {
- kind = "path",
- scope = "config",
- },
-
- platforms =
- {
- kind = "list",
- scope = "solution",
- allowed = table.keys(premake.platforms),
- },
-
- postbuildcommands =
- {
- kind = "list",
- scope = "config",
- },
-
- prebuildcommands =
- {
- kind = "list",
- scope = "config",
- },
-
- postcompiletasks =
- {
- kind = "list",
- scope = "config",
- },
-
- prelinkcommands =
- {
- kind = "list",
- scope = "config",
- },
-
- propertysheets =
- {
- kind = "dirlist",
- scope = "config",
- },
-
- pullmappingfile =
- {
- kind = "path",
- scope = "config",
- },
-
- resdefines =
- {
- kind = "list",
- scope = "config",
- },
-
- resincludedirs =
- {
- kind = "dirlist",
- scope = "config",
- },
-
- resoptions =
- {
- kind = "list",
- scope = "config",
- },
-
- sdkreferences =
- {
- kind = "list",
- scope = "config",
- },
-
- startproject =
- {
- kind = "string",
- scope = "solution",
- },
-
- targetdir =
- {
- kind = "path",
- scope = "config",
- },
-
- targetsubdir =
- {
- kind = "string",
- scope = "config",
- },
-
- targetextension =
- {
- kind = "string",
- scope = "config",
- },
-
- targetname =
- {
- kind = "string",
- scope = "config",
- },
-
- targetprefix =
- {
- kind = "string",
- scope = "config",
- },
-
- targetsuffix =
- {
- kind = "string",
- scope = "config",
- },
-
- trimpaths =
- {
- kind = "dirlist",
- scope = "config",
- },
-
- uuid =
- {
- kind = "string",
- scope = "container",
- allowed = function(value)
- local ok = true
- if (#value ~= 36) then ok = false end
- for i=1,36 do
- local ch = value:sub(i,i)
- if (not ch:find("[ABCDEFabcdef0123456789-]")) then ok = false end
- end
- if (value:sub(9,9) ~= "-") then ok = false end
- if (value:sub(14,14) ~= "-") then ok = false end
- if (value:sub(19,19) ~= "-") then ok = false end
- if (value:sub(24,24) ~= "-") then ok = false end
- if (not ok) then
- return nil, "invalid UUID"
- end
- return value:upper()
- end
- },
-
- uses =
- {
- kind = "list",
- scope = "config",
- },
-
- vapidirs =
- {
- kind = "dirlist",
- scope = "config",
- },
-
- vpaths =
- {
- kind = "keypath",
- scope = "container",
- },
-
- vsimportreferences =
- {
- kind = "filelist",
- scope = "container",
- },
- -- swift options
- swiftmodulemaps =
- {
- kind = "filelist",
- scope = "config",
- },
-
- buildoptions_swift =
- {
- kind = "list",
- scope = "config",
- },
-
- linkoptions_swift =
- {
- kind = "list",
- scope = "config",
- },
- }
-
-
---
--- End of metadata
---
-
-
- premake.check_paths = false
+premake.check_paths = false
--
-- Check to see if a value exists in a list of values, using a
@@ -999,34 +301,6 @@
end
end
-
-
---
--- Build all of the getter/setter functions from the metadata above.
---
-
- for name, info in pairs(premake.fields) do
- _G[name] = function(value)
- return accessor(name, value)
- end
-
- -- list value types get a remove() call too
- if info.kind == "list"
- or info.kind == "dirlist"
- or info.kind == "filelist"
- or info.kind == "absolutefilelist"
- then
- if name ~= "removefiles"
- and name ~= "files" then
- _G["remove"..name] = function(value)
- premake.remove(name, value)
- end
- end
- end
- end
-
-
-
--
-- Project object constructors.
--
@@ -1303,7 +577,6 @@
table.insert(sln.importedprojects, project)
end
-
--
-- Define a new action.
--
@@ -1336,3 +609,950 @@
function enablefilelevelconfig()
premake._filelevelconfig = true
end
+
+
+
+--
+-- Define a new API field.
+-- Build the getter/setter functions from its metadata.
+--
+-- @param a
+-- The new field/API object.
+--
+
+function newapifield(field)
+ premake.fields[field.name] = field
+
+ _G[field.name] = function(value)
+ return accessor(field.name, value)
+ end
+
+ -- list value types get a remove() call too
+ if field.kind == "list"
+ or field.kind == "dirlist"
+ or field.kind == "filelist"
+ or field.kind == "absolutefilelist"
+ then
+ if field.name ~= "removefiles"
+ and field.name ~= "files" then
+ _G["remove"..field.name] = function(value)
+ premake.remove(field.name, value)
+ end
+ end
+ end
+end
+
+--
+-- This builds the API functions from their metadata.
+--
+
+ newapifield {
+ name = "archivesplit_size",
+ kind = "string",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "basedir",
+ kind = "path",
+ scope = "container",
+ }
+
+ newapifield {
+ name = "buildaction",
+ kind = "string",
+ scope = "config",
+ allowed = {
+ "Compile",
+ "Copy",
+ "Embed",
+ "None"
+ }
+ }
+
+ newapifield {
+ name = "buildoptions",
+ kind = "list",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "buildoptions_asm",
+ kind = "list",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "buildoptions_c",
+ kind = "list",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "buildoptions_cpp",
+ kind = "list",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "buildoptions_objc",
+ kind = "list",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "buildoptions_objcpp",
+ kind = "list",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "buildoptions_vala",
+ kind = "list",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "clrreferences",
+ kind = "list",
+ scope = "container",
+ }
+
+ newapifield {
+ name = "configurations",
+ kind = "list",
+ scope = "solution",
+ }
+
+ newapifield {
+ name = "custombuildtask",
+ kind = "table",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "debugcmd",
+ kind = "string",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "debugargs",
+ kind = "list",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "debugdir",
+ kind = "path",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "debugenvs" ,
+ kind = "list",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "defines",
+ kind = "list",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "deploymentoptions",
+ kind = "list",
+ scope = "config",
+ usagecopy = true,
+ }
+
+ newapifield {
+ name = "dependency",
+ kind = "table",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "deploymode",
+ kind = "string",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "excludes",
+ kind = "filelist",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "forcenative",
+ kind = "filelist",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "nopch",
+ kind = "filelist",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "files",
+ kind = "filelist",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "removefiles",
+ kind = "filelist",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "flags",
+ kind = "list",
+ scope = "config",
+ isflags = true,
+ usagecopy = true,
+ allowed = function(value)
+ local allowed_flags = {
+ AntBuildDebuggable = 1,
+ ATL = 1,
+ C7DebugInfo = 1,
+ Cpp11 = 1,
+ Cpp14 = 1,
+ Cpp17 = 1,
+ CppLatest = 1,
+ DebugEnvsDontMerge = 1,
+ DebugEnvsInherit = 1,
+ DeploymentContent = 1,
+ EnableMinimalRebuild = 1,
+ EnableSSE = 1,
+ EnableSSE2 = 1,
+ EnableAVX = 1,
+ EnableAVX2 = 1,
+ PedanticWarnings = 1,
+ ExtraWarnings = 1,
+ FatalWarnings = 1,
+ FloatFast = 1,
+ FloatStrict = 1,
+ FullSymbols = 1,
+ Hotpatchable = 1,
+ LinkSupportCircularDependencies = 1,
+ Managed = 1,
+ MinimumWarnings = 1,
+ MFC = 1,
+ NativeWChar = 1,
+ No64BitChecks = 1,
+ NoBufferSecurityCheck = 1,
+ NoEditAndContinue = 1,
+ NoExceptions = 1,
+ NoFramePointer = 1,
+ NoImportLib = 1,
+ NoIncrementalLink = 1,
+ NoJMC = 1,
+ NoManifest = 1,
+ NoMultiProcessorCompilation = 1,
+ NoNativeWChar = 1,
+ NoOptimizeLink = 1,
+ NoPCH = 1,
+ NoRTTI = 1,
+ NoRuntimeChecks = 1,
+ NoWinMD = 1, -- explicitly disables Windows Metadata
+ NoWinRT = 1, -- explicitly disables Windows Runtime Extension
+ FastCall = 1,
+ StdCall = 1,
+ SingleOutputDir = 1,
+ ObjcARC = 1,
+ Optimize = 1,
+ OptimizeSize = 1,
+ OptimizeSpeed = 1,
+ DebugRuntime = 1,
+ ReleaseRuntime = 1,
+ SEH = 1,
+ StaticATL = 1,
+ StaticRuntime = 1,
+ Symbols = 1,
+ Unicode = 1,
+ UnitySupport = 1,
+ Unsafe = 1,
+ UnsignedChar = 1,
+ UseFullPaths = 1,
+ UseLDResponseFile = 1,
+ UseObjectResponseFile = 1,
+ WinMain = 1
+ }
+
+ local englishToAmericanSpelling =
+ {
+ nooptimiselink = 'nooptimizelink',
+ optimise = 'optimize',
+ optimisesize = 'optimizesize',
+ optimisespeed = 'optimizespeed',
+ }
+
+ local lowervalue = value:lower()
+ lowervalue = englishToAmericanSpelling[lowervalue] or lowervalue
+ for v, _ in pairs(allowed_flags) do
+ if v:lower() == lowervalue then
+ return v
+ end
+ end
+ return nil, "invalid flag"
+ end,
+ }
+
+ newapifield {
+ name = "framework",
+ kind = "string",
+ scope = "container",
+ allowed = {
+ "1.0",
+ "1.1",
+ "2.0",
+ "3.0",
+ "3.5",
+ "4.0",
+ "4.5",
+ "4.5.1",
+ "4.5.2",
+ "4.6",
+ "4.6.1",
+ "4.6.2",
+ }
+ }
+
+ newapifield {
+ name = "iostargetplatformversion",
+ kind = "string",
+ scope = "project",
+ }
+
+ newapifield {
+ name = "macostargetplatformversion",
+ kind = "string",
+ scope = "project",
+ }
+
+ newapifield {
+ name = "tvostargetplatformversion",
+ kind = "string",
+ scope = "project",
+ }
+
+ newapifield {
+ name = "windowstargetplatformversion",
+ kind = "string",
+ scope = "project",
+ }
+
+ newapifield {
+ name = "windowstargetplatformminversion",
+ kind = "string",
+ scope = "project",
+ }
+
+ newapifield {
+ name = "forcedincludes",
+ kind = "list",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "imagepath",
+ kind = "path",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "imageoptions",
+ kind = "list",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "implibdir",
+ kind = "path",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "implibextension",
+ kind = "string",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "implibname",
+ kind = "string",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "implibprefix",
+ kind = "string",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "implibsuffix",
+ kind = "string",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "includedirs",
+ kind = "dirlist",
+ scope = "config",
+ usagecopy = true,
+ }
+
+ newapifield {
+ name = "systemincludedirs",
+ kind = "dirlist",
+ scope = "config",
+ usagecopy = true,
+ }
+
+ newapifield {
+ name = "userincludedirs",
+ kind = "dirlist",
+ scope = "config",
+ usagecopy = true,
+ }
+
+ newapifield {
+ name = "usingdirs",
+ kind = "dirlist",
+ scope = "config",
+ usagecopy = true,
+ }
+
+ newapifield {
+ name = "kind",
+ kind = "string",
+ scope = "config",
+ allowed = {
+ "ConsoleApp",
+ "WindowedApp",
+ "StaticLib",
+ "SharedLib",
+ "Bundle",
+ }
+ }
+
+ newapifield {
+ name = "language",
+ kind = "string",
+ scope = "container",
+ allowed = {
+ "C",
+ "C++",
+ "C#",
+ "Vala",
+ "Swift",
+ }
+ }
+
+ newapifield {
+ name = "libdirs",
+ kind = "dirlist",
+ scope = "config",
+ linkagecopy = true,
+ }
+
+ newapifield {
+ name = "linkoptions",
+ kind = "list",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "links",
+ kind = "list",
+ scope = "config",
+ allowed = function(value)
+ -- if library name contains a '/' then treat it as a path to a local file
+ if value:find('/', nil, true) then
+ value = path.getabsolute(value)
+ end
+ return value
+ end,
+ linkagecopy = true,
+ mergecopiestotail = true,
+ }
+
+ newapifield {
+ name = "location",
+ kind = "path",
+ scope = "container",
+ }
+
+ newapifield {
+ name = "makesettings",
+ kind = "list",
+ scope = "config",
+ }
+
+
+ newapifield {
+ name = "messageskip",
+ kind = "list",
+ scope = "solution",
+ isflags = true,
+ usagecopy = true,
+ allowed = function(value)
+ local allowed_messages = {
+ SkipCreatingMessage = 1,
+ SkipBuildingMessage = 1,
+ SkipCleaningMessage = 1,
+ }
+
+ local lowervalue = value:lower()
+ for v, _ in pairs(allowed_messages) do
+ if v:lower() == lowervalue then
+ return v
+ end
+ end
+ return nil, "invalid message to skip"
+ end,
+ }
+
+ newapifield {
+ name = "msgarchiving",
+ kind = "string",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "msgcompile",
+ kind = "string",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "msgprecompile",
+ kind = "string",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "msgcompile_objc",
+ kind = "string",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "msgresource",
+ kind = "string",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "msglinking",
+ kind = "string",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "objdir",
+ kind = "path",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "options",
+ kind = "list",
+ scope = "container",
+ isflags = true,
+ usagecopy = true,
+ allowed = function(value)
+ local allowed_options = {
+ ForceCPP = 1,
+ ArchiveSplit = 1,
+ SkipBundling = 1,
+ XcodeLibrarySchemes = 1,
+ XcodeSchemeNoConfigs = 1,
+ }
+
+ local lowervalue = value:lower()
+ for v, _ in pairs(allowed_options) do
+ if v:lower() == lowervalue then
+ return v
+ end
+ end
+ return nil, "invalid option"
+ end,
+ }
+
+ newapifield {
+ name = "pchheader",
+ kind = "string",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "pchsource",
+ kind = "path",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "platforms",
+ kind = "list",
+ scope = "solution",
+ allowed = table.keys(premake.platforms),
+ }
+
+ newapifield {
+ name = "postbuildcommands",
+ kind = "list",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "prebuildcommands",
+ kind = "list",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "postcompiletasks",
+ kind = "list",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "prelinkcommands",
+ kind = "list",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "propertysheets",
+ kind = "dirlist",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "pullmappingfile",
+ kind = "path",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "applicationdatadir",
+ kind = "path",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "finalizemetasource",
+ kind = "path",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "resdefines",
+ kind = "list",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "resincludedirs",
+ kind = "dirlist",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "resoptions",
+ kind = "list",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "sdkreferences",
+ kind = "list",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "startproject",
+ kind = "string",
+ scope = "solution",
+ }
+
+ newapifield {
+ name = "targetdir",
+ kind = "path",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "targetsubdir",
+ kind = "string",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "targetextension",
+ kind = "string",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "targetname",
+ kind = "string",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "targetprefix",
+ kind = "string",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "targetsuffix",
+ kind = "string",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "trimpaths",
+ kind = "dirlist",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "uuid",
+ kind = "string",
+ scope = "container",
+ allowed = function(value)
+ local ok = true
+ if (#value ~= 36) then ok = false end
+ for i=1,36 do
+ local ch = value:sub(i,i)
+ if (not ch:find("[ABCDEFabcdef0123456789-]")) then ok = false end
+ end
+ if (value:sub(9,9) ~= "-") then ok = false end
+ if (value:sub(14,14) ~= "-") then ok = false end
+ if (value:sub(19,19) ~= "-") then ok = false end
+ if (value:sub(24,24) ~= "-") then ok = false end
+ if (not ok) then
+ return nil, "invalid UUID"
+ end
+ return value:upper()
+ end
+ }
+
+ newapifield {
+ name = "uses",
+ kind = "list",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "vapidirs",
+ kind = "dirlist",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "vpaths",
+ kind = "keypath",
+ scope = "container",
+ }
+
+ newapifield {
+ name = "vsimportreferences",
+ kind = "filelist",
+ scope = "container",
+ }
+
+ newapifield {
+ name = "dpiawareness",
+ kind = "string",
+ scope = "config",
+ allowed = {
+ "None",
+ "High",
+ "HighPerMonitor",
+ }
+ }
+
+ newapifield {
+ name = "xcodeprojectopts",
+ kind = "table",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "xcodetargetopts",
+ kind = "table",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "xcodescriptphases",
+ kind = "table",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "xcodecopyresources",
+ kind = "table",
+ scope = "project",
+ }
+
+ newapifield {
+ name = "xcodecopyframeworks",
+ kind = "filelist",
+ scope = "project",
+ }
+
+ newapifield {
+ name = "wholearchive",
+ kind = "list",
+ scope = "config",
+ }
+
+ -- swift options
+ newapifield {
+ name = "swiftmodulemaps",
+ kind = "filelist",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "buildoptions_swift",
+ kind = "list",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "linkoptions_swift",
+ kind = "list",
+ scope = "config",
+ }
+
+ -- Tegra Android options
+ newapifield {
+ name = "androidtargetapi",
+ kind = "string",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "androidminapi",
+ kind = "string",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "androidarch",
+ kind = "string",
+ scope = "config",
+ allowed = {
+ "armv7-a",
+ "armv7-a-hard",
+ "arm64-v8a",
+ "x86",
+ "x86_64",
+ }
+ }
+
+ newapifield {
+ name = "androidndktoolchainversion",
+ kind = "string",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "androidstltype",
+ kind = "string",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "androidcppstandard",
+ kind = "string",
+ scope = "config",
+ allowed = {
+ "c++98",
+ "c++11",
+ "c++1y",
+ "gnu++98",
+ "gnu++11",
+ "gnu++1y",
+ }
+ }
+
+ newapifield {
+ name = "androidlinker",
+ kind = "string",
+ scope = "config",
+ allowed = {
+ "bfd",
+ "gold",
+ }
+ }
+
+ newapifield {
+ name = "androiddebugintentparams",
+ kind = "list",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "antbuildjavasourcedirs",
+ kind = "dirlist",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "antbuildjardirs",
+ kind = "dirlist",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "antbuildjardependencies",
+ kind = "list",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "antbuildnativelibdirs",
+ kind = "dirlist",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "antbuildnativelibdependencies",
+ kind = "list",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "antbuildassetsdirs",
+ kind = "dirlist",
+ scope = "config",
+ }
+
+ newapifield {
+ name = "postsolutioncallbacks",
+ kind = "list",
+ scope = "solution",
+ }
+
+ newapifield {
+ name = "postprojectcallbacks",
+ kind = "list",
+ scope = "project",
+ }
+
+--
+-- End of API
+--
diff --git a/3rdparty/genie/src/base/bake.lua b/3rdparty/genie/src/base/bake.lua
index 8061733ae62..9d69487e6d7 100644
--- a/3rdparty/genie/src/base/bake.lua
+++ b/3rdparty/genie/src/base/bake.lua
@@ -45,7 +45,11 @@
-- See the docs for configuration() for more information about the terms.
--
- function premake.getactiveterms()
+ function premake.getactiveterms(obj)
+ -- While the `obj` argument is not used in this function, it should
+ -- remain accepted so users can override this function if need be, and
+ -- still have access to the context (solution/project).
+
local terms = { _action = _ACTION:lower(), os = os.get() }
-- add option keys or values
@@ -328,7 +332,7 @@
-- build a set of configuration filter terms; only those configuration blocks
-- with a matching set of keywords will be included in the merged results
- local terms = premake.getactiveterms()
+ local terms = premake.getactiveterms(obj)
-- build a project-level configuration.
merge(result, obj, basis, terms)--this adjusts terms
@@ -767,7 +771,10 @@
end
-- adjust the kind as required by the target system
- if cfg.kind == "Bundle" and not _ACTION:match("xcode[0-9]") then
+ if cfg.kind == "Bundle"
+ and _ACTION ~= "gmake"
+ and (_ACTION ~= "ninja" and (not prj.options or not prj.options.SkipBundling))
+ and not _ACTION:match("xcode[0-9]") then
cfg.kind = "SharedLib"
end
@@ -799,11 +806,13 @@
-- un-duplify it
local allfiles = {}
local allfilesDict = {}
- for _, fname in ipairs(cfg.allfiles) do
- if allfilesDict[fname] == nil then
- if removefilesDict[fname] == nil then
- allfilesDict[fname] = true
- table.insert(allfiles, fname)
+ if cfg.allfiles ~= nil then
+ for _, fname in ipairs(cfg.allfiles) do
+ if allfilesDict[fname] == nil then
+ if removefilesDict[fname] == nil then
+ allfilesDict[fname] = true
+ table.insert(allfiles, fname)
+ end
end
end
end
diff --git a/3rdparty/genie/src/base/config.lua b/3rdparty/genie/src/base/config.lua
index a27d7f2ac19..eec1ad67499 100644
--- a/3rdparty/genie/src/base/config.lua
+++ b/3rdparty/genie/src/base/config.lua
@@ -64,22 +64,43 @@
--
function premake.config.isincrementallink(cfg)
- if cfg.kind == "StaticLib"
- or config.isoptimizedbuild(cfg.flags)
- or cfg.flags.NoIncrementalLink then
+ if cfg.kind == "StaticLib" then
return false
end
- return true
+ return not config.islinkeroptimizedbuild(cfg.flags) and not cfg.flags.NoIncrementalLink
end
--
-- Determine if this configuration uses one of the optimize flags.
--- Optimized builds get different treatment, such as full linking
--- instead of incremental.
--
function premake.config.isoptimizedbuild(flags)
return flags.Optimize or flags.OptimizeSize or flags.OptimizeSpeed
end
+
+--
+-- Determine if this configuration uses one of the optimize flags.
+-- Optimized builds get different treatment, such as full linking
+-- instead of incremental.
+--
+
+ function premake.config.islinkeroptimizedbuild(flags)
+ return config.isoptimizedbuild(flags) and not flags.NoOptimizeLink
+ end
+
+
+--
+-- Determines if this configuration uses edit and continue.
+--
+
+ function premake.config.iseditandcontinue(cfg)
+ if cfg.flags.NoEditAndContinue
+ or cfg.flags.Managed
+ or (cfg.kind ~= "StaticLib" and not config.isincrementallink(cfg))
+ or config.islinkeroptimizedbuild(cfg.flags) then
+ return false
+ end
+ return true
+ end
diff --git a/3rdparty/genie/src/base/globals.lua b/3rdparty/genie/src/base/globals.lua
index 9a5e19c7025..d24b66f163d 100644
--- a/3rdparty/genie/src/base/globals.lua
+++ b/3rdparty/genie/src/base/globals.lua
@@ -80,6 +80,31 @@
nosharedlibs = true,
namestyle = "windows",
},
+ TegraAndroid =
+ {
+ cfgsuffix = "tegraandroid",
+ iscrosscompiler = true,
+ namestyle = "TegraAndroid",
+ },
+ NX32 =
+ {
+ cfgsuffix = "nx32",
+ iscrosscompiler = true,
+ namestyle = "NX",
+ },
+ NX64 =
+ {
+ cfgsuffix = "nx64",
+ iscrosscompiler = true,
+ namestyle = "NX",
+ },
+ Emscripten =
+ {
+ cfgsuffix = "emscripten",
+ iscrosscompiler = true,
+ nosharedlibs = true,
+ namestyle = "Emscripten",
+ },
}
diff --git a/3rdparty/genie/src/base/io.lua b/3rdparty/genie/src/base/io.lua
index 9ebc03d07e8..11c2a28924d 100644
--- a/3rdparty/genie/src/base/io.lua
+++ b/3rdparty/genie/src/base/io.lua
@@ -15,22 +15,26 @@ _esc = _escaper
--
-- Prepare to capture the output from all subsequent calls to io.printf(),
--- used for automated testing of the generators.
+-- used for automated testing of the generators. Returns the previously
+-- captured text.
--
function io.capture()
+ local prev = io.captured
io.captured = ''
+ return prev
end
--
--- Returns the captured text and stops capturing.
+-- Returns the captured text and stops capturing, optionally restoring a
+-- previous capture.
--
- function io.endcapture()
+ function io.endcapture(restore)
local captured = io.captured
- io.captured = nil
+ io.captured = restore
return captured
end
diff --git a/3rdparty/genie/src/base/os.lua b/3rdparty/genie/src/base/os.lua
index 7d9351eaf58..ae88c0ad949 100644
--- a/3rdparty/genie/src/base/os.lua
+++ b/3rdparty/genie/src/base/os.lua
@@ -133,7 +133,7 @@
end
-- Identify the system
- local arch
+ local arch = ""
if _OS == "windows" then
arch = os.getenv("PROCESSOR_ARCHITECTURE")
elseif _OS == "macosx" then
@@ -142,13 +142,16 @@
arch = os.outputof("uname -m")
end
- -- Check our known 64-bit identifiers
- arch = arch:lower()
- for _, hosttype in ipairs(_64BitHostTypes) do
- if arch:find(hosttype) then
- return true
+ if nil ~= arch then
+ -- Check our known 64-bit identifiers
+ arch = arch:lower()
+ for _, hosttype in ipairs(_64BitHostTypes) do
+ if arch:find(hosttype) then
+ return true
+ end
end
end
+
return false
end
@@ -292,4 +295,3 @@
-- remove this directory
builtin_rmdir(p)
end
-
diff --git a/3rdparty/genie/src/base/path.lua b/3rdparty/genie/src/base/path.lua
index c017ff7822b..ae2561ac07e 100644
--- a/3rdparty/genie/src/base/path.lua
+++ b/3rdparty/genie/src/base/path.lua
@@ -157,7 +157,7 @@
end
function path.iscppfile(fname)
- return path.hasextension(fname, { ".cc", ".cpp", ".cxx", ".c", ".m", ".mm" })
+ return path.hasextension(fname, { ".cc", ".cpp", ".cxx", ".c++", ".c", ".m", ".mm" })
end
function path.iscxfile(fname)
@@ -176,6 +176,10 @@
return path.hasextension(fname, ".appxmanifest")
end
+ function path.isandroidbuildfile(fname)
+ return path.getname(fname) == "AndroidManifest.xml"
+ end
+
function path.isnatvis(fname)
return path.hasextension(fname, ".natvis")
end
@@ -202,11 +206,20 @@
end
function path.issourcefilevs(fname)
- return path.hasextension(fname, { ".cc", ".cpp", ".cxx", ".c" })
+ return path.hasextension(fname, { ".cc", ".cpp", ".cxx", ".c++", ".c" })
or path.iscxfile(fname)
end
--
+-- Returns true if the filename represents a compiled object file. This check
+-- is used to support object files in the "files" list for archiving.
+--
+
+ function path.isobjectfile(fname)
+ return path.hasextension(fname, { ".o", ".obj" })
+ end
+
+--
-- Returns true if the filename represents a Windows resource file. This check
-- is used to prevent passing non-resources to the compiler in makefiles.
--
diff --git a/3rdparty/genie/src/base/premake.lua b/3rdparty/genie/src/base/premake.lua
index 8d64d9663c1..c96ef0f2a2a 100644
--- a/3rdparty/genie/src/base/premake.lua
+++ b/3rdparty/genie/src/base/premake.lua
@@ -22,13 +22,18 @@
--
function premake.generate(obj, filename, callback)
+ local prev = io.capture()
+ local abort = (callback(obj) == false)
+ local new = io.endcapture(prev)
+
+ if abort then
+ premake.stats.num_skipped = premake.stats.num_skipped + 1
+ return
+ end
+
filename = premake.project.getfilename(obj, filename)
if (premake._checkgenerate) then
- io.capture()
- callback(obj)
- local new = io.endcapture()
-
local delta = false
local f, err = io.open(filename, "rb")
@@ -69,8 +74,7 @@
error(err, 0)
end
- io.output(f)
- callback(obj)
+ f:write(new)
f:close()
premake.stats.num_generated = premake.stats.num_generated + 1
end
diff --git a/3rdparty/genie/src/base/project.lua b/3rdparty/genie/src/base/project.lua
index 1fc7375e93e..1c817c4168c 100644
--- a/3rdparty/genie/src/base/project.lua
+++ b/3rdparty/genie/src/base/project.lua
@@ -506,7 +506,7 @@
ext = ".lib"
end
elseif namestyle == "posix" then
- if kind == "WindowedApp" and system == "macosx" then
+ if kind == "WindowedApp" and system == "macosx" and not cfg.options.SkipBundling then
bundlename = name .. ".app"
bundlepath = path.join(dir, bundlename)
dir = path.join(bundlepath, "Contents/MacOS")
@@ -535,6 +535,34 @@
elseif kind == "SharedLib" then
ext = ".prx"
end
+ elseif namestyle == "TegraAndroid" then
+ -- the .so->.apk happens later for Application types
+ if kind == "ConsoleApp" or kind == "WindowedApp" or kind == "SharedLib" then
+ prefix = "lib"
+ ext = ".so"
+ elseif kind == "StaticLib" then
+ prefix = "lib"
+ ext = ".a"
+ end
+ elseif namestyle == "NX" then
+ -- NOTE: it would be cleaner to just output $(TargetExt) for all cases, but
+ -- there is logic elsewhere that assumes a '.' to be present in target name
+ -- such that it can reverse engineer the extension set here.
+ if kind == "ConsoleApp" or kind == "WindowedApp" then
+ ext = ".nspd_root"
+ elseif kind == "StaticLib" then
+ ext = ".a"
+ elseif kind == "SharedLib" then
+ ext = ".nro"
+ end
+ elseif namestyle == "Emscripten" then
+ if kind == "ConsoleApp" or kind == "WindowedApp" then
+ ext = ".html"
+ elseif kind == "StaticLib" then
+ ext = ".bc"
+ elseif kind == "SharedLib" then
+ ext = ".js"
+ end
end
prefix = cfg[field.."prefix"] or cfg.targetprefix or prefix
diff --git a/3rdparty/genie/src/base/table.lua b/3rdparty/genie/src/base/table.lua
index 7bf37e7628c..c982e78325a 100644
--- a/3rdparty/genie/src/base/table.lua
+++ b/3rdparty/genie/src/base/table.lua
@@ -171,6 +171,24 @@
--
+-- Return an iterator over key/value pairs in a table, sorted by key.
+--
+
+ function table.sortedpairs(t)
+ local keys = table.keys(t)
+ local i = 0
+ table.sort(keys)
+ return function()
+ i = i + 1
+ if keys[i] == nil then
+ return nil
+ end
+ return keys[i], t[keys[i]]
+ end
+ end
+
+
+--
-- Adds the key-value associations from one table into another
-- and returns the resulting merged table.
--
@@ -212,12 +230,12 @@
end
return result
end
-
-
+
+
--
-- reverse table order
--
-
+
function table.reverse(arr)
for i=1, math.floor(#arr / 2) do
arr[i], arr[#arr - i + 1] = arr[#arr - i + 1], arr[i]
diff --git a/3rdparty/genie/src/host/premake.c b/3rdparty/genie/src/host/premake.c
index 037f7707fb4..a8ad1140912 100644
--- a/3rdparty/genie/src/host/premake.c
+++ b/3rdparty/genie/src/host/premake.c
@@ -15,9 +15,9 @@
#define COPYRIGHT \
- "Copyright (c) 2014-2015 Branimir Karadžić, Neil Richardson,\n" \
+ "Copyright (c) 2014-2018 Branimir Karadžić, Neil Richardson,\n" \
"Mike Popoloski, Drew Solomon, Ted de Munnik, Miodrag Milanović\n" \
- "Brett Vickers, Terry Hendrix II.\n" \
+ "Brett Vickers, Terry Hendrix II, Johan Skoeld.\n" \
"Copyright (C) 2002-2013 Jason Perkins and the Premake Project"
#define ERROR_MESSAGE "%s\n"
@@ -265,7 +265,7 @@ int process_option(lua_State* L, const char* arg)
char* ptr = strchr(arg, '=');
if (ptr)
{
- int len = ptr - arg;
+ int len = (int)(ptr - arg);
if (len > 511) len = 511;
strncpy(key, arg, len);
key[len] = '\0';
diff --git a/3rdparty/genie/src/host/scripts.c b/3rdparty/genie/src/host/scripts.c
index 536bbc734d3..c33dbd685c2 100644
--- a/3rdparty/genie/src/host/scripts.c
+++ b/3rdparty/genie/src/host/scripts.c
@@ -1,41 +1,42 @@
-/* Premake's Lua scripts, as static data buffers for release mode builds */
+/* Premake's Lua scripts, as static data buffers for release mode builds */
/* DO NOT EDIT - this file is autogenerated - see BUILD.txt */
/* To regenerate this file, run: premake4 embed */
const char* builtin_scripts[] = {
/* base/os.lua */
"function os.executef(cmd, ...)\nlocal arg={...}\ncmd = string.format(cmd, table.unpack(arg))\nreturn os.execute(cmd)\nend\nlocal function parse_ld_so_conf(conf_file)\nlocal first, last\nlocal dirs = { }\nlocal file = io.open(conf_file)\nif file == nil then\nreturn dirs\nend\nfor line in file:lines() do\nfirst = line:find(\"#\", 1, true)\nif first ~= nil then\nline = line:sub(1, first - 1)\nend\nif line ~= \"\" then\nfirst, last = line:find(\"include%s+\")\nif first ~= nil then\nlocal include_glob = line:sub(last + 1)\nlocal includes = os.matchfiles(include_glob)\nfor _, v in ipairs(includes) do\ndirs = table.join(dirs, parse_ld_so_conf(v))\nend\nelse\ntable.insert(dirs, line)\nend\nend\nend\nreturn dirs\nend\nfunction os.findlib(libname)\nlocal path, formats\nif os.is(\"windows\") then\nformats = { \"%s.dll\", \"%s\" }\npath = os.getenv(\"PATH\")\nelse\nif os.is(\"macosx\") then\nformats = { \"lib%s.dylib\", \"%s.dylib\" }\npath = os.getenv(\"DYLD_LIBRARY_PATH\")\nelse\nformats = { \"lib%s.so\", \"%s.so\" }\np"
- "ath = os.getenv(\"LD_LIBRARY_PATH\") or \"\"\nfor _, v in ipairs(parse_ld_so_conf(\"/etc/ld.so.conf\")) do\npath = path .. \":\" .. v\nend\nend\ntable.insert(formats, \"%s\")\npath = path or \"\"\nif os.is64bit() then\npath = path .. \":/lib64:/usr/lib64/:usr/local/lib64\"\nend\npath = path .. \":/lib:/usr/lib:/usr/local/lib\"\nend\nfor _, fmt in ipairs(formats) do\nlocal name = string.format(fmt, libname)\nlocal result = os.pathsearch(name, path)\nif result then return result end\nend\nend\nfunction os.get()\nreturn _OPTIONS.os or _OS\nend\nfunction os.is(id)\nreturn (os.get():lower() == id:lower())\nend\nlocal _64BitHostTypes = {\n\"x86_64\",\n\"ia64\",\n\"amd64\",\n\"ppc64\",\n\"powerpc64\",\n\"sparc64\"\n}\nfunction os.is64bit()\nif (os._is64bit()) then\nreturn true\nend\nlocal arch\nif _OS == \"windows\" then\narch = os.getenv(\"PROCESSOR_ARCHITECTURE\")\nelseif _OS == \"macosx\" then\narch = os.outputof(\"echo $HOSTTYPE\")\nelse\narch = os.outputof(\"uname -m\")\nend\narch = arch:lower()\nfor _, hosttype"
- " in ipairs(_64BitHostTypes) do\nif arch:find(hosttype) then\nreturn true\nend\nend\nreturn false\nend\nlocal function domatch(result, mask, wantfiles)\nif mask:startswith(\"./\") then\nmask = mask:sub(3)\nend\nlocal basedir = mask\nlocal starpos = mask:find(\"%*\")\nif starpos then\nbasedir = basedir:sub(1, starpos - 1)\nend\nbasedir = path.getdirectory(basedir)\nif (basedir == \".\") then basedir = \"\" end\nlocal recurse = mask:find(\"**\", nil, true)\nmask = path.wildcards(mask)\nlocal function matchwalker(basedir)\nlocal wildcard = path.join(basedir, \"*\")\nlocal m = os.matchstart(wildcard)\nwhile (os.matchnext(m)) do\nlocal isfile = os.matchisfile(m)\nif ((wantfiles and isfile) or (not wantfiles and not isfile)) then\nlocal fname = path.join(basedir, os.matchname(m))\nif fname:match(mask) == fname then\ntable.insert(result, fname)\nend\nend\nend\nos.matchdone(m)\nif recurse then\nm = os.matchstart(wildcard)\nwhile (os.matchnext(m)) do\nif not os.matchisfile(m) then\nlocal dirname = os.matchname(m)\nmatch"
- "walker(path.join(basedir, dirname))\nend\nend\nos.matchdone(m)\nend\nend\nmatchwalker(basedir)\nend\nfunction os.matchdirs(...)\nlocal arg={...}\nlocal result = { }\nfor _, mask in ipairs(arg) do\ndomatch(result, mask, false)\nend\nreturn result\nend\nfunction os.matchfiles(...)\nlocal arg={...}\nlocal result = { }\nfor _, mask in ipairs(arg) do\ndomatch(result, mask, true)\nend\nreturn result\nend\nlocal builtin_mkdir = os.mkdir\nfunction os.mkdir(p)\nlocal dir = iif(p:startswith(\"/\"), \"/\", \"\")\nfor part in p:gmatch(\"[^/]+\") do\ndir = dir .. part\nif (part ~= \"\" and not path.isabsolute(part) and not os.isdir(dir)) then\nlocal ok, err = builtin_mkdir(dir)\nif (not ok) then\nreturn nil, err\nend\nend\ndir = dir .. \"/\"\nend\nreturn true\nend\nfunction os.outputof(cmd)\nlocal pipe = io.popen(cmd)\nlocal result = pipe:read('*a')\npipe:close()\nreturn result\nend\nlocal builtin_rmdir = os.rmdir\nfunction os.rmdir(p)\nlocal dirs = os.matchdirs(p .. \"/*\")\nfor _, dname in ipairs(dirs) do\nos.rmdir(dname"
- ")\nend\nlocal files = os.matchfiles(p .. \"/*\")\nfor _, fname in ipairs(files) do\nos.remove(fname)\nend\nbuiltin_rmdir(p)\nend\n",
+ "ath = os.getenv(\"LD_LIBRARY_PATH\") or \"\"\nfor _, v in ipairs(parse_ld_so_conf(\"/etc/ld.so.conf\")) do\npath = path .. \":\" .. v\nend\nend\ntable.insert(formats, \"%s\")\npath = path or \"\"\nif os.is64bit() then\npath = path .. \":/lib64:/usr/lib64/:usr/local/lib64\"\nend\npath = path .. \":/lib:/usr/lib:/usr/local/lib\"\nend\nfor _, fmt in ipairs(formats) do\nlocal name = string.format(fmt, libname)\nlocal result = os.pathsearch(name, path)\nif result then return result end\nend\nend\nfunction os.get()\nreturn _OPTIONS.os or _OS\nend\nfunction os.is(id)\nreturn (os.get():lower() == id:lower())\nend\nlocal _64BitHostTypes = {\n\"x86_64\",\n\"ia64\",\n\"amd64\",\n\"ppc64\",\n\"powerpc64\",\n\"sparc64\"\n}\nfunction os.is64bit()\nif (os._is64bit()) then\nreturn true\nend\nlocal arch = \"\"\nif _OS == \"windows\" then\narch = os.getenv(\"PROCESSOR_ARCHITECTURE\")\nelseif _OS == \"macosx\" then\narch = os.outputof(\"echo $HOSTTYPE\")\nelse\narch = os.outputof(\"uname -m\")\nend\nif nil ~= arch then\narch = a"
+ "rch:lower()\nfor _, hosttype in ipairs(_64BitHostTypes) do\nif arch:find(hosttype) then\nreturn true\nend\nend\nend\nreturn false\nend\nlocal function domatch(result, mask, wantfiles)\nif mask:startswith(\"./\") then\nmask = mask:sub(3)\nend\nlocal basedir = mask\nlocal starpos = mask:find(\"%*\")\nif starpos then\nbasedir = basedir:sub(1, starpos - 1)\nend\nbasedir = path.getdirectory(basedir)\nif (basedir == \".\") then basedir = \"\" end\nlocal recurse = mask:find(\"**\", nil, true)\nmask = path.wildcards(mask)\nlocal function matchwalker(basedir)\nlocal wildcard = path.join(basedir, \"*\")\nlocal m = os.matchstart(wildcard)\nwhile (os.matchnext(m)) do\nlocal isfile = os.matchisfile(m)\nif ((wantfiles and isfile) or (not wantfiles and not isfile)) then\nlocal fname = path.join(basedir, os.matchname(m))\nif fname:match(mask) == fname then\ntable.insert(result, fname)\nend\nend\nend\nos.matchdone(m)\nif recurse then\nm = os.matchstart(wildcard)\nwhile (os.matchnext(m)) do\nif not os.matchisfile(m) then\nlocal"
+ " dirname = os.matchname(m)\nmatchwalker(path.join(basedir, dirname))\nend\nend\nos.matchdone(m)\nend\nend\nmatchwalker(basedir)\nend\nfunction os.matchdirs(...)\nlocal arg={...}\nlocal result = { }\nfor _, mask in ipairs(arg) do\ndomatch(result, mask, false)\nend\nreturn result\nend\nfunction os.matchfiles(...)\nlocal arg={...}\nlocal result = { }\nfor _, mask in ipairs(arg) do\ndomatch(result, mask, true)\nend\nreturn result\nend\nlocal builtin_mkdir = os.mkdir\nfunction os.mkdir(p)\nlocal dir = iif(p:startswith(\"/\"), \"/\", \"\")\nfor part in p:gmatch(\"[^/]+\") do\ndir = dir .. part\nif (part ~= \"\" and not path.isabsolute(part) and not os.isdir(dir)) then\nlocal ok, err = builtin_mkdir(dir)\nif (not ok) then\nreturn nil, err\nend\nend\ndir = dir .. \"/\"\nend\nreturn true\nend\nfunction os.outputof(cmd)\nlocal pipe = io.popen(cmd)\nlocal result = pipe:read('*a')\npipe:close()\nreturn result\nend\nlocal builtin_rmdir = os.rmdir\nfunction os.rmdir(p)\nlocal dirs = os.matchdirs(p .. \"/*\")\nfor _, dname i"
+ "n ipairs(dirs) do\nos.rmdir(dname)\nend\nlocal files = os.matchfiles(p .. \"/*\")\nfor _, fname in ipairs(files) do\nos.remove(fname)\nend\nbuiltin_rmdir(p)\nend\n",
/* base/path.lua */
"function path.getbasename(p)\nlocal name = path.getname(p)\nlocal i = name:findlast(\".\", true)\nif (i) then\nreturn name:sub(1, i - 1)\nelse\nreturn name\nend\nend\nfunction path.removeext(name)\nlocal i = name:findlast(\".\", true)\nif (i) then\nreturn name:sub(1, i - 1)\nelse\nreturn name\nend\nend\nfunction path.getdirectory(p)\nlocal i = p:findlast(\"/\", true)\nif (i) then\nif i > 1 then i = i - 1 end\nreturn p:sub(1, i)\nelse\nreturn \".\"\nend\nend\nfunction path.getdrive(p)\nlocal ch1 = p:sub(1,1)\nlocal ch2 = p:sub(2,2)\nif ch2 == \":\" then\nreturn ch1\nend\nend\nfunction path.getextension(p)\nlocal i = p:findlast(\".\", true)\nif (i) then\nreturn p:sub(i)\nelse\nreturn \"\"\nend\nend\nfunction path.getname(p)\nlocal i = p:findlast(\"[/\\\\]\")\nif (i) then\nreturn p:sub(i + 1)\nelse\nreturn p\nend\nend\nfunction path.getcommonbasedir(a, b)\na = path.getdirectory(a)..'/'\nb = path.getdirectory(b)..'/'\nlocal idx = 0\nwhile (true) do\nlocal tst = a:find('/', idx + 1, true)\nif tst then\nif a:sub(1,t"
- "st) == b:sub(1,tst) then\nidx = tst\nelse\nbreak\nend\nelse\nbreak\nend\nend\nlocal result = ''\nif idx > 1 then\nresult = a:sub(1, idx - 1)-- Remove the trailing slash to be consistent with other functions.\nend\nreturn result\nend\nfunction path.hasextension(fname, extensions)\nlocal fext = path.getextension(fname):lower()\nif type(extensions) == \"table\" then\nfor _, extension in pairs(extensions) do\nif fext == extension then\nreturn true\nend\nend\nreturn false\nelse\nreturn (fext == extensions)\nend\nend\nfunction path.iscfile(fname)\nreturn path.hasextension(fname, { \".c\", \".m\" })\nend\nfunction path.iscppfile(fname)\nreturn path.hasextension(fname, { \".cc\", \".cpp\", \".cxx\", \".c\", \".m\", \".mm\" })\nend\nfunction path.iscxfile(fname)\nreturn path.hasextension(fname, \".cx\")\nend\nfunction path.isobjcfile(fname)\nreturn path.hasextension(fname, { \".m\", \".mm\" })\nend\nfunction path.iscppheader(fname)\nreturn path.hasextension(fname, { \".h\", \".hh\", \".hpp\", \".hxx\" })\nend\nfunction"
- " path.isappxmanifest(fname)\nreturn path.hasextension(fname, \".appxmanifest\")\nend\nfunction path.isnatvis(fname)\nreturn path.hasextension(fname, \".natvis\")\nend\nfunction path.isasmfile(fname)\nreturn path.hasextension(fname, { \".asm\", \".s\", \".S\" })\nend\nfunction path.isvalafile(fname)\nreturn path.hasextension(fname, \".vala\")\nend\nfunction path.isswiftfile(fname)\nreturn path.hasextension(fname, \".swift\")\nend\nfunction path.issourcefile(fname)\nreturn path.iscfile(fname)\nor path.iscppfile(fname)\nor path.iscxfile(fname)\nor path.isasmfile(fname)\nor path.isvalafile(fname)\nor path.isswiftfile(fname)\nend\nfunction path.issourcefilevs(fname)\nreturn path.hasextension(fname, { \".cc\", \".cpp\", \".cxx\", \".c\" })\nor path.iscxfile(fname)\nend\nfunction path.isresourcefile(fname)\nreturn path.hasextension(fname, \".rc\")\nend\nfunction path.isimagefile(fname)\nlocal extensions = { \".png\" }\nlocal ext = path.getextension(fname):lower()\nreturn table.contains(extensions, ext)\nend\nfunction"
- " path.join(...)\nlocal arg={...}\nlocal numargs = select(\"#\", ...)\nif numargs == 0 then\nreturn \"\";\nend\nlocal allparts = {}\nfor i = numargs, 1, -1 do\nlocal part = select(i, ...)\nif part and #part > 0 and part ~= \".\" then\nwhile part:endswith(\"/\") do\npart = part:sub(1, -2)\nend\ntable.insert(allparts, 1, part)\nif path.isabsolute(part) then\nbreak\nend\nend\nend\nreturn table.concat(allparts, \"/\")\nend\nfunction path.rebase(p, oldbase, newbase)\np = path.getabsolute(path.join(oldbase, p))\np = path.getrelative(newbase, p)\nreturn p\nend\nfunction path.translate(p, sep)\nif (type(p) == \"table\") then\nlocal result = { }\nfor _, value in ipairs(p) do\ntable.insert(result, path.translate(value))\nend\nreturn result\nelse\nif (not sep) then\nif (os.is(\"windows\")) then\nsep = \"\\\\\"\nelse\nsep = \"/\"\nend\nend\nlocal result = p:gsub(\"[/\\\\]\", sep)\nreturn result\nend\nend\nfunction path.wildcards(pattern)\npattern = pattern:gsub(\"([%+%.%-%^%$%(%)%%])\", \"%%%1\")\npattern = pattern:gsub(\""
- "%*%*\", \"\\001\")\npattern = pattern:gsub(\"%*\", \"\\002\")\npattern = pattern:gsub(\"\\001\", \".*\")\npattern = pattern:gsub(\"\\002\", \"[^/]*\")\nreturn pattern\nend\nfunction path.trimdots(p)\nlocal changed\nrepeat\nchanged = true\nif p:startswith(\"./\") then\np = p:sub(3)\nelseif p:startswith(\"../\") then\np = p:sub(4)\nelse\nchanged = false\nend\nuntil not changed\nreturn p\nend\nfunction path.rebase(p, oldbase, newbase)\np = path.getabsolute(path.join(oldbase, p))\np = path.getrelative(newbase, p)\nreturn p\nend\nfunction path.replaceextension(p, newext)\nlocal ext = path.getextension(p)\nif not ext then\nreturn p\nend\nif #newext > 0 and not newext:findlast(\".\", true) then\nnewext = \".\"..newext\nend\nreturn p:match(\"^(.*)\"..ext..\"$\")..newext\nend\n",
+ "st) == b:sub(1,tst) then\nidx = tst\nelse\nbreak\nend\nelse\nbreak\nend\nend\nlocal result = ''\nif idx > 1 then\nresult = a:sub(1, idx - 1)-- Remove the trailing slash to be consistent with other functions.\nend\nreturn result\nend\nfunction path.hasextension(fname, extensions)\nlocal fext = path.getextension(fname):lower()\nif type(extensions) == \"table\" then\nfor _, extension in pairs(extensions) do\nif fext == extension then\nreturn true\nend\nend\nreturn false\nelse\nreturn (fext == extensions)\nend\nend\nfunction path.iscfile(fname)\nreturn path.hasextension(fname, { \".c\", \".m\" })\nend\nfunction path.iscppfile(fname)\nreturn path.hasextension(fname, { \".cc\", \".cpp\", \".cxx\", \".c++\", \".c\", \".m\", \".mm\" })\nend\nfunction path.iscxfile(fname)\nreturn path.hasextension(fname, \".cx\")\nend\nfunction path.isobjcfile(fname)\nreturn path.hasextension(fname, { \".m\", \".mm\" })\nend\nfunction path.iscppheader(fname)\nreturn path.hasextension(fname, { \".h\", \".hh\", \".hpp\", \".hxx\" })\nend"
+ "\nfunction path.isappxmanifest(fname)\nreturn path.hasextension(fname, \".appxmanifest\")\nend\nfunction path.isandroidbuildfile(fname)\nreturn path.getname(fname) == \"AndroidManifest.xml\"\nend\nfunction path.isnatvis(fname)\nreturn path.hasextension(fname, \".natvis\")\nend\nfunction path.isasmfile(fname)\nreturn path.hasextension(fname, { \".asm\", \".s\", \".S\" })\nend\nfunction path.isvalafile(fname)\nreturn path.hasextension(fname, \".vala\")\nend\nfunction path.isswiftfile(fname)\nreturn path.hasextension(fname, \".swift\")\nend\nfunction path.issourcefile(fname)\nreturn path.iscfile(fname)\nor path.iscppfile(fname)\nor path.iscxfile(fname)\nor path.isasmfile(fname)\nor path.isvalafile(fname)\nor path.isswiftfile(fname)\nend\nfunction path.issourcefilevs(fname)\nreturn path.hasextension(fname, { \".cc\", \".cpp\", \".cxx\", \".c++\", \".c\" })\nor path.iscxfile(fname)\nend\nfunction path.isobjectfile(fname)\nreturn path.hasextension(fname, { \".o\", \".obj\" })\nend\nfunction path.isresourcefile(fname"
+ ")\nreturn path.hasextension(fname, \".rc\")\nend\nfunction path.isimagefile(fname)\nlocal extensions = { \".png\" }\nlocal ext = path.getextension(fname):lower()\nreturn table.contains(extensions, ext)\nend\nfunction path.join(...)\nlocal arg={...}\nlocal numargs = select(\"#\", ...)\nif numargs == 0 then\nreturn \"\";\nend\nlocal allparts = {}\nfor i = numargs, 1, -1 do\nlocal part = select(i, ...)\nif part and #part > 0 and part ~= \".\" then\nwhile part:endswith(\"/\") do\npart = part:sub(1, -2)\nend\ntable.insert(allparts, 1, part)\nif path.isabsolute(part) then\nbreak\nend\nend\nend\nreturn table.concat(allparts, \"/\")\nend\nfunction path.rebase(p, oldbase, newbase)\np = path.getabsolute(path.join(oldbase, p))\np = path.getrelative(newbase, p)\nreturn p\nend\nfunction path.translate(p, sep)\nif (type(p) == \"table\") then\nlocal result = { }\nfor _, value in ipairs(p) do\ntable.insert(result, path.translate(value))\nend\nreturn result\nelse\nif (not sep) then\nif (os.is(\"windows\")) then\nsep = \"\\\\\""
+ "\nelse\nsep = \"/\"\nend\nend\nlocal result = p:gsub(\"[/\\\\]\", sep)\nreturn result\nend\nend\nfunction path.wildcards(pattern)\npattern = pattern:gsub(\"([%+%.%-%^%$%(%)%%])\", \"%%%1\")\npattern = pattern:gsub(\"%*%*\", \"\\001\")\npattern = pattern:gsub(\"%*\", \"\\002\")\npattern = pattern:gsub(\"\\001\", \".*\")\npattern = pattern:gsub(\"\\002\", \"[^/]*\")\nreturn pattern\nend\nfunction path.trimdots(p)\nlocal changed\nrepeat\nchanged = true\nif p:startswith(\"./\") then\np = p:sub(3)\nelseif p:startswith(\"../\") then\np = p:sub(4)\nelse\nchanged = false\nend\nuntil not changed\nreturn p\nend\nfunction path.rebase(p, oldbase, newbase)\np = path.getabsolute(path.join(oldbase, p))\np = path.getrelative(newbase, p)\nreturn p\nend\nfunction path.replaceextension(p, newext)\nlocal ext = path.getextension(p)\nif not ext then\nreturn p\nend\nif #newext > 0 and not newext:findlast(\".\", true) then\nnewext = \".\"..newext\nend\nreturn p:match(\"^(.*)\"..ext..\"$\")..newext\nend\n",
/* base/string.lua */
"function string.explode(s, pattern, plain)\nif (pattern == '') then return false end\nlocal pos = 0\nlocal arr = { }\nfor st,sp in function() return s:find(pattern, pos, plain) end do\ntable.insert(arr, s:sub(pos, st-1))\npos = sp + 1\nend\ntable.insert(arr, s:sub(pos))\nreturn arr\nend\nfunction string.findlast(s, pattern, plain)\nlocal curr = 0\nlocal term = nil\nrepeat\nlocal next, nextterm = s:find(pattern, curr + 1, plain)\nif (next) then\ncurr = next\nterm = nextterm\nend\nuntil (not next)\nif (curr > 0) then\nreturn curr, term\nend\nend\nfunction string.startswith(haystack, needle)\nreturn (haystack:find(needle, 1, true) == 1)\nend\nfunction string.trim(s)\nreturn (s:gsub(\"^%s*(.-)%s*$\", \"%1\"))\nend\n",
/* base/table.lua */
"function table.contains(t, value)\nfor _, v in pairs(t) do\nif v == value then return true end\nend\nreturn false\nend\nfunction table.icontains(t, value)\nfor _, v in ipairs(t) do\nif v == value then return true end\nend\nreturn false\nend\nfunction table.deepcopy(object)\nlocal seen = {}\nlocal function copy(object)\nif type(object) ~= \"table\" then\nreturn object\nelseif seen[object] then\nreturn seen[object]\nend\nlocal clone = {}\nseen[object] = clone\nfor key, value in pairs(object) do\nclone[key] = copy(value)\nend\nsetmetatable(clone, getmetatable(object))\nreturn clone\nend\nreturn copy(object)\nend\nfunction table.extract(arr, fname)\nlocal result = { }\nfor _,v in ipairs(arr) do\ntable.insert(result, v[fname])\nend\nreturn result\nend\nfunction table.flatten(arr)\nlocal result = { }\nlocal function flatten(arr)\nfor _, v in ipairs(arr) do\nif type(v) == \"table\" then\nflatten(v)\nelse\ntable.insert(result, v)\nend\nend\nend\nflatten(arr)\nreturn result\nend\nfunction table.implode(arr, before, aft"
- "er, between)\nlocal result = \"\"\nfor _,v in ipairs(arr) do\nif (result ~= \"\" and between) then\nresult = result .. between\nend\nresult = result .. before .. v .. after\nend\nreturn result\nend\nfunction table.insertflat(tbl, values)\nif type(values) == \"table\" then\nfor _, value in ipairs(values) do\ntable.insertflat(tbl, value)\nend\nelse\ntable.insert(tbl, values)\nend\nend\nfunction table.isempty(t)\nreturn next(t) == nil\nend\nfunction table.join(...)\nlocal arg={...}\nlocal result = { }\nfor _,t in ipairs(arg) do\nif type(t) == \"table\" then\nfor _,v in ipairs(t) do\ntable.insert(result, v)\nend\nelse\ntable.insert(result, t)\nend\nend\nreturn result\nend\nfunction table.keys(tbl)\nlocal keys = {}\nfor k, _ in pairs(tbl) do\ntable.insert(keys, k)\nend\nreturn keys\nend\nfunction table.merge(...)\nlocal arg={...}\nlocal result = { }\nfor _,t in ipairs(arg) do\nif type(t) == \"table\" then\nfor k,v in pairs(t) do\nresult[k] = v\nend\nelse\nerror(\"invalid value\")\nend\nend\nreturn result\nend\nfunc"
- "tion table.translate(arr, translation)\nlocal result = { }\nfor _, value in ipairs(arr) do\nlocal tvalue\nif type(translation) == \"function\" then\ntvalue = translation(value)\nelse\ntvalue = translation[value]\nend\nif (tvalue) then\ntable.insert(result, tvalue)\nend\nend\nreturn result\nend\nfunction table.reverse(arr)\nfor i=1, math.floor(#arr / 2) do\narr[i], arr[#arr - i + 1] = arr[#arr - i + 1], arr[i]\nend\nreturn arr\nend\nfunction table.arglist(arg, value)\nif #value > 0 then\nlocal args = {}\nfor _, val in ipairs(value) do\ntable.insert(args, string.format(\"%s %s\", arg, val))\nend\nreturn table.concat(args, \" \")\nelse\nreturn \"\"\nend\nend\n",
+ "er, between)\nlocal result = \"\"\nfor _,v in ipairs(arr) do\nif (result ~= \"\" and between) then\nresult = result .. between\nend\nresult = result .. before .. v .. after\nend\nreturn result\nend\nfunction table.insertflat(tbl, values)\nif type(values) == \"table\" then\nfor _, value in ipairs(values) do\ntable.insertflat(tbl, value)\nend\nelse\ntable.insert(tbl, values)\nend\nend\nfunction table.isempty(t)\nreturn next(t) == nil\nend\nfunction table.join(...)\nlocal arg={...}\nlocal result = { }\nfor _,t in ipairs(arg) do\nif type(t) == \"table\" then\nfor _,v in ipairs(t) do\ntable.insert(result, v)\nend\nelse\ntable.insert(result, t)\nend\nend\nreturn result\nend\nfunction table.keys(tbl)\nlocal keys = {}\nfor k, _ in pairs(tbl) do\ntable.insert(keys, k)\nend\nreturn keys\nend\nfunction table.sortedpairs(t)\nlocal keys = table.keys(t)\nlocal i = 0\ntable.sort(keys)\nreturn function()\ni = i + 1\nif keys[i] == nil then\nreturn nil\nend\nreturn keys[i], t[keys[i]]\nend\nend\nfunction table.merge(...)\nlocal"
+ " arg={...}\nlocal result = { }\nfor _,t in ipairs(arg) do\nif type(t) == \"table\" then\nfor k,v in pairs(t) do\nresult[k] = v\nend\nelse\nerror(\"invalid value\")\nend\nend\nreturn result\nend\nfunction table.translate(arr, translation)\nlocal result = { }\nfor _, value in ipairs(arr) do\nlocal tvalue\nif type(translation) == \"function\" then\ntvalue = translation(value)\nelse\ntvalue = translation[value]\nend\nif (tvalue) then\ntable.insert(result, tvalue)\nend\nend\nreturn result\nend\nfunction table.reverse(arr)\nfor i=1, math.floor(#arr / 2) do\narr[i], arr[#arr - i + 1] = arr[#arr - i + 1], arr[i]\nend\nreturn arr\nend\nfunction table.arglist(arg, value)\nif #value > 0 then\nlocal args = {}\nfor _, val in ipairs(value) do\ntable.insert(args, string.format(\"%s %s\", arg, val))\nend\nreturn table.concat(args, \" \")\nelse\nreturn \"\"\nend\nend\n",
/* base/io.lua */
- "io.eol = \"\\n\"\nio.indent = \"\\t\"\nio.indentLevel = 0\nlocal function _escaper(v) return v end\n_esc = _escaper\nfunction io.capture()\nio.captured = ''\nend\nfunction io.endcapture()\nlocal captured = io.captured\nio.captured = nil\nreturn captured\nend\nlocal builtin_open = io.open\nfunction io.open(fname, mode)\nif (mode) then\nif (mode:find(\"w\")) then\nlocal dir = path.getdirectory(fname)\nok, err = os.mkdir(dir)\nif (not ok) then\nerror(err, 0)\nend\nend\nend\nreturn builtin_open(fname, mode)\nend\nfunction io.printf(msg, ...)\nlocal arg={...}\nif not io.eol then\nio.eol = \"\\n\"\nend\nif not io.indent then\nio.indent = \"\\t\"\nend\nif type(msg) == \"number\" then\ns = string.rep(io.indent, msg) .. string.format(table.unpack(arg))\nelse\ns = string.format(msg, table.unpack(arg))\nend\nif io.captured then\nio.captured = io.captured .. s .. io.eol\nelse\nio.write(s)\nio.write(io.eol)\nend\nend\nfunction io.xprintf(msg, ...)\nlocal arg = {...}\nfor i = 1, #arg do\narg[i] = io.esc(arg[i])"
- "\nend\nio.printf(msg, unpack(arg))\nend\nfunction io.esc(value)\nif type(value) == \"table\" then\nlocal result = {}\nlocal n = #value\nfor i = 1, n do\ntable.insert(result, io.esc(value[i]))\nend\nreturn result\nend\nreturn _esc(value or \"\")\nend\nfunction io.escaper(func)\n_esc = func or _escaper\nend\n_p = io.printf\n_x = io.xprintf\n",
+ "io.eol = \"\\n\"\nio.indent = \"\\t\"\nio.indentLevel = 0\nlocal function _escaper(v) return v end\n_esc = _escaper\nfunction io.capture()\nlocal prev = io.captured\nio.captured = ''\nreturn prev\nend\nfunction io.endcapture(restore)\nlocal captured = io.captured\nio.captured = restore\nreturn captured\nend\nlocal builtin_open = io.open\nfunction io.open(fname, mode)\nif (mode) then\nif (mode:find(\"w\")) then\nlocal dir = path.getdirectory(fname)\nok, err = os.mkdir(dir)\nif (not ok) then\nerror(err, 0)\nend\nend\nend\nreturn builtin_open(fname, mode)\nend\nfunction io.printf(msg, ...)\nlocal arg={...}\nif not io.eol then\nio.eol = \"\\n\"\nend\nif not io.indent then\nio.indent = \"\\t\"\nend\nif type(msg) == \"number\" then\ns = string.rep(io.indent, msg) .. string.format(table.unpack(arg))\nelse\ns = string.format(msg, table.unpack(arg))\nend\nif io.captured then\nio.captured = io.captured .. s .. io.eol\nelse\nio.write(s)\nio.write(io.eol)\nend\nend\nfunction io.xprintf(msg, ...)\nlocal arg = "
+ "{...}\nfor i = 1, #arg do\narg[i] = io.esc(arg[i])\nend\nio.printf(msg, unpack(arg))\nend\nfunction io.esc(value)\nif type(value) == \"table\" then\nlocal result = {}\nlocal n = #value\nfor i = 1, n do\ntable.insert(result, io.esc(value[i]))\nend\nreturn result\nend\nreturn _esc(value or \"\")\nend\nfunction io.escaper(func)\n_esc = func or _escaper\nend\n_p = io.printf\n_x = io.xprintf\n",
/* base/globals.lua */
- "premake = { }\npremake.platforms =\n{\nNative =\n{\ncfgsuffix = \"\",\n},\nx32 =\n{\ncfgsuffix = \"32\",\n},\nx64 =\n{\ncfgsuffix = \"64\",\n},\nUniversal =\n{\ncfgsuffix = \"univ\",\n},\nUniversal32 =\n{\ncfgsuffix = \"univ32\",\n},\nUniversal64 =\n{\ncfgsuffix = \"univ64\",\n},\nPS3 =\n{\ncfgsuffix = \"ps3\",\niscrosscompiler = true,\nnosharedlibs = true,\nnamestyle = \"PS3\",\n},\nWiiDev =\n{\ncfgsuffix = \"wii\",\niscrosscompiler = true,\nnamestyle = \"PS3\",\n},\nXbox360 =\n{\ncfgsuffix = \"xbox360\",\niscrosscompiler = true,\nnamestyle = \"windows\",\n},\nPowerPC =\n{\ncfgsuffix = \"ppc\",\niscrosscompiler = true,\n},\nARM =\n{\ncfgsuffix = \"ARM\",\niscrosscompiler = true,\n},\nOrbis =\n{\ncfgsuffix = \"orbis\",\niscrosscompiler = true,\nnamestyle = \"Orbis\",\n},\nDurango =\n{\ncfgsuffix = \"durango\",\niscrosscompiler = true,\nnosharedlibs = true,\nnamestyle = \"windows\",\n},\n}\nlocal bu"
- "iltin_dofile = dofile\nfunction dofile(fname)\nlocal oldcwd = os.getcwd()\nlocal oldfile = _SCRIPT\nif (not os.isfile(fname)) then\nlocal path = os.pathsearch(fname, _OPTIONS[\"scripts\"], os.getenv(\"PREMAKE_PATH\"))\nif (path) then\nfname = path..\"/\"..fname\nend\nend\n_SCRIPT = path.getabsolute(fname)\nlocal newcwd = path.getdirectory(_SCRIPT)\nos.chdir(newcwd)\nlocal a, b, c, d, e, f = builtin_dofile(_SCRIPT)\n_SCRIPT = oldfile\nos.chdir(oldcwd)\nreturn a, b, c, d, e, f\nend\nfunction iif(expr, trueval, falseval)\nif (expr) then\nreturn trueval\nelse\nreturn falseval\nend\nend\nfunction include(fname)\nlocal dir, name = premake.findDefaultScript(fname, false)\nif dir ~= nil then\nreturn dofile(dir .. \"/\" .. name)\nend\nreturn nil\nend\nfunction printf(msg, ...)\nlocal arg={...}\nprint(string.format(msg, table.unpack(arg)))\nend\nfunction typex(t)\nlocal mt = getmetatable(t)\nif (mt) then\nif (mt.__type) then\nreturn mt.__type\nend\nend\nreturn type(t)\nend\n",
+ "premake = { }\npremake.platforms =\n{\nNative =\n{\ncfgsuffix = \"\",\n},\nx32 =\n{\ncfgsuffix = \"32\",\n},\nx64 =\n{\ncfgsuffix = \"64\",\n},\nUniversal =\n{\ncfgsuffix = \"univ\",\n},\nUniversal32 =\n{\ncfgsuffix = \"univ32\",\n},\nUniversal64 =\n{\ncfgsuffix = \"univ64\",\n},\nPS3 =\n{\ncfgsuffix = \"ps3\",\niscrosscompiler = true,\nnosharedlibs = true,\nnamestyle = \"PS3\",\n},\nWiiDev =\n{\ncfgsuffix = \"wii\",\niscrosscompiler = true,\nnamestyle = \"PS3\",\n},\nXbox360 =\n{\ncfgsuffix = \"xbox360\",\niscrosscompiler = true,\nnamestyle = \"windows\",\n},\nPowerPC =\n{\ncfgsuffix = \"ppc\",\niscrosscompiler = true,\n},\nARM =\n{\ncfgsuffix = \"ARM\",\niscrosscompiler = true,\n},\nOrbis =\n{\ncfgsuffix = \"orbis\",\niscrosscompiler = true,\nnamestyle = \"Orbis\",\n},\nDurango =\n{\ncfgsuffix = \"durango\",\niscrosscompiler = true,\nnosharedlibs = true,\nnamestyle = \"windows\",\n},\nTegraAndroi"
+ "d =\n{\ncfgsuffix = \"tegraandroid\",\niscrosscompiler = true,\nnamestyle = \"TegraAndroid\",\n},\nNX32 =\n{\ncfgsuffix = \"nx32\",\niscrosscompiler = true,\nnamestyle = \"NX\",\n},\nNX64 =\n{\ncfgsuffix = \"nx64\",\niscrosscompiler = true,\nnamestyle = \"NX\",\n},\nEmscripten =\n{\ncfgsuffix = \"emscripten\",\niscrosscompiler = true,\nnosharedlibs = true,\nnamestyle = \"Emscripten\",\n},\n}\nlocal builtin_dofile = dofile\nfunction dofile(fname)\nlocal oldcwd = os.getcwd()\nlocal oldfile = _SCRIPT\nif (not os.isfile(fname)) then\nlocal path = os.pathsearch(fname, _OPTIONS[\"scripts\"], os.getenv(\"PREMAKE_PATH\"))\nif (path) then\nfname = path..\"/\"..fname\nend\nend\n_SCRIPT = path.getabsolute(fname)\nlocal newcwd = path.getdirectory(_SCRIPT)\nos.chdir(newcwd)\nlocal a, b, c, d, e, f = builtin_dofile(_SCRIPT)\n_SCRIPT = oldfile\nos.chdir(oldcwd)\nreturn a, b, c, d, e, f\nend\nfunction iif(expr, trueval, falseval)\nif (expr) then\nreturn trueval\nelse\nreturn "
+ "falseval\nend\nend\nfunction include(fname)\nlocal dir, name = premake.findDefaultScript(fname, false)\nif dir ~= nil then\nreturn dofile(dir .. \"/\" .. name)\nend\nreturn nil\nend\nfunction printf(msg, ...)\nlocal arg={...}\nprint(string.format(msg, table.unpack(arg)))\nend\nfunction typex(t)\nlocal mt = getmetatable(t)\nif (mt) then\nif (mt.__type) then\nreturn mt.__type\nend\nend\nreturn type(t)\nend\n",
/* base/action.lua */
- "premake.action = { }\npremake.action.list = { }\nfunction premake.action.add(a)\nlocal missing\nfor _, field in ipairs({\"description\", \"trigger\"}) do\nif (not a[field]) then\nmissing = field\nend\nend\nif (missing) then\nerror(\"action needs a \" .. missing, 3)\nend\npremake.action.list[a.trigger] = a\nend\nfunction premake.action.call(name)\nlocal a = premake.action.list[name]\nfor sln in premake.solution.each() do\nif a.onsolution then\na.onsolution(sln)\nend\nfor prj in premake.solution.eachproject(sln) do\nif a.onproject then\na.onproject(prj)\nend\nend\nend\nif a.execute then\na.execute()\nend\nend\nfunction premake.action.current()\nreturn premake.action.get(_ACTION)\nend\nfunction premake.action.get(name)\nreturn premake.action.list[name]\nend\nfunction premake.action.each()\nlocal keys = { }\nfor _, action in pairs(premake.action.list) do\ntable.insert(keys, action.trigger)\nend\ntable.sort(keys)\nlocal i = 0\nreturn function()\ni = i + 1\nreturn premake.action.list[keys[i]]\nend\nend\nfunction pre"
- "make.action.set(name)\n_ACTION = name\nlocal action = premake.action.get(name)\nif action then\n_OS = action.os or _OS\nend\nend\nfunction premake.action.supports(action, feature)\nif not action then\nreturn false\nend\nif action.valid_languages then\nif table.contains(action.valid_languages, feature) then\nreturn true\nend\nend\nif action.valid_kinds then\nif table.contains(action.valid_kinds, feature) then\nreturn true\nend\nend\nreturn false\nend\n",
+ "premake.action = { }\npremake.action.list = { }\nfunction premake.action.add(a)\nlocal missing\nfor _, field in ipairs({\"description\", \"trigger\"}) do\nif (not a[field]) then\nmissing = field\nend\nend\nif (missing) then\nerror(\"action needs a \" .. missing, 3)\nend\npremake.action.list[a.trigger] = a\nend\nfunction premake.action.call(name)\nlocal a = premake.action.list[name]\nfor sln in premake.solution.each() do\nif a.onsolution then\na.onsolution(sln)\nend\nif sln.postsolutioncallbacks then\nfor _,cb in ipairs(sln.postsolutioncallbacks) do\ncb(sln)\nend\nend\nfor prj in premake.solution.eachproject(sln) do\nif a.onproject then\na.onproject(prj)\nend\nif prj.postprojectcallbacks then\nfor _,cb in ipairs(prj.postprojectcallbacks) do\ncb(prj)\nend\nend\nend\nend\nif a.execute then\na.execute()\nend\nend\nfunction premake.action.current()\nreturn premake.action.get(_ACTION)\nend\nfunction premake.action.get(name)\nreturn premake.action.list[name]\nend\nfunction premake.action.each()\nlocal keys = { }\nfor"
+ " _, action in pairs(premake.action.list) do\ntable.insert(keys, action.trigger)\nend\ntable.sort(keys)\nlocal i = 0\nreturn function()\ni = i + 1\nreturn premake.action.list[keys[i]]\nend\nend\nfunction premake.action.set(name)\n_ACTION = name\nlocal action = premake.action.get(name)\nif action then\n_OS = action.os or _OS\nend\nend\nfunction premake.action.supports(action, feature)\nif not action then\nreturn false\nend\nif action.valid_languages then\nif table.contains(action.valid_languages, feature) then\nreturn true\nend\nend\nif action.valid_kinds then\nif table.contains(action.valid_kinds, feature) then\nreturn true\nend\nend\nreturn false\nend\n",
/* base/option.lua */
"premake.option = { }\npremake.option.list = { }\nfunction premake.option.add(opt)\nlocal missing\nfor _, field in ipairs({ \"description\", \"trigger\" }) do\nif (not opt[field]) then\nmissing = field\nend\nend\nif (missing) then\nerror(\"option needs a \" .. missing, 3)\nend\npremake.option.list[opt.trigger] = opt\nend\nfunction premake.option.get(name)\nreturn premake.option.list[name]\nend\nfunction premake.option.each()\nlocal keys = { }\nfor _, option in pairs(premake.option.list) do\ntable.insert(keys, option.trigger)\nend\ntable.sort(keys)\nlocal i = 0\nreturn function()\ni = i + 1\nreturn premake.option.list[keys[i]]\nend\nend\nfunction premake.option.validate(values)\nfor key, value in pairs(values) do\nlocal opt = premake.option.get(key)\nif (not opt) then\nreturn false, \"invalid option '\" .. key .. \"'\"\nend\nif (opt.value and value == \"\") then\nreturn false, \"no value specified for option '\" .. key .. \"'\"\nend\nif opt.allowed then\nlocal found = false\nfor _, match in ipairs(opt.allowed) d"
@@ -57,54 +58,61 @@ const char* builtin_scripts[] = {
"ntains(results, dep) then\ntable.insert(results, dep)\nend\nend\nend\nreturn results\nend\nfunction premake.project.getbasename(prjname, pattern)\nreturn pattern:gsub(\"%%%%\", prjname)\nend\nfunction premake.project.getfilename(prj, pattern)\nlocal fname = premake.project.getbasename(prj.name, pattern)\nfname = path.join(prj.location, fname)\nreturn path.getrelative(os.getcwd(), fname)\nend\n function premake.getlinks(cfg, kind, part)\nlocal result = iif (part == \"directory\" and kind == \"all\", cfg.libdirs, {})\nlocal cfgname = iif(cfg.name == cfg.project.name, \"\", cfg.name)\nlocal pathstyle = premake.getpathstyle(cfg)\nlocal namestyle = premake.getnamestyle(cfg)\nlocal function canlink(source, target)\nif (target.kind ~= \"SharedLib\" and target.kind ~= \"StaticLib\") then\nreturn false\nend\nif premake.iscppproject(source) then\nreturn premake.iscppproject(target)\nelseif premake.isdotnetproject(source) then\nreturn premake.isdotnetproject(target)\nelseif premake.isswiftproject(source) then\nreturn pre"
"make.isswiftproject(source) or premake.iscppproject(source)\nend\nend\nfor _, link in ipairs(cfg.links) do\nlocal item\nlocal prj = premake.findproject(link)\nif prj and kind ~= \"system\" then\nlocal prjcfg = premake.getconfig(prj, cfgname, cfg.platform)\nif kind == \"dependencies\" or canlink(cfg, prjcfg) then\nif (part == \"directory\") then\nitem = path.rebase(prjcfg.linktarget.directory, prjcfg.location, cfg.location)\nelseif (part == \"basename\") then\nitem = prjcfg.linktarget.basename\nelseif (part == \"fullpath\") then\nitem = path.rebase(prjcfg.linktarget.fullpath, prjcfg.location, cfg.location)\nelseif (part == \"object\") then\nitem = prjcfg\nend\nend\nelseif not prj and (kind == \"system\" or kind == \"all\") then\nif (part == \"directory\") then\nitem = path.getdirectory(link)\nelseif (part == \"fullpath\") then\nitem = link\nif namestyle == \"windows\" then\nif premake.iscppproject(cfg) then\nitem = item .. \".lib\"\nelseif premake.isdotnetproject(cfg) then\nitem = item .. \".dll\"\nend\nend\nel"
"seif part == \"name\" then\nitem = path.getname(link)\nelseif part == \"basename\" then\nitem = path.getbasename(link)\nelse\nitem = link\nend\nif item:find(\"/\", nil, true) then\nitem = path.getrelative(cfg.project.location, item)\nend\nend\nif item then\nif pathstyle == \"windows\" and part ~= \"object\" then\nitem = path.translate(item, \"\\\\\")\nend\nif not table.contains(result, item) then\ntable.insert(result, item)\nend\nend\nend\nreturn result\nend\nfunction premake.getnamestyle(cfg)\nreturn premake.platforms[cfg.platform].namestyle or premake.gettool(cfg).namestyle or \"posix\"\nend\nfunction premake.getpathstyle(cfg)\nif premake.action.current().os == \"windows\" then\nreturn \"windows\"\nelse\nreturn \"posix\"\nend\nend\nfunction premake.gettarget(cfg, direction, pathstyle, namestyle, system)\nif system == \"bsd\" then\nsystem = \"linux\"\nend\nlocal kind = cfg.kind\nif premake.iscppproject(cfg) then\nif (namestyle == \"windows\" or system == \"windows\")\nand kind == \"SharedLib\" and direction ="
- "= \"link\"\nand not cfg.flags.NoImportLib\nthen\nkind = \"StaticLib\"\nend\nif namestyle == \"posix\" and system == \"windows\" and kind ~= \"StaticLib\" then\nnamestyle = \"windows\"\nend\nend\nlocal field = \"build\"\nif direction == \"link\" and cfg.kind == \"SharedLib\" then\nfield = \"implib\"\nend\nlocal name = cfg[field..\"name\"] or cfg.targetname or cfg.project.name\nlocal dir = cfg[field..\"dir\"] or cfg.targetdir or path.getrelative(cfg.location, cfg.basedir)\nlocal subdir = cfg[field..\"subdir\"] or cfg.targetsubdir or \".\"\nlocal prefix = \"\"\nlocal suffix = \"\"\nlocal ext = \"\"\nlocal bundlepath, bundlename\ndir = path.join(dir, subdir)\nif namestyle == \"windows\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".exe\"\nelseif kind == \"SharedLib\" then\next = \".dll\"\nelseif kind == \"StaticLib\" then\next = \".lib\"\nend\nelseif namestyle == \"posix\" then\nif kind == \"WindowedApp\" and system == \"macosx\" then\nbundlename = name .. \".app\"\nbund"
- "lepath = path.join(dir, bundlename)\ndir = path.join(bundlepath, \"Contents/MacOS\")\nelseif (kind == \"ConsoleApp\" or kind == \"WindowedApp\") and system == \"os2\" then\next = \".exe\"\nelseif kind == \"SharedLib\" then\nprefix = \"lib\"\next = iif(system == \"macosx\", \".dylib\", \".so\")\nelseif kind == \"StaticLib\" then\nprefix = \"lib\"\next = \".a\"\nend\nelseif namestyle == \"PS3\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".elf\"\nelseif kind == \"StaticLib\" then\nprefix = \"lib\"\next = \".a\"\nend\nelseif namestyle == \"Orbis\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".elf\"\nelseif kind == \"StaticLib\" then\nprefix = \"lib\"\next = \".a\"\nelseif kind == \"SharedLib\" then\next = \".prx\"\nend\nend\nprefix = cfg[field..\"prefix\"] or cfg.targetprefix or prefix\nsuffix = cfg[field..\"suffix\"] or cfg.targetsuffix or suffix\next = cfg[field..\"extension\"] or cfg.targetextension or ext\nlocal result = { }\nresult.basename = nam"
- "e .. suffix\nresult.name = prefix .. name .. suffix .. ext\nresult.directory = dir\nresult.subdirectory = subdir\nresult.prefix = prefix\nresult.suffix = suffix\nresult.fullpath = path.join(result.directory, result.name)\nresult.bundlepath = bundlepath or result.fullpath\nif pathstyle == \"windows\" then\nresult.directory = path.translate(result.directory, \"\\\\\")\nresult.subdirectory = path.translate(result.subdirectory, \"\\\\\")\nresult.fullpath = path.translate(result.fullpath, \"\\\\\")\nend\nreturn result\nend\nfunction premake.gettool(cfg)\nif premake.iscppproject(cfg) then\nif _OPTIONS.cc then\nreturn premake[_OPTIONS.cc]\nend\nlocal action = premake.action.current()\nif action.valid_tools then\nreturn premake[action.valid_tools.cc[1]]\nend\nreturn premake.gcc\nelseif premake.isdotnetproject(cfg) then\nreturn premake.dotnet\nelseif premake.isswiftproject(cfg) then\nreturn premake.swift\nelse\nreturn premake.valac\nend\nend\nfunction premake.project.getvpath(prj, a"
- "bspath)\nlocal vpath = abspath\nlocal fname = path.getname(abspath)\nlocal max = abspath:len() - fname:len()\n \n -- First check for an exact match from the inverse vpaths\n if prj.inversevpaths and prj.inversevpaths[abspath] then\n return path.join(prj.inversevpaths[abspath], fname)\n end\n local matches = {}\nfor replacement, patterns in pairs(prj.vpaths or {}) do\nfor _, pattern in ipairs(patterns) do\nlocal i = abspath:find(path.wildcards(pattern))\nif i == 1 then\ni = pattern:find(\"*\", 1, true) or (pattern:len() + 1)\nlocal leaf\nif i < max then\nleaf = abspath:sub(i)\nelse\nleaf = fname\nend\nif leaf:startswith(\"/\") then\nleaf = leaf:sub(2)\nend\nlocal stem = \"\"\nif replacement:len() > 0 then\nstem, stars = replacement:gsub(\"%*\", \"\")\nif stars == 0 then\nleaf = path.getname(leaf)\nend\nelse\nleaf = path.getname(leaf)\nend\ntable.insert(matches, path.join(stem, leaf))\nend\nend\nend\n \n if #matches > 0 then\n -- for the sake"
- " of determinism, return the first alphabetically\n table.sort(matches)\n vpath = matches[1]\n end\nreturn path.trimdots(vpath)\nend\nfunction premake.hascppproject(sln)\nfor prj in premake.solution.eachproject(sln) do\nif premake.iscppproject(prj) then\nreturn true\nend\nend\nend\nfunction premake.hasdotnetproject(sln)\nfor prj in premake.solution.eachproject(sln) do\nif premake.isdotnetproject(prj) then\nreturn true\nend\nend\nend\nfunction premake.project.iscproject(prj)\nreturn prj.language == \"C\"\nend\nfunction premake.iscppproject(prj)\nreturn (prj.language == \"C\" or prj.language == \"C++\")\nend\nfunction premake.isdotnetproject(prj)\nreturn (prj.language == \"C#\")\nend\nfunction premake.isvalaproject(prj)\nreturn (prj.language == \"Vala\")\nend\nfunction premake.isswiftproject(prj)\nreturn (prj.language == \"Swift\")\nend\n",
+ "= \"link\"\nand not cfg.flags.NoImportLib\nthen\nkind = \"StaticLib\"\nend\nif namestyle == \"posix\" and system == \"windows\" and kind ~= \"StaticLib\" then\nnamestyle = \"windows\"\nend\nend\nlocal field = \"build\"\nif direction == \"link\" and cfg.kind == \"SharedLib\" then\nfield = \"implib\"\nend\nlocal name = cfg[field..\"name\"] or cfg.targetname or cfg.project.name\nlocal dir = cfg[field..\"dir\"] or cfg.targetdir or path.getrelative(cfg.location, cfg.basedir)\nlocal subdir = cfg[field..\"subdir\"] or cfg.targetsubdir or \".\"\nlocal prefix = \"\"\nlocal suffix = \"\"\nlocal ext = \"\"\nlocal bundlepath, bundlename\ndir = path.join(dir, subdir)\nif namestyle == \"windows\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".exe\"\nelseif kind == \"SharedLib\" then\next = \".dll\"\nelseif kind == \"StaticLib\" then\next = \".lib\"\nend\nelseif namestyle == \"posix\" then\nif kind == \"WindowedApp\" and system == \"macosx\" and not cfg.options.SkipBundling then\nbu"
+ "ndlename = name .. \".app\"\nbundlepath = path.join(dir, bundlename)\ndir = path.join(bundlepath, \"Contents/MacOS\")\nelseif (kind == \"ConsoleApp\" or kind == \"WindowedApp\") and system == \"os2\" then\next = \".exe\"\nelseif kind == \"SharedLib\" then\nprefix = \"lib\"\next = iif(system == \"macosx\", \".dylib\", \".so\")\nelseif kind == \"StaticLib\" then\nprefix = \"lib\"\next = \".a\"\nend\nelseif namestyle == \"PS3\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".elf\"\nelseif kind == \"StaticLib\" then\nprefix = \"lib\"\next = \".a\"\nend\nelseif namestyle == \"Orbis\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".elf\"\nelseif kind == \"StaticLib\" then\nprefix = \"lib\"\next = \".a\"\nelseif kind == \"SharedLib\" then\next = \".prx\"\nend\nelseif namestyle == \"TegraAndroid\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" or kind == \"SharedLib\" then\nprefix = \"lib\"\next = \".so\"\nelseif kind == \"StaticLib\" then\nprefix = \"lib"
+ "\"\next = \".a\"\nend\nelseif namestyle == \"NX\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".nspd_root\"\nelseif kind == \"StaticLib\" then\next = \".a\"\nelseif kind == \"SharedLib\" then\next = \".nro\"\nend\nelseif namestyle == \"Emscripten\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".html\"\nelseif kind == \"StaticLib\" then\next = \".bc\"\nelseif kind == \"SharedLib\" then\next = \".js\"\nend\nend\nprefix = cfg[field..\"prefix\"] or cfg.targetprefix or prefix\nsuffix = cfg[field..\"suffix\"] or cfg.targetsuffix or suffix\next = cfg[field..\"extension\"] or cfg.targetextension or ext\nlocal result = { }\nresult.basename = name .. suffix\nresult.name = prefix .. name .. suffix .. ext\nresult.directory = dir\nresult.subdirectory = subdir\nresult.prefix = prefix\nresult.suffix = suffix\nresult.fullpath = path.join(result.directory, result.name)\nresult.bundlepath = bundlepath or result.fullpath\nif pathstyle == "
+ "\"windows\" then\nresult.directory = path.translate(result.directory, \"\\\\\")\nresult.subdirectory = path.translate(result.subdirectory, \"\\\\\")\nresult.fullpath = path.translate(result.fullpath, \"\\\\\")\nend\nreturn result\nend\nfunction premake.gettool(cfg)\nif premake.iscppproject(cfg) then\nif _OPTIONS.cc then\nreturn premake[_OPTIONS.cc]\nend\nlocal action = premake.action.current()\nif action.valid_tools then\nreturn premake[action.valid_tools.cc[1]]\nend\nreturn premake.gcc\nelseif premake.isdotnetproject(cfg) then\nreturn premake.dotnet\nelseif premake.isswiftproject(cfg) then\nreturn premake.swift\nelse\nreturn premake.valac\nend\nend\nfunction premake.project.getvpath(prj, abspath)\nlocal vpath = abspath\nlocal fname = path.getname(abspath)\nlocal max = abspath:len() - fname:len()\n \n -- First check for an exact match from the inverse vpaths\n if prj.inversevpaths and prj.inversevpaths[abspath] then\n return path.join(prj.inversevpaths[abspath], fname)\n"
+ " end\n local matches = {}\nfor replacement, patterns in pairs(prj.vpaths or {}) do\nfor _, pattern in ipairs(patterns) do\nlocal i = abspath:find(path.wildcards(pattern))\nif i == 1 then\ni = pattern:find(\"*\", 1, true) or (pattern:len() + 1)\nlocal leaf\nif i < max then\nleaf = abspath:sub(i)\nelse\nleaf = fname\nend\nif leaf:startswith(\"/\") then\nleaf = leaf:sub(2)\nend\nlocal stem = \"\"\nif replacement:len() > 0 then\nstem, stars = replacement:gsub(\"%*\", \"\")\nif stars == 0 then\nleaf = path.getname(leaf)\nend\nelse\nleaf = path.getname(leaf)\nend\ntable.insert(matches, path.join(stem, leaf))\nend\nend\nend\n \n if #matches > 0 then\n -- for the sake of determinism, return the first alphabetically\n table.sort(matches)\n vpath = matches[1]\n end\nreturn path.trimdots(vpath)\nend\nfunction premake.hascppproject(sln)\nfor prj in premake.solution.eachproject(sln) do\nif premake.iscppproject(prj) then\nreturn true\nend\nend\nend\nfunctio"
+ "n premake.hasdotnetproject(sln)\nfor prj in premake.solution.eachproject(sln) do\nif premake.isdotnetproject(prj) then\nreturn true\nend\nend\nend\nfunction premake.project.iscproject(prj)\nreturn prj.language == \"C\"\nend\nfunction premake.iscppproject(prj)\nreturn (prj.language == \"C\" or prj.language == \"C++\")\nend\nfunction premake.isdotnetproject(prj)\nreturn (prj.language == \"C#\")\nend\nfunction premake.isvalaproject(prj)\nreturn (prj.language == \"Vala\")\nend\nfunction premake.isswiftproject(prj)\nreturn (prj.language == \"Swift\")\nend\n",
/* base/config.lua */
- "premake.config = { }\nlocal config = premake.config\nfunction premake.config.isdebugbuild(cfg)\nif cfg.flags.DebugRuntime then\nreturn true\nend\nif cfg.flags.ReleaseRuntime then\nreturn false\nend\nif cfg.flags.Optimize or cfg.flags.OptimizeSize or cfg.flags.OptimizeSpeed then\nreturn false\nend\nif not cfg.flags.Symbols then\nreturn false\nend\nreturn true\nend\nfunction premake.config.eachfile(cfg)\nlocal i = 0\nlocal t = cfg.files\nreturn function ()\ni = i + 1\nif (i <= #t) then\nlocal fcfg = cfg.__fileconfigs[t[i]]\nfcfg.vpath = premake.project.getvpath(cfg.project, fcfg.name)\nreturn fcfg\nend\nend\nend\nfunction premake.config.isincrementallink(cfg)\nif cfg.kind == \"StaticLib\"\nor config.isoptimizedbuild(cfg.flags)\nor cfg.flags.NoIncrementalLink then\nreturn false\nend\nreturn true\nend\nfunction premake.config.isoptimizedbuild(flags)\nreturn flags.Optimize or flags.OptimizeSize or flags.OptimizeSpeed\nend\n",
+ "premake.config = { }\nlocal config = premake.config\nfunction premake.config.isdebugbuild(cfg)\nif cfg.flags.DebugRuntime then\nreturn true\nend\nif cfg.flags.ReleaseRuntime then\nreturn false\nend\nif cfg.flags.Optimize or cfg.flags.OptimizeSize or cfg.flags.OptimizeSpeed then\nreturn false\nend\nif not cfg.flags.Symbols then\nreturn false\nend\nreturn true\nend\nfunction premake.config.eachfile(cfg)\nlocal i = 0\nlocal t = cfg.files\nreturn function ()\ni = i + 1\nif (i <= #t) then\nlocal fcfg = cfg.__fileconfigs[t[i]]\nfcfg.vpath = premake.project.getvpath(cfg.project, fcfg.name)\nreturn fcfg\nend\nend\nend\nfunction premake.config.isincrementallink(cfg)\nif cfg.kind == \"StaticLib\" then\nreturn false\nend\nreturn not config.islinkeroptimizedbuild(cfg.flags) and not cfg.flags.NoIncrementalLink\nend\nfunction premake.config.isoptimizedbuild(flags)\nreturn flags.Optimize or flags.OptimizeSize or flags.OptimizeSpeed\nend\nfunction premake.config.islinkeroptimizedbuild(flags)\nreturn config.isoptimizedbuild(fl"
+ "ags) and not flags.NoOptimizeLink\nend\nfunction premake.config.iseditandcontinue(cfg)\nif cfg.flags.NoEditAndContinue\nor cfg.flags.Managed\nor (cfg.kind ~= \"StaticLib\" and not config.isincrementallink(cfg))\nor config.islinkeroptimizedbuild(cfg.flags) then\nreturn false\nend\nreturn true\nend\n",
/* base/bake.lua */
- "premake.bake = { }\nlocal bake = premake.bake\nlocal nocopy =\n{\nblocks = true,\nkeywords = true,\nprojects = true,\n__configs = true,\n}\nlocal nocascade =\n{\nmakesettings = true,\n}\nlocal keeprelative =\n{\nbasedir = true,\nlocation = true,\n}\nfunction premake.getactiveterms()\nlocal terms = { _action = _ACTION:lower(), os = os.get() }\nfor key, value in pairs(_OPTIONS) do\nif value ~= \"\" then\ntable.insert(terms, value:lower())\nelse\ntable.insert(terms, key:lower())\nend\nend\nreturn terms\nend\nfunction premake.iskeywordmatch(keyword, terms)\nif keyword:startswith(\"not \") then\nreturn not premake.iskeywordmatch(keyword:sub(5), terms)\nend\nfor _, pattern in ipairs(keyword:explode(\" or \")) do\nfor termkey, term in pairs(terms) do\nif term:match(pattern) == term then\nreturn termkey\nend\nend\nend\nend\nfunction premake.iskeywordsmatch(keywords, terms)\nlocal hasrequired = false\nfor _, keyword in ipairs(keywords) do\nlocal matched = premake.iskeywordmatch(keyword, terms)\nif not matched the"
- "n\nreturn false\nend\nif matched == \"required\" then\nhasrequired = true\nend\nend\nif terms.required and not hasrequired then\nreturn false\nelse\nreturn true\nend\nend\nlocal function adjustpaths(location, obj)\nfunction adjustpathlist(list)\nfor i, p in ipairs(list) do\nlist[i] = path.getrelative(location, p)\nend\nend\nif obj.allfiles ~= nil then\nadjustpathlist(obj.allfiles)\nend\nfor name, value in pairs(obj) do\nlocal field = premake.fields[name]\nif field and value and not keeprelative[name] then\nif field.kind == \"path\" then\nobj[name] = path.getrelative(location, value)\nelseif field.kind == \"dirlist\" or field.kind == \"filelist\" then\nadjustpathlist(value)\nelseif field.kind == \"keypath\" then\nfor k,v in pairs(value) do\nadjustpathlist(v)\nend\nend\nend\nend\nend\nlocal function removevalue(tbl, remove)\nfor index, item in ipairs(tbl) do\nif item == remove then\ntable.remove(tbl, index)\nbreak\nend\nend\nend\nlocal function removevalues(tbl, removes)\nfor k, v in pairs(tbl) do\nfor _, patter"
- "n in ipairs(removes) do\nif pattern == tbl[k] then\nif type(k) == \"number\" then\ntable.remove(tbl, k)\nelse\ntbl[k] = nil\nend\nbreak\nend\nend\nend\nend\nlocal function mergefield(kind, dest, src, mergecopiestotail)\nlocal tbl = dest or { }\nif kind == \"keyvalue\" or kind == \"keypath\" then\nfor key, value in pairs(src) do\ntbl[key] = mergefield(\"list\", tbl[key], value, mergecopiestotail)\nend\nelse\nfor _, item in ipairs(src) do\nif tbl[item] then\nif mergecopiestotail then\nremovevalue(tbl, item)\ntable.insert(tbl, item)\ntbl[item] = item\nend\nelse\ntable.insert(tbl, item)\ntbl[item] = item\nend\nend\nend\nreturn tbl\nend\nlocal function mergeobject(dest, src)\nif not src then\nreturn\nend\nfor fieldname, value in pairs(src) do\nif not nocopy[fieldname] then\nlocal field = premake.fields[fieldname]\nif field then\nif type(value) == \"table\" then\ndest[fieldname] = mergefield(field.kind, dest[fieldname], value, field.mergecopiestotail)\nif src.removes then\nremoves = src.removes[fieldname]\nif remove"
- "s then\nremovevalues(dest[fieldname], removes)\nend\nend\nelse\ndest[fieldname] = value\nend\nelse\ndest[fieldname] = value\nend\nend\nend\nend\nlocal function merge(dest, obj, basis, terms, cfgname, pltname)\nlocal key = cfgname or \"\"\npltname = pltname or \"Native\"\nif pltname ~= \"Native\" then\nkey = key .. pltname\nend\nterms.config = (cfgname or \"\"):lower()\nterms.platform = pltname:lower()\nlocal cfg = {}\nmergeobject(cfg, basis[key])\nadjustpaths(obj.location, cfg)\nmergeobject(cfg, obj)\nif (cfg.kind) then\nterms['kind']=cfg.kind:lower()\nend\nfor _, blk in ipairs(obj.blocks) do\nif (premake.iskeywordsmatch(blk.keywords, terms))then\nmergeobject(cfg, blk)\nif (cfg.kind and not cfg.terms.kind) then\ncfg.terms['kind'] = cfg.kind:lower()\nterms['kind'] = cfg.kind:lower()\nend\nend\nend\ncfg.name = cfgname\ncfg.platform = pltname\nfor k,v in pairs(terms) do\ncfg.terms[k] =v\nend\ndest[key] = cfg\nend\nlocal function collapse(obj, basis)\nlocal result = {}\nbasis = basis or {}\nlocal sln = obj.s"
- "olution or obj\nlocal terms = premake.getactiveterms()\nmerge(result, obj, basis, terms)--this adjusts terms\nfor _, cfgname in ipairs(sln.configurations) do\nlocal terms_local = {}\nfor k,v in pairs(terms)do terms_local[k]=v end\nmerge(result, obj, basis, terms_local, cfgname, \"Native\")--terms cam also be adjusted here\nfor _, pltname in ipairs(sln.platforms or {}) do\nif pltname ~= \"Native\" then\nmerge(result, obj, basis,terms_local, cfgname, pltname)--terms also here\nend\nend\nend\nreturn result\nend\nlocal function builduniquedirs()\nlocal num_variations = 4\nlocal cfg_dirs = {}\nlocal hit_counts = {}\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal dirs = { }\ndirs[1] = path.getabsolute(path.join(cfg.location, cfg.objdir or cfg.project.objdir or \"obj\"))\ndirs[2] = path.join(dirs[1], iif(cfg.platform == \"Native\", \"\", cfg.platform))\ndirs[3] = path.join(dirs[2], cfg.name)\ndirs[4] = path.join(dirs[3], cfg.project.name)\ncf"
- "g_dirs[cfg] = dirs\nlocal start = iif(cfg.name, 2, 1)\nfor v = start, num_variations do\nlocal d = dirs[v]\nhit_counts[d] = (hit_counts[d] or 0) + 1\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal dir\nlocal start = iif(cfg.name, 2, 1)\nfor v = start, iif(cfg.flags.SingleOutputDir==true,num_variations-1,num_variations) do\ndir = cfg_dirs[cfg][v]\nif hit_counts[dir] == 1 then break end\nend\ncfg.objectsdir = path.getrelative(cfg.location, dir)\nend\nend\nend\nend\nlocal function buildtargets()\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal pathstyle = premake.getpathstyle(cfg)\nlocal namestyle = premake.getnamestyle(cfg)\ncfg.buildtarget = premake.gettarget(cfg, \"build\", pathstyle, namestyle, cfg.system)\ncfg.linktarget = premake.gettarget(cfg, \"link\", pathstyle, namestyle, cfg.system)\nif pathstyle == \"windows\" then\ncfg.objectsdir "
- "= path.translate(cfg.objectsdir, \"\\\\\")\nend\nend\nend\nend\nend\n local function getCfgKind(cfg)\n if(cfg.kind) then\n return cfg.kind;\n end\n if(cfg.project.__configs[\"\"] and cfg.project.__configs[\"\"].kind) then\n return cfg.project.__configs[\"\"].kind;\n end\n return nil\n end\n local function getprojrec(dstArray, foundList, cfg, cfgname, searchField, bLinkage)\n if(not cfg) then return end\n local foundUsePrjs = {};\n for _, useName in ipairs(cfg[searchField]) do\n local testName = useName:lower();\n if((not foundList[testName])) then\n local theProj = nil;\n local theUseProj = nil;\n for _, prj in ipairs(cfg.project.solution.projects) do\n if (prj.name:lower() == testName) then\n if(prj.usage) then\n theUseProj = prj;\n else\n theProj = prj;\n end\n end\n end\n --Must connect to a usage project.\n if(theUseProj) then\n foundList[testName] = true;\n local prjEntry = {\n name = testName,\n proj = theProj,\n usageProj = theUseProj,\n bLinkageOnly = bLinkage,\n };\n"
- " dstArray[testName] = prjEntry;\n table.insert(foundUsePrjs, theUseProj);\n end\n end\n end\n for _, usePrj in ipairs(foundUsePrjs) do\n --Links can only recurse through static libraries.\n if((searchField ~= \"links\") or\n (getCfgKind(usePrj.__configs[cfgname]) == \"StaticLib\")) then\n getprojrec(dstArray, foundList, usePrj.__configs[cfgname],\n cfgname, searchField, bLinkage);\n end\n end\n end\n --\n -- This function will recursively get all projects that the given configuration has in its \"uses\"\n -- field. The return values are a list of tables. Each table in that list contains the following:\n --name = The lowercase name of the project.\n --proj = The project. Can be nil if it is usage-only.\n --usageProj = The usage project. Can't be nil, as using a project that has no\n -- usage project is not put into the list.\n --bLinkageOnly = If this is true, then only the linkage information should be copied.\n -- The recursion will only look at the \"uses\" field on *usage* projects.\n"
- " -- This function will also add projects to the list that are mentioned in the \"links\"\n -- field of usage projects. These will only copy linker information, but they will recurse.\n -- through other \"links\" fields.\n --\n local function getprojectsconnections(cfg, cfgname)\n local dstArray = {};\n local foundList = {};\n foundList[cfg.project.name:lower()] = true;\n --First, follow the uses recursively.\n getprojrec(dstArray, foundList, cfg, cfgname, \"uses\", false);\n --Next, go through all of the usage projects and recursively get their links.\n --But only if they're not already there. Get the links as linkage-only.\n local linkArray = {};\n for prjName, prjEntry in pairs(dstArray) do\n getprojrec(linkArray, foundList, prjEntry.usageProj.__configs[cfgname], cfgname,\n \"links\", true);\n end\n --Copy from linkArray into dstArray.\n for prjName, prjEntry in pairs(linkArray) do\n dstArray[prjName] = prjEntry;\n end\n return dstArray;\n end\n local function isnameofproj(cfg, strNam"
- "e)\n local sln = cfg.project.solution;\n local strTest = strName:lower();\n for prjIx, prj in ipairs(sln.projects) do\n if (prj.name:lower() == strTest) then\n return true;\n end\n end\n return false;\n end\n --\n -- Copies the field from dstCfg to srcCfg.\n --\n local function copydependentfield(srcCfg, dstCfg, strSrcField)\n local srcField = premake.fields[strSrcField];\n local strDstField = strSrcField;\n if type(srcCfg[strSrcField]) == \"table\" then\n --handle paths.\n if (srcField.kind == \"dirlist\" or srcField.kind == \"filelist\") and\n (not keeprelative[strSrcField]) then\n for i,p in ipairs(srcCfg[strSrcField]) do\n table.insert(dstCfg[strDstField],\n path.rebase(p, srcCfg.project.location, dstCfg.project.location))\n end\n else\n if(strSrcField == \"links\") then\n for i,p in ipairs(srcCfg[strSrcField]) do\n if(not isnameofproj(dstCfg, p)) then\n table.insert(dstCfg[strDstField], p)\n else\n printf(\"Failed to copy '%s' from proj '%s'.\",\n p, srcCfg.project.name);\n "
- " end\n end\n else\n for i,p in ipairs(srcCfg[strSrcField]) do\n table.insert(dstCfg[strDstField], p)\n end\n end\n end\n else\n if(srcField.kind == \"path\" and (not keeprelative[strSrcField])) then\n dstCfg[strDstField] = path.rebase(srcCfg[strSrcField],\n prj.location, dstCfg.project.location);\n else\n dstCfg[strDstField] = srcCfg[strSrcField];\n end\n end\n end\n --\n -- This function will take the list of project entries and apply their usage project data\n -- to the given configuration. It will copy compiling information for the projects that are\n -- not listed as linkage-only. It will copy the linking information for projects only if\n -- the source project is not a static library. It won't copy linking information\n -- if the project is in this solution; instead it will add that project to the configuration's\n -- links field, expecting that Premake will handle the rest.\n --\n local function copyusagedata(cfg, cfgname, linkToProjs)\n local myPrj = cfg.project;\n local bIsSt"
- "aticLib = (getCfgKind(cfg) == \"StaticLib\");\n for prjName, prjEntry in pairs(linkToProjs) do\n local srcPrj = prjEntry.usageProj;\n local srcCfg = srcPrj.__configs[cfgname];\n for name, field in pairs(premake.fields) do\n if(srcCfg[name]) then\n if(field.usagecopy) then\n if(not prjEntry.bLinkageOnly) then\n copydependentfield(srcCfg, cfg, name)\n end\n elseif(field.linkagecopy) then\n --Copy the linkage data if we're building a non-static thing\n --and this is a pure usage project. If it's not pure-usage, then\n --we will simply put the project's name in the links field later.\n if((not bIsStaticLib) and (not prjEntry.proj)) then\n copydependentfield(srcCfg, cfg, name)\n end\n end\n end\n end\n if((not bIsStaticLib) and prjEntry.proj) then\n table.insert(cfg.links, prjEntry.proj.name);\n end\n end\n end\n local function inverseliteralvpaths()\n for sln in premake.solution.each() do\n for _,prj in ipairs(sln.projects) do\n prj.inversevpaths = {}\n "
- " for replacement, patterns in pairs(prj.vpaths or {}) do\n for _, pattern in ipairs(patterns) do\n if string.find(pattern, \"*\") == nil then\n prj.inversevpaths[pattern] = replacement\n end\n end\n end\n end\n end\n end\nfunction premake.bake.buildconfigs()\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nprj.location = prj.location or sln.location or prj.basedir\nadjustpaths(prj.location, prj)\nfor _, blk in ipairs(prj.blocks) do\nadjustpaths(prj.location, blk)\nend\nend\nsln.location = sln.location or sln.basedir\nend\n -- convert paths for imported projects to be relative to solution location\nfor sln in premake.solution.each() do\nfor _, iprj in ipairs(sln.importedprojects) do\niprj.location = path.getabsolute(iprj.location)\nend\nend\n inverseliteralvpaths()\nfor sln in premake.solution.each() do\nlocal "
- "basis = collapse(sln)\nfor _, prj in ipairs(sln.projects) do\nprj.__configs = collapse(prj, basis)\nfor _, cfg in pairs(prj.__configs) do\nbake.postprocess(prj, cfg)\nend\nend\nend\nfor sln in premake.solution.each() do\nfor prjIx, prj in ipairs(sln.projects) do\nif(not prj.usage) then\nfor cfgname, cfg in pairs(prj.__configs) do\nlocal usesPrjs = getprojectsconnections(cfg, cfgname);\ncopyusagedata(cfg, cfgname, usesPrjs)\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nfor prjIx, prj in ipairs(sln.projects) do\nfor cfgName, cfg in pairs(prj.__configs) do\ncfg.build = true\nlocal removes = nil\nif cfg.removes ~= nil then\nremoves = cfg.removes[\"platforms\"];\nend\nif removes ~= nil then\nfor _,p in ipairs(removes) do\nif p == cfg.platform then\ncfg.build = false\nend\nend\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nlocal removeList = {};\nfor index, prj in ipairs(sln.projects) do\nif(prj.usage) then\ntable.insert(removeList, 1, index); --Add in reverse order.\nend\nend\nfor _, ind"
- "ex in ipairs(removeList) do\ntable.remove(sln.projects, index);\nend\nend\nbuilduniquedirs()\nbuildtargets(cfg)\nend\nfunction premake.bake.postprocess(prj, cfg)\ncfg.project = prj\ncfg.shortname = premake.getconfigname(cfg.name, cfg.platform, true)\ncfg.longname = premake.getconfigname(cfg.name, cfg.platform)\ncfg.location = cfg.location or cfg.basedir\nlocal platform = premake.platforms[cfg.platform]\nif platform.iscrosscompiler then\ncfg.system = cfg.platform\nelse\ncfg.system = os.get()\nend\nif cfg.kind == \"Bundle\" and not _ACTION:match(\"xcode[0-9]\") then\ncfg.kind = \"SharedLib\"\nend\nif cfg.kind == \"SharedLib\" and platform.nosharedlibs then\ncfg.kind = \"StaticLib\"\nend\nlocal removefiles = cfg.removefiles\nif _ACTION == 'gmake' or _ACTION == 'ninja' then\nremovefiles = table.join(removefiles, cfg.excludes)\nend\nlocal removefilesDict = {}\nfor _, fname in ipairs(removefiles) do\nremovefilesDict[fname] = true\nend\nlocal files = {}\nfor _, fname in ipairs(cfg.files) do\nif removefilesDict[fna"
- "me] == nil then\ntable.insert(files, fname)\nend\nend\ncfg.files = files\nlocal allfiles = {}\nlocal allfilesDict = {}\nfor _, fname in ipairs(cfg.allfiles) do\nif allfilesDict[fname] == nil then\nif removefilesDict[fname] == nil then\nallfilesDict[fname] = true\ntable.insert(allfiles, fname)\nend\nend\nend\ncfg.allfiles = allfiles\nfor name, field in pairs(premake.fields) do\nif field.isflags then\nlocal values = cfg[name]\nfor _, flag in ipairs(values) do values[flag] = true end\nend\nend\nlocal cfgfields = {\n{\"__fileconfigs\", cfg.files},\n{\"__allfileconfigs\", cfg.allfiles},\n}\nfor _, cfgfield in ipairs(cfgfields) do\nlocal fieldname = cfgfield[1]\nlocal field = cfgfield[2]\ncfg[fieldname] = { }\nfor _, fname in ipairs(field) do\nlocal fcfg = {}\nif premake._filelevelconfig then\ncfg.terms.required = fname:lower()\nfor _, blk in ipairs(cfg.project.blocks) do\nif (premake.iskeywordsmatch(blk.keywords, cfg.terms)) then\nmergeobject(fcfg, blk)\nend\nend\nend\nfcfg.name = fname\ncfg[fieldname][fname"
- "] = fcfg\ntable.insert(cfg[fieldname], fcfg)\nend\nend\nend\n",
+ "premake.bake = { }\nlocal bake = premake.bake\nlocal nocopy =\n{\nblocks = true,\nkeywords = true,\nprojects = true,\n__configs = true,\n}\nlocal nocascade =\n{\nmakesettings = true,\n}\nlocal keeprelative =\n{\nbasedir = true,\nlocation = true,\n}\nfunction premake.getactiveterms(obj)\nlocal terms = { _action = _ACTION:lower(), os = os.get() }\nfor key, value in pairs(_OPTIONS) do\nif value ~= \"\" then\ntable.insert(terms, value:lower())\nelse\ntable.insert(terms, key:lower())\nend\nend\nreturn terms\nend\nfunction premake.iskeywordmatch(keyword, terms)\nif keyword:startswith(\"not \") then\nreturn not premake.iskeywordmatch(keyword:sub(5), terms)\nend\nfor _, pattern in ipairs(keyword:explode(\" or \")) do\nfor termkey, term in pairs(terms) do\nif term:match(pattern) == term then\nreturn termkey\nend\nend\nend\nend\nfunction premake.iskeywordsmatch(keywords, terms)\nlocal hasrequired = false\nfor _, keyword in ipairs(keywords) do\nlocal matched = premake.iskeywordmatch(keyword, terms)\nif not matched "
+ "then\nreturn false\nend\nif matched == \"required\" then\nhasrequired = true\nend\nend\nif terms.required and not hasrequired then\nreturn false\nelse\nreturn true\nend\nend\nlocal function adjustpaths(location, obj)\nfunction adjustpathlist(list)\nfor i, p in ipairs(list) do\nlist[i] = path.getrelative(location, p)\nend\nend\nif obj.allfiles ~= nil then\nadjustpathlist(obj.allfiles)\nend\nfor name, value in pairs(obj) do\nlocal field = premake.fields[name]\nif field and value and not keeprelative[name] then\nif field.kind == \"path\" then\nobj[name] = path.getrelative(location, value)\nelseif field.kind == \"dirlist\" or field.kind == \"filelist\" then\nadjustpathlist(value)\nelseif field.kind == \"keypath\" then\nfor k,v in pairs(value) do\nadjustpathlist(v)\nend\nend\nend\nend\nend\nlocal function removevalue(tbl, remove)\nfor index, item in ipairs(tbl) do\nif item == remove then\ntable.remove(tbl, index)\nbreak\nend\nend\nend\nlocal function removevalues(tbl, removes)\nfor k, v in pairs(tbl) do\nfor _, pat"
+ "tern in ipairs(removes) do\nif pattern == tbl[k] then\nif type(k) == \"number\" then\ntable.remove(tbl, k)\nelse\ntbl[k] = nil\nend\nbreak\nend\nend\nend\nend\nlocal function mergefield(kind, dest, src, mergecopiestotail)\nlocal tbl = dest or { }\nif kind == \"keyvalue\" or kind == \"keypath\" then\nfor key, value in pairs(src) do\ntbl[key] = mergefield(\"list\", tbl[key], value, mergecopiestotail)\nend\nelse\nfor _, item in ipairs(src) do\nif tbl[item] then\nif mergecopiestotail then\nremovevalue(tbl, item)\ntable.insert(tbl, item)\ntbl[item] = item\nend\nelse\ntable.insert(tbl, item)\ntbl[item] = item\nend\nend\nend\nreturn tbl\nend\nlocal function mergeobject(dest, src)\nif not src then\nreturn\nend\nfor fieldname, value in pairs(src) do\nif not nocopy[fieldname] then\nlocal field = premake.fields[fieldname]\nif field then\nif type(value) == \"table\" then\ndest[fieldname] = mergefield(field.kind, dest[fieldname], value, field.mergecopiestotail)\nif src.removes then\nremoves = src.removes[fieldname]\nif rem"
+ "oves then\nremovevalues(dest[fieldname], removes)\nend\nend\nelse\ndest[fieldname] = value\nend\nelse\ndest[fieldname] = value\nend\nend\nend\nend\nlocal function merge(dest, obj, basis, terms, cfgname, pltname)\nlocal key = cfgname or \"\"\npltname = pltname or \"Native\"\nif pltname ~= \"Native\" then\nkey = key .. pltname\nend\nterms.config = (cfgname or \"\"):lower()\nterms.platform = pltname:lower()\nlocal cfg = {}\nmergeobject(cfg, basis[key])\nadjustpaths(obj.location, cfg)\nmergeobject(cfg, obj)\nif (cfg.kind) then\nterms['kind']=cfg.kind:lower()\nend\nfor _, blk in ipairs(obj.blocks) do\nif (premake.iskeywordsmatch(blk.keywords, terms))then\nmergeobject(cfg, blk)\nif (cfg.kind and not cfg.terms.kind) then\ncfg.terms['kind'] = cfg.kind:lower()\nterms['kind'] = cfg.kind:lower()\nend\nend\nend\ncfg.name = cfgname\ncfg.platform = pltname\nfor k,v in pairs(terms) do\ncfg.terms[k] =v\nend\ndest[key] = cfg\nend\nlocal function collapse(obj, basis)\nlocal result = {}\nbasis = basis or {}\nlocal sln = ob"
+ "j.solution or obj\nlocal terms = premake.getactiveterms(obj)\nmerge(result, obj, basis, terms)--this adjusts terms\nfor _, cfgname in ipairs(sln.configurations) do\nlocal terms_local = {}\nfor k,v in pairs(terms)do terms_local[k]=v end\nmerge(result, obj, basis, terms_local, cfgname, \"Native\")--terms cam also be adjusted here\nfor _, pltname in ipairs(sln.platforms or {}) do\nif pltname ~= \"Native\" then\nmerge(result, obj, basis,terms_local, cfgname, pltname)--terms also here\nend\nend\nend\nreturn result\nend\nlocal function builduniquedirs()\nlocal num_variations = 4\nlocal cfg_dirs = {}\nlocal hit_counts = {}\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal dirs = { }\ndirs[1] = path.getabsolute(path.join(cfg.location, cfg.objdir or cfg.project.objdir or \"obj\"))\ndirs[2] = path.join(dirs[1], iif(cfg.platform == \"Native\", \"\", cfg.platform))\ndirs[3] = path.join(dirs[2], cfg.name)\ndirs[4] = path.join(dirs[3], cfg.project.nam"
+ "e)\ncfg_dirs[cfg] = dirs\nlocal start = iif(cfg.name, 2, 1)\nfor v = start, num_variations do\nlocal d = dirs[v]\nhit_counts[d] = (hit_counts[d] or 0) + 1\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal dir\nlocal start = iif(cfg.name, 2, 1)\nfor v = start, iif(cfg.flags.SingleOutputDir==true,num_variations-1,num_variations) do\ndir = cfg_dirs[cfg][v]\nif hit_counts[dir] == 1 then break end\nend\ncfg.objectsdir = path.getrelative(cfg.location, dir)\nend\nend\nend\nend\nlocal function buildtargets()\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal pathstyle = premake.getpathstyle(cfg)\nlocal namestyle = premake.getnamestyle(cfg)\ncfg.buildtarget = premake.gettarget(cfg, \"build\", pathstyle, namestyle, cfg.system)\ncfg.linktarget = premake.gettarget(cfg, \"link\", pathstyle, namestyle, cfg.system)\nif pathstyle == \"windows\" then\ncfg.objec"
+ "tsdir = path.translate(cfg.objectsdir, \"\\\\\")\nend\nend\nend\nend\nend\n local function getCfgKind(cfg)\n if(cfg.kind) then\n return cfg.kind;\n end\n if(cfg.project.__configs[\"\"] and cfg.project.__configs[\"\"].kind) then\n return cfg.project.__configs[\"\"].kind;\n end\n return nil\n end\n local function getprojrec(dstArray, foundList, cfg, cfgname, searchField, bLinkage)\n if(not cfg) then return end\n local foundUsePrjs = {};\n for _, useName in ipairs(cfg[searchField]) do\n local testName = useName:lower();\n if((not foundList[testName])) then\n local theProj = nil;\n local theUseProj = nil;\n for _, prj in ipairs(cfg.project.solution.projects) do\n if (prj.name:lower() == testName) then\n if(prj.usage) then\n theUseProj = prj;\n else\n theProj = prj;\n end\n end\n end\n --Must connect to a usage project.\n if(theUseProj) then\n foundList[testName] = true;\n local prjEntry = {\n name = testName,\n proj = theProj,\n usageProj = theUseProj,\n bLinkageOnly = bLinkage,\n"
+ " };\n dstArray[testName] = prjEntry;\n table.insert(foundUsePrjs, theUseProj);\n end\n end\n end\n for _, usePrj in ipairs(foundUsePrjs) do\n --Links can only recurse through static libraries.\n if((searchField ~= \"links\") or\n (getCfgKind(usePrj.__configs[cfgname]) == \"StaticLib\")) then\n getprojrec(dstArray, foundList, usePrj.__configs[cfgname],\n cfgname, searchField, bLinkage);\n end\n end\n end\n --\n -- This function will recursively get all projects that the given configuration has in its \"uses\"\n -- field. The return values are a list of tables. Each table in that list contains the following:\n --name = The lowercase name of the project.\n --proj = The project. Can be nil if it is usage-only.\n --usageProj = The usage project. Can't be nil, as using a project that has no\n -- usage project is not put into the list.\n --bLinkageOnly = If this is true, then only the linkage information should be copied.\n -- The recursion will only look at the \"uses\" field on *usage* proje"
+ "cts.\n -- This function will also add projects to the list that are mentioned in the \"links\"\n -- field of usage projects. These will only copy linker information, but they will recurse.\n -- through other \"links\" fields.\n --\n local function getprojectsconnections(cfg, cfgname)\n local dstArray = {};\n local foundList = {};\n foundList[cfg.project.name:lower()] = true;\n --First, follow the uses recursively.\n getprojrec(dstArray, foundList, cfg, cfgname, \"uses\", false);\n --Next, go through all of the usage projects and recursively get their links.\n --But only if they're not already there. Get the links as linkage-only.\n local linkArray = {};\n for prjName, prjEntry in pairs(dstArray) do\n getprojrec(linkArray, foundList, prjEntry.usageProj.__configs[cfgname], cfgname,\n \"links\", true);\n end\n --Copy from linkArray into dstArray.\n for prjName, prjEntry in pairs(linkArray) do\n dstArray[prjName] = prjEntry;\n end\n return dstArray;\n end\n local function isnameofproj(cfg, "
+ "strName)\n local sln = cfg.project.solution;\n local strTest = strName:lower();\n for prjIx, prj in ipairs(sln.projects) do\n if (prj.name:lower() == strTest) then\n return true;\n end\n end\n return false;\n end\n --\n -- Copies the field from dstCfg to srcCfg.\n --\n local function copydependentfield(srcCfg, dstCfg, strSrcField)\n local srcField = premake.fields[strSrcField];\n local strDstField = strSrcField;\n if type(srcCfg[strSrcField]) == \"table\" then\n --handle paths.\n if (srcField.kind == \"dirlist\" or srcField.kind == \"filelist\") and\n (not keeprelative[strSrcField]) then\n for i,p in ipairs(srcCfg[strSrcField]) do\n table.insert(dstCfg[strDstField],\n path.rebase(p, srcCfg.project.location, dstCfg.project.location))\n end\n else\n if(strSrcField == \"links\") then\n for i,p in ipairs(srcCfg[strSrcField]) do\n if(not isnameofproj(dstCfg, p)) then\n table.insert(dstCfg[strDstField], p)\n else\n printf(\"Failed to copy '%s' from proj '%s'.\",\n p, srcCfg.project.nam"
+ "e);\n end\n end\n else\n for i,p in ipairs(srcCfg[strSrcField]) do\n table.insert(dstCfg[strDstField], p)\n end\n end\n end\n else\n if(srcField.kind == \"path\" and (not keeprelative[strSrcField])) then\n dstCfg[strDstField] = path.rebase(srcCfg[strSrcField],\n prj.location, dstCfg.project.location);\n else\n dstCfg[strDstField] = srcCfg[strSrcField];\n end\n end\n end\n --\n -- This function will take the list of project entries and apply their usage project data\n -- to the given configuration. It will copy compiling information for the projects that are\n -- not listed as linkage-only. It will copy the linking information for projects only if\n -- the source project is not a static library. It won't copy linking information\n -- if the project is in this solution; instead it will add that project to the configuration's\n -- links field, expecting that Premake will handle the rest.\n --\n local function copyusagedata(cfg, cfgname, linkToProjs)\n local myPrj = cfg.project;\n local"
+ " bIsStaticLib = (getCfgKind(cfg) == \"StaticLib\");\n for prjName, prjEntry in pairs(linkToProjs) do\n local srcPrj = prjEntry.usageProj;\n local srcCfg = srcPrj.__configs[cfgname];\n for name, field in pairs(premake.fields) do\n if(srcCfg[name]) then\n if(field.usagecopy) then\n if(not prjEntry.bLinkageOnly) then\n copydependentfield(srcCfg, cfg, name)\n end\n elseif(field.linkagecopy) then\n --Copy the linkage data if we're building a non-static thing\n --and this is a pure usage project. If it's not pure-usage, then\n --we will simply put the project's name in the links field later.\n if((not bIsStaticLib) and (not prjEntry.proj)) then\n copydependentfield(srcCfg, cfg, name)\n end\n end\n end\n end\n if((not bIsStaticLib) and prjEntry.proj) then\n table.insert(cfg.links, prjEntry.proj.name);\n end\n end\n end\n local function inverseliteralvpaths()\n for sln in premake.solution.each() do\n for _,prj in ipairs(sln.projects) do\n prj.inversevpaths = "
+ "{}\n for replacement, patterns in pairs(prj.vpaths or {}) do\n for _, pattern in ipairs(patterns) do\n if string.find(pattern, \"*\") == nil then\n prj.inversevpaths[pattern] = replacement\n end\n end\n end\n end\n end\n end\nfunction premake.bake.buildconfigs()\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nprj.location = prj.location or sln.location or prj.basedir\nadjustpaths(prj.location, prj)\nfor _, blk in ipairs(prj.blocks) do\nadjustpaths(prj.location, blk)\nend\nend\nsln.location = sln.location or sln.basedir\nend\n -- convert paths for imported projects to be relative to solution location\nfor sln in premake.solution.each() do\nfor _, iprj in ipairs(sln.importedprojects) do\niprj.location = path.getabsolute(iprj.location)\nend\nend\n inverseliteralvpaths()\nfor sln in premake.solution.each() do\n"
+ "local basis = collapse(sln)\nfor _, prj in ipairs(sln.projects) do\nprj.__configs = collapse(prj, basis)\nfor _, cfg in pairs(prj.__configs) do\nbake.postprocess(prj, cfg)\nend\nend\nend\nfor sln in premake.solution.each() do\nfor prjIx, prj in ipairs(sln.projects) do\nif(not prj.usage) then\nfor cfgname, cfg in pairs(prj.__configs) do\nlocal usesPrjs = getprojectsconnections(cfg, cfgname);\ncopyusagedata(cfg, cfgname, usesPrjs)\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nfor prjIx, prj in ipairs(sln.projects) do\nfor cfgName, cfg in pairs(prj.__configs) do\ncfg.build = true\nlocal removes = nil\nif cfg.removes ~= nil then\nremoves = cfg.removes[\"platforms\"];\nend\nif removes ~= nil then\nfor _,p in ipairs(removes) do\nif p == cfg.platform then\ncfg.build = false\nend\nend\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nlocal removeList = {};\nfor index, prj in ipairs(sln.projects) do\nif(prj.usage) then\ntable.insert(removeList, 1, index); --Add in reverse order.\nend\nend\nfor "
+ "_, index in ipairs(removeList) do\ntable.remove(sln.projects, index);\nend\nend\nbuilduniquedirs()\nbuildtargets(cfg)\nend\nfunction premake.bake.postprocess(prj, cfg)\ncfg.project = prj\ncfg.shortname = premake.getconfigname(cfg.name, cfg.platform, true)\ncfg.longname = premake.getconfigname(cfg.name, cfg.platform)\ncfg.location = cfg.location or cfg.basedir\nlocal platform = premake.platforms[cfg.platform]\nif platform.iscrosscompiler then\ncfg.system = cfg.platform\nelse\ncfg.system = os.get()\nend\nif cfg.kind == \"Bundle\"\nand _ACTION ~= \"gmake\"\nand (_ACTION ~= \"ninja\" and (not prj.options or not prj.options.SkipBundling))\nand not _ACTION:match(\"xcode[0-9]\") then\ncfg.kind = \"SharedLib\"\nend\nif cfg.kind == \"SharedLib\" and platform.nosharedlibs then\ncfg.kind = \"StaticLib\"\nend\nlocal removefiles = cfg.removefiles\nif _ACTION == 'gmake' or _ACTION == 'ninja' then\nremovefiles = table.join(removefiles, cfg.excludes)\nend\nlocal removefilesDict = {}\nfor _, fname in ipairs(removefiles) do"
+ "\nremovefilesDict[fname] = true\nend\nlocal files = {}\nfor _, fname in ipairs(cfg.files) do\nif removefilesDict[fname] == nil then\ntable.insert(files, fname)\nend\nend\ncfg.files = files\nlocal allfiles = {}\nlocal allfilesDict = {}\nif cfg.allfiles ~= nil then\nfor _, fname in ipairs(cfg.allfiles) do\nif allfilesDict[fname] == nil then\nif removefilesDict[fname] == nil then\nallfilesDict[fname] = true\ntable.insert(allfiles, fname)\nend\nend\nend\nend\ncfg.allfiles = allfiles\nfor name, field in pairs(premake.fields) do\nif field.isflags then\nlocal values = cfg[name]\nfor _, flag in ipairs(values) do values[flag] = true end\nend\nend\nlocal cfgfields = {\n{\"__fileconfigs\", cfg.files},\n{\"__allfileconfigs\", cfg.allfiles},\n}\nfor _, cfgfield in ipairs(cfgfields) do\nlocal fieldname = cfgfield[1]\nlocal field = cfgfield[2]\ncfg[fieldname] = { }\nfor _, fname in ipairs(field) do\nlocal fcfg = {}\nif premake._filelevelconfig then\ncfg.terms.required = fname:lower()\nfor _, blk in ipairs(cfg.project."
+ "blocks) do\nif (premake.iskeywordsmatch(blk.keywords, cfg.terms)) then\nmergeobject(fcfg, blk)\nend\nend\nend\nfcfg.name = fname\ncfg[fieldname][fname] = fcfg\ntable.insert(cfg[fieldname], fcfg)\nend\nend\nend\n",
/* base/api.lua */
- "premake.fields =\n{\narchivesplit_size =\n{\nkind = \"string\",\nscope = \"config\",\n},\nbasedir =\n{\nkind = \"path\",\nscope = \"container\",\n},\nbuildaction =\n{\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"Compile\",\n\"Copy\",\n\"Embed\",\n\"None\"\n}\n},\nbuildoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nbuildoptions_asm =\n{\nkind = \"list\",\nscope = \"config\",\n},\nbuildoptions_c =\n{\nkind = \"list\",\nscope = \"config\",\n},\nbuildoptions_cpp =\n{\nkind = \"list\",\nscope = \"config\",\n},\nbuildoptions_objc =\n{\nkind = \"list\",\nscope = \"config\",\n},\nbuildoptions_objcpp =\n{\nkind = \"list\",\nscope = \"config\",\n},\nbuildoptions_vala =\n{\nkind = \"list\",\nscope = \"config\",\n},\nclrreferences =\n{\nkind = \"list\",\nscope = \"container\",\n},\nconfigurations =\n{\nkind = \"list\",\nscope = \"solution\",\n},\ncustombuildtask =\n{\nkind = \"table\",\nscope = \"config\",\n},\ndebugargs =\n{\nkind = \"list\",\nscope = \"config\",\n},\ndebugdir =\n{\nkind"
- " = \"path\",\nscope = \"config\",\n},\ndebugenvs =\n{\nkind = \"list\",\nscope = \"config\",\n},\ndefines =\n{\nkind = \"list\",\nscope = \"config\",\n},\ndeploymentoptions =\n{\nkind = \"list\",\nscope = \"config\",\nusagecopy = true,\n},\ndependency =\n{\nkind = \"table\",\nscope = \"config\",\n},\ndeploymode =\n{\nkind = \"string\",\nscope = \"config\",\n},\nexcludes =\n{\nkind = \"filelist\",\nscope = \"config\",\n},\nforcenative =\n{\nkind = \"filelist\",\nscope = \"config\",\n},\nnopch =\n{\nkind = \"filelist\",\nscope = \"config\",\n},\nfiles =\n{\nkind = \"filelist\",\nscope = \"config\",\n},\nremovefiles =\n{\nkind = \"filelist\",\nscope = \"config\",\n},\nflags =\n{\nkind = \"list\",\nscope = \"config\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_flags = {\nATL = 1,\nC7DebugInfo = 1,\nDebugEnvsDontMerge = 1,\nDebugEnvsInherit = 1,\nDeploymentContent = 1,\nEnableMinimalRebuild = 1,\nEnableSSE = 1,\nEnableSSE2 = 1,\nEnableAVX = 1,\nEnableAVX2 = 1,\nPedanticWa"
- "rnings = 1,\nExtraWarnings = 1,\nFatalWarnings = 1,\nFloatFast = 1,\nFloatStrict = 1,\nManaged = 1,\nMinimumWarnings = 1,\nMFC = 1,\nNativeWChar = 1,\nNo64BitChecks = 1,\nNoBufferSecurityCheck = 1,\nNoEditAndContinue = 1,\nNoExceptions = 1,\nNoFramePointer = 1,\nNoImportLib = 1,\nNoIncrementalLink = 1,\nNoManifest = 1,\nNoMultiProcessorCompilation = 1,\nNoNativeWChar = 1,\nNoPCH = 1,\nNoRTTI = 1,\nNoWinMD = 1, -- explicitly disables Windows Metadata\nNoWinRT = 1, -- explicitly disables Windows Runtime Extension\nFastCall = 1,\nStdCall = 1,\nSingleOutputDir = 1,\nObjcARC = 1,\nOptimize = 1,\nOptimizeSize = 1,\nOptimizeSpeed = 1,\nDebugRuntime = 1,\nReleaseRuntime = 1,\nSEH = 1,\nStaticATL = 1,\nStaticRuntime = 1,\nSymbols = 1,\nUnicode = 1,\nUnsafe = 1,\nUnsignedChar = 1,\nUseFullPaths = 1,\nWinMain = 1,\n}\nlocal englishToAmericanSpelling =\n{\noptimise = 'optimize',\noptimisesize = 'optimizesize',\noptimisespeed = 'optimizespeed',\n}\nlocal lowervalue = value:lower()\nlowervalue = englishToAmericanSpell"
- "ing[lowervalue] or lowervalue\nfor v, _ in pairs(allowed_flags) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid flag\"\nend,\n},\nframework =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"1.0\",\n\"1.1\",\n\"2.0\",\n\"3.0\",\n\"3.5\",\n\"4.0\",\n\"4.5\",\n\"4.5.1\",\n\"4.5.2\",\n\"4.6\",\n\"4.6.1\",\n\"4.6.2\",\n}\n},\nwindowstargetplatformversion =\n{\nkind = \"string\",\nscope = \"project\",\n},\nwindowstargetplatformminversion =\n{\nkind = \"string\",\nscope = \"project\",\n},\nforcedincludes =\n{\nkind = \"list\",\nscope = \"config\",\n},\nimagepath =\n{\nkind = \"path\",\nscope = \"config\",\n},\nimageoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nimplibdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\nimplibextension =\n{\nkind = \"string\",\nscope = \"config\",\n},\nimplibname =\n{\nkind = \"string\",\nscope = \"config\",\n},\nimplibprefix =\n{\nkind = \"string\",\nscope = \"config\",\n},\nimplibsuffix =\n{\nkind = \"string\",\nscope ="
- " \"config\",\n},\nincludedirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n},\nuserincludedirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n},\nusingdirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n},\nkind =\n{\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"ConsoleApp\",\n\"WindowedApp\",\n\"StaticLib\",\n\"SharedLib\",\n\"Bundle\",\n}\n},\nlanguage =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"C\",\n\"C++\",\n\"C#\",\n\"Vala\",\n\"Swift\",\n}\n},\nlibdirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\nlinkagecopy = true,\n},\nlinkoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nlinks =\n{\nkind = \"list\",\nscope = \"config\",\nallowed = function(value)\nif value:find('/', nil, true) then\nvalue = path.getabsolute(value)\nend\nreturn value\nend,\nlinkagecopy = true,\nmergecopiestotail = true,\n},\nlocation =\n{\nkind = \"path\",\nscope = \"container\",\n},\nmakesettings =\n{\nkind = \"list\",\nsc"
- "ope = \"config\",\n},\nmessageskip =\n{\nkind = \"list\",\nscope = \"solution\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_messages = {\nSkipCreatingMessage = 1,\nSkipBuildingMessage = 1,\nSkipCleaningMessage = 1,\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_messages) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid message to skip\"\nend,\n},\nmsgarchiving =\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsgcompile =\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsgprecompile =\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsgcompile_objc =\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsgresource =\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsglinking =\n{\nkind = \"string\",\nscope = \"config\",\n},\nobjdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\noptions =\n{\nkind = \"list\",\nscope = \"container\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_options = {"
- "\nForceCPP = 1,\nArchiveSplit = 1\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_options) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid option\"\nend,\n},\npchheader =\n{\nkind = \"string\",\nscope = \"config\",\n},\npchsource =\n{\nkind = \"path\",\nscope = \"config\",\n},\nplatforms =\n{\nkind = \"list\",\nscope = \"solution\",\nallowed = table.keys(premake.platforms),\n},\npostbuildcommands =\n{\nkind = \"list\",\nscope = \"config\",\n},\nprebuildcommands =\n{\nkind = \"list\",\nscope = \"config\",\n},\npostcompiletasks =\n{\nkind = \"list\",\nscope = \"config\",\n},\nprelinkcommands =\n{\nkind = \"list\",\nscope = \"config\",\n},\npropertysheets =\n{\nkind = \"dirlist\",\nscope = \"config\",\n},\npullmappingfile =\n{\nkind = \"path\",\nscope = \"config\",\n},\nresdefines =\n{\nkind = \"list\",\nscope = \"config\",\n},\nresincludedirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\n},\nresoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\ns"
- "dkreferences =\n{\nkind = \"list\",\nscope = \"config\",\n},\nstartproject =\n{\nkind = \"string\",\nscope = \"solution\",\n},\ntargetdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\ntargetsubdir =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetextension =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetname =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetprefix =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetsuffix =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntrimpaths =\n{\nkind = \"dirlist\",\nscope = \"config\",\n},\nuuid =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = function(value)\nlocal ok = true\nif (#value ~= 36) then ok = false end\nfor i=1,36 do\nlocal ch = value:sub(i,i)\nif (not ch:find(\"[ABCDEFabcdef0123456789-]\")) then ok = false end\nend\nif (value:sub(9,9) ~= \"-\") then ok = false end\nif (value:sub(14,14) ~= \"-\") then ok = false end\nif (value:sub(19,19) ~= \"-\") then ok = false end\nif (value:sub(24,24) ~= \"-\") then "
- "ok = false end\nif (not ok) then\nreturn nil, \"invalid UUID\"\nend\nreturn value:upper()\nend\n},\nuses =\n{\nkind = \"list\",\nscope = \"config\",\n},\nvapidirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\n},\nvpaths =\n{\nkind = \"keypath\",\nscope = \"container\",\n},\nvsimportreferences =\n{\nkind = \"filelist\",\nscope = \"container\",\n},\nswiftmodulemaps =\n{\nkind = \"filelist\",\nscope = \"config\",\n},\nbuildoptions_swift =\n{\nkind = \"list\",\nscope = \"config\",\n},\nlinkoptions_swift =\n{\nkind = \"list\",\nscope = \"config\",\n},\n}\npremake.check_paths = false\nfunction premake.checkvalue(value, allowed)\nif (allowed) then\nif (type(allowed) == \"function\") then\nreturn allowed(value)\nelse\nfor _,v in ipairs(allowed) do\nif (value:lower() == v:lower()) then\nreturn v\nend\nend\nreturn nil, \"invalid value '\" .. value .. \"'\"\nend\nelse\nreturn value\nend\nend\nfunction premake.getobject(t)\nlocal container\nif (t == \"container\" or t == \"solution\") then\ncontainer = premake.Curr"
- "entContainer\nelse\ncontainer = premake.CurrentConfiguration\nend\nif t == \"solution\" then\nif typex(container) == \"project\" then\ncontainer = container.solution\nend\nif typex(container) ~= \"solution\" then\ncontainer = nil\nend\nend\nlocal msg\nif (not container) then\nif (t == \"container\") then\nmsg = \"no active solution or project\"\nelseif (t == \"solution\") then\nmsg = \"no active solution\"\nelse\nmsg = \"no active solution, project, or configuration\"\nend\nend\nreturn container, msg\nend\nfunction premake.setarray(obj, fieldname, value, allowed)\nobj[fieldname] = obj[fieldname] or {}\nlocal function add(value, depth)\nif type(value) == \"table\" then\nfor _,v in ipairs(value) do\nadd(v, depth + 1)\nend\nelse\nvalue, err = premake.checkvalue(value, allowed)\nif not value then\nerror(err, depth)\nend\ntable.insert(obj[fieldname], value)\nend\nend\nif value then\nadd(value, 5)\nend\nreturn obj[fieldname]\nend\nfunction premake.settable(obj, fieldname, value, allowed)\nobj[fieldname] = obj[fieldn"
- "ame] or {}\ntable.insert(obj[fieldname], value)\nreturn obj[fieldname]\nend\nlocal function domatchedarray(fields, value, matchfunc)\nlocal result = { }\nfunction makeabsolute(value, depth)\nif (type(value) == \"table\") then\nfor _, item in ipairs(value) do\nmakeabsolute(item, depth + 1)\nend\nelseif type(value) == \"string\" then\nif value:find(\"*\") then\nlocal arr = matchfunc(value);\nif (premake.check_paths) and (#arr == 0) then\nerror(\"Can't find matching files for pattern :\" .. value)\nend\nmakeabsolute(arr, depth + 1)\nelse\ntable.insert(result, path.getabsolute(value))\nend\nelse\nerror(\"Invalid value in list: expected string, got \" .. type(value), depth)\nend\nend\nmakeabsolute(value, 3)\nlocal retval = {}\nfor index, field in ipairs(fields) do\nlocal ctype = field[1]\nlocal fieldname = field[2]\nlocal array = premake.setarray(ctype, fieldname, result)\nif index == 1 then\nretval = array\nend\nend\nreturn retval\nend\nfunction premake.setdirarray(fields, value)\nreturn domatchedarray(fields, val"
- "ue, os.matchdirs)\nend\nfunction premake.setfilearray(fields, value)\nreturn domatchedarray(fields, value, os.matchfiles)\nend\nfunction premake.setkeyvalue(ctype, fieldname, values)\nlocal container, err = premake.getobject(ctype)\nif not container then\nerror(err, 4)\nend\nif not container[fieldname] then\ncontainer[fieldname] = {}\nend\nif type(values) ~= \"table\" then\nerror(\"invalid value; table expected\", 4)\nend\nlocal field = container[fieldname]\nfor key,value in pairs(values) do\nif not field[key] then\nfield[key] = {}\nend\ntable.insertflat(field[key], value)\nend\nreturn field\nend\nfunction premake.setstring(ctype, fieldname, value, allowed)\nlocal container, err = premake.getobject(ctype)\nif (not container) then\nerror(err, 4)\nend\nif (value) then\nvalue, err = premake.checkvalue(value, allowed)\nif (not value) then\nerror(err, 4)\nend\ncontainer[fieldname] = value\nend\nreturn container[fieldname]\nend\nfunction premake.remove(fieldname, value)\nlocal cfg = premake.CurrentConfiguration\ncfg"
- ".removes = cfg.removes or {}\ncfg.removes[fieldname] = premake.setarray(cfg.removes, fieldname, value)\nend\nlocal function accessor(name, value)\nlocal kind = premake.fields[name].kind\nlocal scope = premake.fields[name].scope\nlocal allowed = premake.fields[name].allowed\nif (kind == \"string\" or kind == \"path\") and value then\nif type(value) ~= \"string\" then\nerror(\"string value expected\", 3)\nend\nend\nlocal container, err = premake.getobject(scope)\nif (not container) then\nerror(err, 3)\nend\nif kind == \"string\" then\nreturn premake.setstring(scope, name, value, allowed)\nelseif kind == \"path\" then\nif value then value = path.getabsolute(value) end\nreturn premake.setstring(scope, name, value)\nelseif kind == \"list\" then\nreturn premake.setarray(container, name, value, allowed)\nelseif kind == \"table\" then\nreturn premake.settable(container, name, value, allowed)\nelseif kind == \"dirlist\" then\nreturn premake.setdirarray({{container, name}}, value)\nelseif kind == \"filelist\" or ki"
- "nd == \"absolutefilelist\" then\nlocal fields = {{container, name}}\nif name == \"files\" then\nlocal prj, err = premake.getobject(\"container\")\nif (not prj) then\nerror(err, 2)\nend\ntable.insert(fields, {prj.blocks[1], \"allfiles\"})\nend\nreturn premake.setfilearray(fields, value)\nelseif kind == \"keyvalue\" or kind == \"keypath\" then\nreturn premake.setkeyvalue(scope, name, value)\nend\nend\nfor name, info in pairs(premake.fields) do\n_G[name] = function(value)\nreturn accessor(name, value)\nend\nif info.kind == \"list\"\nor info.kind == \"dirlist\"\nor info.kind == \"filelist\"\nor info.kind == \"absolutefilelist\"\nthen\nif name ~= \"removefiles\"\nand name ~= \"files\" then\n_G[\"remove\"..name] = function(value)\npremake.remove(name, value)\nend\nend\nend\nend\nfunction configuration(terms)\nif not terms then\nreturn premake.CurrentConfiguration\nend\nlocal container, err = premake.getobject(\"container\")\nif (not container) then\nerror(err, 2)\nend\nlocal cfg = { }\ncfg.terms = table.flatten({te"
- "rms})\ntable.insert(container.blocks, cfg)\npremake.CurrentConfiguration = cfg\ncfg.keywords = { }\nfor _, word in ipairs(cfg.terms) do\ntable.insert(cfg.keywords, path.wildcards(word):lower())\nend\nfor name, field in pairs(premake.fields) do\nif (field.kind ~= \"string\" and field.kind ~= \"path\") then\ncfg[name] = { }\nend\nend\nreturn cfg\nend\nlocal function creategroup(name, sln, curpath, parent, inpath)\nlocal group = {}\nsetmetatable(group, {\n__type = \"group\"\n})\ntable.insert(sln.groups, group)\nsln.groups[inpath] = group\nif parent ~= nil then\ntable.insert(parent.groups, group)\nend\ngroup.solution = sln\ngroup.name = name\ngroup.uuid = os.uuid(curpath)\ngroup.parent = parent\ngroup.projects = { }\ngroup.groups = { }\nreturn group\nend\nlocal function creategroupsfrompath(inpath, sln)\nif inpath == nil then return nil end\ninpath = path.translate(inpath, \"/\")\nlocal groups = string.explode(inpath, \"/\")\nlocal curpath = \"\"\nlocal lastgroup = nil\nfor i, v in ipairs(groups) do\ncurpath = cur"
- "path .. \"/\" .. v:lower()\nlocal group = sln.groups[curpath]\nif group == nil then\ngroup = creategroup(v, sln, curpath, lastgroup, curpath)\nend\nlastgroup = group\nend\nreturn lastgroup\nend\nlocal function createproject(name, sln, isUsage)\nlocal prj = {}\nsetmetatable(prj, {\n__type = \"project\",\n})\ntable.insert(sln.projects, prj)\nif(isUsage) then\nif(sln.projects[name]) then\nsln.projects[name].usageProj = prj;\nelse\nsln.projects[name] = prj\nend\nelse\nif(sln.projects[name]) then\nprj.usageProj = sln.projects[name];\nend\nsln.projects[name] = prj\nend\nlocal group = creategroupsfrompath(premake.CurrentGroup, sln)\nif group ~= nil then\ntable.insert(group.projects, prj)\nend\nprj.solution = sln\nprj.name = name\nprj.basedir = os.getcwd()\nprj.uuid = os.uuid(prj.name)\nprj.blocks = { }\nprj.usage = isUsage\nprj.group = group\nreturn prj;\nend\nfunction usage(name)\nif (not name) then\nif(typex(premake.CurrentContainer) ~= \"project\") then re"
- "turn nil end\nif(not premake.CurrentContainer.usage) then return nil end\nreturn premake.CurrentContainer\nend\nlocal sln\nif (typex(premake.CurrentContainer) == \"project\") then\nsln = premake.CurrentContainer.solution\nelse\nsln = premake.CurrentContainer\nend\nif (typex(sln) ~= \"solution\") then\nerror(\"no active solution\", 2)\nend\nif((not sln.projects[name]) or\n((not sln.projects[name].usage) and (not sln.projects[name].usageProj))) then\npremake.CurrentContainer = createproject(name, sln, true)\nelse\npremake.CurrentContainer = iff(sln.projects[name].usage,\nsln.projects[name], sln.projects[name].usageProj)\nend\nconfiguration { }\nreturn premake.CurrentContainer\nend\nfunction project(name)\nif (not name) then\nif(typex(premake.CurrentContainer) ~= \"project\") then return nil end\nif(premake.CurrentContainer.usage) then return nil end\nreturn premake.CurrentContainer\nend\nlocal sln\nif (typex(premake.CurrentContainer) == \"project\") then\nsln = premake.CurrentContainer.solution\nelse\nsln = prem"
- "ake.CurrentContainer\nend\nif (typex(sln) ~= \"solution\") then\nerror(\"no active solution\", 2)\nend\nif((not sln.projects[name]) or sln.projects[name].usage) then\npremake.CurrentContainer = createproject(name, sln)\nelse\npremake.CurrentContainer = sln.projects[name];\nend\nconfiguration { }\nreturn premake.CurrentContainer\nend\nfunction solution(name)\nif not name then\nif typex(premake.CurrentContainer) == \"project\" then\nreturn premake.CurrentContainer.solution\nelse\nreturn premake.CurrentContainer\nend\nend\npremake.CurrentContainer = premake.solution.get(name)\nif (not premake.CurrentContainer) then\npremake.CurrentContainer = premake.solution.new(name)\nend\nconfiguration { }\nreturn premake.CurrentContainer\nend\nfunction group(name)\nif not name then\nreturn premake.CurrentGroup\nend\npremake.CurrentGroup = name\nreturn premake.CurrentGroup\nend\nfunction importvsproject(location)\nif string.find(_ACTION, \"vs\") ~= 1 then\nerror(\"Only available for visual studio actions\")\nend\nsln, err = pr"
- "emake.getobject(\"solution\")\nif not sln then\nerror(err)\nend\nlocal group = creategroupsfrompath(premake.CurrentGroup, sln)\nlocal project = {}\nproject.location = location\nproject.group = group\nproject.flags = {}\ntable.insert(sln.importedprojects, project)\n end\nfunction newaction(a)\npremake.action.add(a)\nend\nfunction newoption(opt)\npremake.option.add(opt)\nend\nfunction enablefilelevelconfig()\npremake._filelevelconfig = true\nend\n",
+ "premake.fields = {}\npremake.check_paths = false\nfunction premake.checkvalue(value, allowed)\nif (allowed) then\nif (type(allowed) == \"function\") then\nreturn allowed(value)\nelse\nfor _,v in ipairs(allowed) do\nif (value:lower() == v:lower()) then\nreturn v\nend\nend\nreturn nil, \"invalid value '\" .. value .. \"'\"\nend\nelse\nreturn value\nend\nend\nfunction premake.getobject(t)\nlocal container\nif (t == \"container\" or t == \"solution\") then\ncontainer = premake.CurrentContainer\nelse\ncontainer = premake.CurrentConfiguration\nend\nif t == \"solution\" then\nif typex(container) == \"project\" then\ncontainer = container.solution\nend\nif typex(container) ~= \"solution\" then\ncontainer = nil\nend\nend\nlocal msg\nif (not container) then\nif (t == \"container\") then\nmsg = \"no active solution or project\"\nelseif (t == \"solution\") then\nmsg = \"no active solution\"\nelse\nmsg = \"no active solution, project, or configuration\"\nend\nend\nreturn container, msg\nend\nfunction premake.setarray(obj, "
+ "fieldname, value, allowed)\nobj[fieldname] = obj[fieldname] or {}\nlocal function add(value, depth)\nif type(value) == \"table\" then\nfor _,v in ipairs(value) do\nadd(v, depth + 1)\nend\nelse\nvalue, err = premake.checkvalue(value, allowed)\nif not value then\nerror(err, depth)\nend\ntable.insert(obj[fieldname], value)\nend\nend\nif value then\nadd(value, 5)\nend\nreturn obj[fieldname]\nend\nfunction premake.settable(obj, fieldname, value, allowed)\nobj[fieldname] = obj[fieldname] or {}\ntable.insert(obj[fieldname], value)\nreturn obj[fieldname]\nend\nlocal function domatchedarray(fields, value, matchfunc)\nlocal result = { }\nfunction makeabsolute(value, depth)\nif (type(value) == \"table\") then\nfor _, item in ipairs(value) do\nmakeabsolute(item, depth + 1)\nend\nelseif type(value) == \"string\" then\nif value:find(\"*\") then\nlocal arr = matchfunc(value);\nif (premake.check_paths) and (#arr == 0) then\nerror(\"Can't find matching files for pattern :\" .. value)\nend\nmakeabsolute(arr, depth + 1)\nelse\nt"
+ "able.insert(result, path.getabsolute(value))\nend\nelse\nerror(\"Invalid value in list: expected string, got \" .. type(value), depth)\nend\nend\nmakeabsolute(value, 3)\nlocal retval = {}\nfor index, field in ipairs(fields) do\nlocal ctype = field[1]\nlocal fieldname = field[2]\nlocal array = premake.setarray(ctype, fieldname, result)\nif index == 1 then\nretval = array\nend\nend\nreturn retval\nend\nfunction premake.setdirarray(fields, value)\nreturn domatchedarray(fields, value, os.matchdirs)\nend\nfunction premake.setfilearray(fields, value)\nreturn domatchedarray(fields, value, os.matchfiles)\nend\nfunction premake.setkeyvalue(ctype, fieldname, values)\nlocal container, err = premake.getobject(ctype)\nif not container then\nerror(err, 4)\nend\nif not container[fieldname] then\ncontainer[fieldname] = {}\nend\nif type(values) ~= \"table\" then\nerror(\"invalid value; table expected\", 4)\nend\nlocal field = container[fieldname]\nfor key,value in pairs(values) do\nif not field[key] then\nfield[key] = {}\nend"
+ "\ntable.insertflat(field[key], value)\nend\nreturn field\nend\nfunction premake.setstring(ctype, fieldname, value, allowed)\nlocal container, err = premake.getobject(ctype)\nif (not container) then\nerror(err, 4)\nend\nif (value) then\nvalue, err = premake.checkvalue(value, allowed)\nif (not value) then\nerror(err, 4)\nend\ncontainer[fieldname] = value\nend\nreturn container[fieldname]\nend\nfunction premake.remove(fieldname, value)\nlocal cfg = premake.CurrentConfiguration\ncfg.removes = cfg.removes or {}\ncfg.removes[fieldname] = premake.setarray(cfg.removes, fieldname, value)\nend\nlocal function accessor(name, value)\nlocal kind = premake.fields[name].kind\nlocal scope = premake.fields[name].scope\nlocal allowed = premake.fields[name].allowed\nif (kind == \"string\" or kind == \"path\") and value then\nif type(value) ~= \"string\" then\nerror(\"string value expected\", 3)\nend\nend\nlocal container, err = premake.getobject(scope)\nif (not container) then\nerror(err, 3)\nend\nif kind == \"string\" then"
+ "\nreturn premake.setstring(scope, name, value, allowed)\nelseif kind == \"path\" then\nif value then value = path.getabsolute(value) end\nreturn premake.setstring(scope, name, value)\nelseif kind == \"list\" then\nreturn premake.setarray(container, name, value, allowed)\nelseif kind == \"table\" then\nreturn premake.settable(container, name, value, allowed)\nelseif kind == \"dirlist\" then\nreturn premake.setdirarray({{container, name}}, value)\nelseif kind == \"filelist\" or kind == \"absolutefilelist\" then\nlocal fields = {{container, name}}\nif name == \"files\" then\nlocal prj, err = premake.getobject(\"container\")\nif (not prj) then\nerror(err, 2)\nend\ntable.insert(fields, {prj.blocks[1], \"allfiles\"})\nend\nreturn premake.setfilearray(fields, value)\nelseif kind == \"keyvalue\" or kind == \"keypath\" then\nreturn premake.setkeyvalue(scope, name, value)\nend\nend\nfunction configuration(terms)\nif not terms then\nreturn premake.CurrentConfiguration\nend\nlocal container, err = premake.getobject(\"cont"
+ "ainer\")\nif (not container) then\nerror(err, 2)\nend\nlocal cfg = { }\ncfg.terms = table.flatten({terms})\ntable.insert(container.blocks, cfg)\npremake.CurrentConfiguration = cfg\ncfg.keywords = { }\nfor _, word in ipairs(cfg.terms) do\ntable.insert(cfg.keywords, path.wildcards(word):lower())\nend\nfor name, field in pairs(premake.fields) do\nif (field.kind ~= \"string\" and field.kind ~= \"path\") then\ncfg[name] = { }\nend\nend\nreturn cfg\nend\nlocal function creategroup(name, sln, curpath, parent, inpath)\nlocal group = {}\nsetmetatable(group, {\n__type = \"group\"\n})\ntable.insert(sln.groups, group)\nsln.groups[inpath] = group\nif parent ~= nil then\ntable.insert(parent.groups, group)\nend\ngroup.solution = sln\ngroup.name = name\ngroup.uuid = os.uuid(curpath)\ngroup.parent = parent\ngroup.projects = { }\ngroup.groups = { }\nreturn group\nend\nlocal function creategroupsfrompath(inpath, sln)\nif inpath == nil then return nil end\ninpath = path.translate(inpath, \"/\")\nlocal groups = string.explode(inpa"
+ "th, \"/\")\nlocal curpath = \"\"\nlocal lastgroup = nil\nfor i, v in ipairs(groups) do\ncurpath = curpath .. \"/\" .. v:lower()\nlocal group = sln.groups[curpath]\nif group == nil then\ngroup = creategroup(v, sln, curpath, lastgroup, curpath)\nend\nlastgroup = group\nend\nreturn lastgroup\nend\nlocal function createproject(name, sln, isUsage)\nlocal prj = {}\nsetmetatable(prj, {\n__type = \"project\",\n})\ntable.insert(sln.projects, prj)\nif(isUsage) then\nif(sln.projects[name]) then\nsln.projects[name].usageProj = prj;\nelse\nsln.projects[name] = prj\nend\nelse\nif(sln.projects[name]) then\nprj.usageProj = sln.projects[name];\nend\nsln.projects[name] = prj\nend\nlocal group = creategroupsfrompath(premake.CurrentGroup, sln)\nif group ~= nil then\ntable.insert(group.projects, prj)\nend\nprj.solution = sln\nprj.name = name\nprj.basedir = os.getcwd()\nprj.uuid = os.uuid(prj.name)\nprj.blocks = { }\nprj.usage = isUsage\nprj.group = group\nreturn prj;\nend"
+ "\nfunction usage(name)\nif (not name) then\nif(typex(premake.CurrentContainer) ~= \"project\") then return nil end\nif(not premake.CurrentContainer.usage) then return nil end\nreturn premake.CurrentContainer\nend\nlocal sln\nif (typex(premake.CurrentContainer) == \"project\") then\nsln = premake.CurrentContainer.solution\nelse\nsln = premake.CurrentContainer\nend\nif (typex(sln) ~= \"solution\") then\nerror(\"no active solution\", 2)\nend\nif((not sln.projects[name]) or\n((not sln.projects[name].usage) and (not sln.projects[name].usageProj))) then\npremake.CurrentContainer = createproject(name, sln, true)\nelse\npremake.CurrentContainer = iff(sln.projects[name].usage,\nsln.projects[name], sln.projects[name].usageProj)\nend\nconfiguration { }\nreturn premake.CurrentContainer\nend\nfunction project(name)\nif (not name) then\nif(typex(premake.CurrentContainer) ~= \"project\") then return nil end\nif(premake.CurrentContainer.usage) then return nil end\nreturn premake.CurrentContainer\nend\nlocal sln\nif (typex(pre"
+ "make.CurrentContainer) == \"project\") then\nsln = premake.CurrentContainer.solution\nelse\nsln = premake.CurrentContainer\nend\nif (typex(sln) ~= \"solution\") then\nerror(\"no active solution\", 2)\nend\nif((not sln.projects[name]) or sln.projects[name].usage) then\npremake.CurrentContainer = createproject(name, sln)\nelse\npremake.CurrentContainer = sln.projects[name];\nend\nconfiguration { }\nreturn premake.CurrentContainer\nend\nfunction solution(name)\nif not name then\nif typex(premake.CurrentContainer) == \"project\" then\nreturn premake.CurrentContainer.solution\nelse\nreturn premake.CurrentContainer\nend\nend\npremake.CurrentContainer = premake.solution.get(name)\nif (not premake.CurrentContainer) then\npremake.CurrentContainer = premake.solution.new(name)\nend\nconfiguration { }\nreturn premake.CurrentContainer\nend\nfunction group(name)\nif not name then\nreturn premake.CurrentGroup\nend\npremake.CurrentGroup = name\nreturn premake.CurrentGroup\nend\nfunction importvsproject(location)\nif string.fi"
+ "nd(_ACTION, \"vs\") ~= 1 then\nerror(\"Only available for visual studio actions\")\nend\nsln, err = premake.getobject(\"solution\")\nif not sln then\nerror(err)\nend\nlocal group = creategroupsfrompath(premake.CurrentGroup, sln)\nlocal project = {}\nproject.location = location\nproject.group = group\nproject.flags = {}\ntable.insert(sln.importedprojects, project)\n end\nfunction newaction(a)\npremake.action.add(a)\nend\nfunction newoption(opt)\npremake.option.add(opt)\nend\nfunction enablefilelevelconfig()\npremake._filelevelconfig = true\nend\nfunction newapifield(field)\npremake.fields[field.name] = field\n_G[field.name] = function(value)\nreturn accessor(field.name, value)\nend\nif field.kind == \"list\"\nor field.kind == \"dirlist\"\nor field.kind == \"filelist\"\nor field.kind == \"absolutefilelist\"\nthen\nif field.name ~= \"removefiles\"\nand field.name ~= \"files\" then\n_G[\"remove\"..field.name] = function(value)\npremake.remove(field.name, value)\nend\nend\nend\nend\nnewapifield {\nname = \"arc"
+ "hivesplit_size\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"basedir\",\nkind = \"path\",\nscope = \"container\",\n}\nnewapifield {\nname = \"buildaction\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"Compile\",\n\"Copy\",\n\"Embed\",\n\"None\"\n}\n}\nnewapifield {\nname = \"buildoptions\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_asm\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_c\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_cpp\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_objc\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_objcpp\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_vala\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"clrreferences\",\nkind = \"list\",\nscope = \"container\",\n}\nnewapifield {\nname"
+ " = \"configurations\",\nkind = \"list\",\nscope = \"solution\",\n}\nnewapifield {\nname = \"custombuildtask\",\nkind = \"table\",\nscope = \"config\",\n}\nnewapifield {\nname = \"debugcmd\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"debugargs\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"debugdir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"debugenvs\" ,\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"defines\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"deploymentoptions\",\nkind = \"list\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"dependency\",\nkind = \"table\",\nscope = \"config\",\n}\nnewapifield {\nname = \"deploymode\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"excludes\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"forcenative\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield "
+ "{\nname = \"nopch\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"files\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"removefiles\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"flags\",\nkind = \"list\",\nscope = \"config\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_flags = {\nAntBuildDebuggable = 1,\nATL = 1,\nC7DebugInfo = 1,\nCpp11 = 1,\nCpp14 = 1,\nCpp17 = 1,\nCppLatest = 1,\nDebugEnvsDontMerge = 1,\nDebugEnvsInherit = 1,\nDeploymentContent = 1,\nEnableMinimalRebuild = 1,\nEnableSSE = 1,\nEnableSSE2 = 1,\nEnableAVX = 1,\nEnableAVX2 = 1,\nPedanticWarnings = 1,\nExtraWarnings = 1,\nFatalWarnings = 1,\nFloatFast = 1,\nFloatStrict = 1,\nFullSymbols = 1,\nHotpatchable = 1,\nLinkSupportCircularDependencies = 1,\nManaged = 1,\nMinimumWarnings = 1,\nMFC = 1,\nNativeWChar = 1,\nNo64BitChecks = 1,\nNoBufferSecurityCheck = 1,\nNoEditAndContinue = 1,\nNoExceptions = 1,\nNoFramePointer = 1,\nNoIm"
+ "portLib = 1,\nNoIncrementalLink = 1,\nNoJMC = 1,\nNoManifest = 1,\nNoMultiProcessorCompilation = 1,\nNoNativeWChar = 1,\nNoOptimizeLink = 1,\nNoPCH = 1,\nNoRTTI = 1,\nNoRuntimeChecks = 1,\nNoWinMD = 1, -- explicitly disables Windows Metadata\nNoWinRT = 1, -- explicitly disables Windows Runtime Extension\nFastCall = 1,\nStdCall = 1,\nSingleOutputDir = 1,\nObjcARC = 1,\nOptimize = 1,\nOptimizeSize = 1,\nOptimizeSpeed = 1,\nDebugRuntime = 1,\nReleaseRuntime = 1,\nSEH = 1,\nStaticATL = 1,\nStaticRuntime = 1,\nSymbols = 1,\nUnicode = 1,\nUnitySupport = 1,\nUnsafe = 1,\nUnsignedChar = 1,\nUseFullPaths = 1,\nUseLDResponseFile = 1,\nUseObjectResponseFile = 1,\nWinMain = 1\n}\nlocal englishToAmericanSpelling =\n{\nnooptimiselink = 'nooptimizelink',\noptimise = 'optimize',\noptimisesize = 'optimizesize',\noptimisespeed = 'optimizespeed',\n}\nlocal lowervalue = value:lower()\nlowervalue = englishToAmericanSpelling[lowervalue] or lowervalue\nfor v, _ in pairs(allowed_flags) do\nif v:lower() == lowervalue then\nretur"
+ "n v\nend\nend\nreturn nil, \"invalid flag\"\nend,\n}\nnewapifield {\nname = \"framework\",\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"1.0\",\n\"1.1\",\n\"2.0\",\n\"3.0\",\n\"3.5\",\n\"4.0\",\n\"4.5\",\n\"4.5.1\",\n\"4.5.2\",\n\"4.6\",\n\"4.6.1\",\n\"4.6.2\",\n}\n}\nnewapifield {\nname = \"iostargetplatformversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"macostargetplatformversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"tvostargetplatformversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"windowstargetplatformversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"windowstargetplatformminversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"forcedincludes\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"imagepath\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"imageoptions\",\nkind = \"list\","
+ "\nscope = \"config\",\n}\nnewapifield {\nname = \"implibdir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibextension\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibname\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibprefix\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibsuffix\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"includedirs\",\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"systemincludedirs\",\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"userincludedirs\",\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"usingdirs\",\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"kind\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"ConsoleApp\",\n\"WindowedApp\",\n\"StaticLib"
+ "\",\n\"SharedLib\",\n\"Bundle\",\n}\n}\nnewapifield {\nname = \"language\",\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"C\",\n\"C++\",\n\"C#\",\n\"Vala\",\n\"Swift\",\n}\n}\nnewapifield {\nname = \"libdirs\",\nkind = \"dirlist\",\nscope = \"config\",\nlinkagecopy = true,\n}\nnewapifield {\nname = \"linkoptions\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"links\",\nkind = \"list\",\nscope = \"config\",\nallowed = function(value)\nif value:find('/', nil, true) then\nvalue = path.getabsolute(value)\nend\nreturn value\nend,\nlinkagecopy = true,\nmergecopiestotail = true,\n}\nnewapifield {\nname = \"location\",\nkind = \"path\",\nscope = \"container\",\n}\nnewapifield {\nname = \"makesettings\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"messageskip\",\nkind = \"list\",\nscope = \"solution\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_messages = {\nSkipCreatingMessage = 1,\nSkipBuildingMessage = 1,\nSkip"
+ "CleaningMessage = 1,\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_messages) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid message to skip\"\nend,\n}\nnewapifield {\nname = \"msgarchiving\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msgcompile\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msgprecompile\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msgcompile_objc\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msgresource\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msglinking\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"objdir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"options\",\nkind = \"list\",\nscope = \"container\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_options = {\nForceCPP = 1,\nArchiveSplit = 1,\nSkipBundling = 1,\n"
+ "XcodeLibrarySchemes = 1,\nXcodeSchemeNoConfigs = 1,\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_options) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid option\"\nend,\n}\nnewapifield {\nname = \"pchheader\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"pchsource\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"platforms\",\nkind = \"list\",\nscope = \"solution\",\nallowed = table.keys(premake.platforms),\n}\nnewapifield {\nname = \"postbuildcommands\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"prebuildcommands\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"postcompiletasks\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"prelinkcommands\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"propertysheets\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"pullmappingfile\",\nkind = \"path\",\n"
+ "scope = \"config\",\n}\nnewapifield {\nname = \"applicationdatadir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"finalizemetasource\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"resdefines\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"resincludedirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"resoptions\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"sdkreferences\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"startproject\",\nkind = \"string\",\nscope = \"solution\",\n}\nnewapifield {\nname = \"targetdir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"targetsubdir\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"targetextension\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"targetname\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"targetprefix\",\nki"
+ "nd = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"targetsuffix\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"trimpaths\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"uuid\",\nkind = \"string\",\nscope = \"container\",\nallowed = function(value)\nlocal ok = true\nif (#value ~= 36) then ok = false end\nfor i=1,36 do\nlocal ch = value:sub(i,i)\nif (not ch:find(\"[ABCDEFabcdef0123456789-]\")) then ok = false end\nend\nif (value:sub(9,9) ~= \"-\") then ok = false end\nif (value:sub(14,14) ~= \"-\") then ok = false end\nif (value:sub(19,19) ~= \"-\") then ok = false end\nif (value:sub(24,24) ~= \"-\") then ok = false end\nif (not ok) then\nreturn nil, \"invalid UUID\"\nend\nreturn value:upper()\nend\n}\nnewapifield {\nname = \"uses\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"vapidirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"vpaths\",\nkind = \"keypath\",\nscope = \"container\",\n"
+ "}\nnewapifield {\nname = \"vsimportreferences\",\nkind = \"filelist\",\nscope = \"container\",\n}\nnewapifield {\nname = \"dpiawareness\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"None\",\n\"High\",\n\"HighPerMonitor\",\n}\n}\nnewapifield {\nname = \"xcodeprojectopts\",\nkind = \"table\",\nscope = \"config\",\n}\nnewapifield {\nname = \"xcodetargetopts\",\nkind = \"table\",\nscope = \"config\",\n}\nnewapifield {\nname = \"xcodescriptphases\",\nkind = \"table\",\nscope = \"config\",\n}\nnewapifield {\nname = \"xcodecopyresources\",\nkind = \"table\",\nscope = \"project\",\n}\nnewapifield {\nname = \"xcodecopyframeworks\",\nkind = \"filelist\",\nscope = \"project\",\n}\nnewapifield {\nname = \"wholearchive\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"swiftmodulemaps\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_swift\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"linkoptions_swift\",\nkind ="
+ " \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidtargetapi\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidminapi\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidarch\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"armv7-a\",\n\"armv7-a-hard\",\n\"arm64-v8a\",\n\"x86\",\n\"x86_64\",\n}\n}\nnewapifield {\nname = \"androidndktoolchainversion\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidstltype\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidcppstandard\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"c++98\",\n\"c++11\",\n\"c++1y\",\n\"gnu++98\",\n\"gnu++11\",\n\"gnu++1y\",\n}\n}\nnewapifield {\nname = \"androidlinker\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"bfd\",\n\"gold\",\n}\n}\nnewapifield {\nname = \"androiddebugintentparams\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildjavasourcedi"
+ "rs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildjardirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildjardependencies\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildnativelibdirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildnativelibdependencies\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildassetsdirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"postsolutioncallbacks\",\nkind = \"list\",\nscope = \"solution\",\n}\nnewapifield {\nname = \"postprojectcallbacks\",\nkind = \"list\",\nscope = \"project\",\n}\n",
/* base/cmdline.lua */
"newoption\n{\ntrigger = \"cc\",\nvalue = \"VALUE\",\ndescription = \"Choose a C/C++ compiler set\",\nallowed = {\n{ \"gcc\", \"GNU GCC (gcc/g++)\" },\n{ \"ow\", \"OpenWatcom\" },\n{ \"ghs\", \"Green Hills Software\" },\n}\n}\nnewoption\n{\ntrigger = \"dotnet\",\nvalue = \"VALUE\",\ndescription = \"Choose a .NET compiler set\",\nallowed = {\n{ \"msnet\", \"Microsoft .NET (csc)\" },\n{ \"mono\", \"Novell Mono (mcs)\" },\n{ \"pnet\", \"Portable.NET (cscc)\" },\n}\n}\nnewoption\n{\ntrigger = \"file\",\nvalue = \"FILE\",\ndescription = \"Read FILE as a Premake script; default is 'premake4.lua'\"\n}\nnewoption\n{\ntrigger = \"help\",\ndescription = \"Display this information\"\n}\nnewoption\n{\ntrigger = \"os\",\nvalue = \"VALUE\",\ndescription = \"Generate files for a different operating system\",\nallowed = {\n{ \"bsd\", \"OpenBSD, NetBSD, or FreeBSD\" },\n{ \"linux\", \"Linux\" },\n{ \"macosx\", \"Apple Mac OS X\" },\n{ \"solaris\", \"Sola"
@@ -134,16 +142,17 @@ const char* builtin_scripts[] = {
"_time] = 2,\n[_profiler._internal_profile_by_call] = 2,\n[_profiler_hook_wrapper_by_time] = 2,\n[_profiler_hook_wrapper_by_call] = 2,\n[_profiler.prevent] = 2,\n[_profiler._get_func_rec] = 2,\n[_profiler.report] = 2,\n[_profiler.lua_report] = 2,\n[_profiler._pretty_name] = 2\n}\n",
/* tools/dotnet.lua */
- "premake.dotnet = { }\npremake.dotnet.namestyle = \"windows\"\nlocal flags =\n{\nFatalWarning = \"/warnaserror\",\nOptimize = \"/optimize\",\nOptimizeSize = \"/optimize\",\nOptimizeSpeed = \"/optimize\",\nSymbols = \"/debug\",\nUnsafe = \"/unsafe\"\n}\nfunction premake.dotnet.getbuildaction(fcfg)\nlocal ext = path.getextension(fcfg.name):lower()\nif fcfg.buildaction == \"Compile\" or ext == \".cs\" then\nreturn \"Compile\"\nelseif fcfg.buildaction == \"Embed\" or ext == \".resx\" then\nreturn \"EmbeddedResource\"\nelseif fcfg.buildaction == \"Copy\" or ext == \".asax\" or ext == \".aspx\" then\nreturn \"Content\"\nelse\nreturn \"None\"\nend\nend\nfunction premake.dotnet.getcompilervar(cfg)\nif (_OPTIONS.dotnet == \"msnet\") then\nreturn \"csc\"\nelseif (_OPTIONS.dotnet == \"mono\") then\nif (cfg.framework <= \"1.1\") then\nreturn \"mcs\"\nelseif (cfg.framework >= \"4.0\") then\nreturn \"dmcs\"\nelse \nreturn \"gmcs\"\nend\nelse\nreturn \"cscc\"\nend\nend\nfunction premake.dotnet.getfla"
- "gs(cfg)\nlocal result = table.translate(cfg.flags, flags)\nreturn result\nend\nfunction premake.dotnet.getkind(cfg)\nif (cfg.kind == \"ConsoleApp\") then\nreturn \"Exe\"\nelseif (cfg.kind == \"WindowedApp\") then\nreturn \"WinExe\"\nelseif (cfg.kind == \"SharedLib\") then\nreturn \"Library\"\nend\nend",
+ "premake.dotnet = { }\npremake.dotnet.namestyle = \"windows\"\nlocal flags =\n{\nFatalWarning = \"/warnaserror\",\nOptimize = \"/optimize\",\nOptimizeSize = \"/optimize\",\nOptimizeSpeed = \"/optimize\",\nSymbols = \"/debug\",\nUnsafe = \"/unsafe\"\n}\nfunction premake.dotnet.getbuildaction(fcfg)\nlocal ext = path.getextension(fcfg.name):lower()\nif fcfg.buildaction == \"Compile\" or ext == \".cs\" then\nreturn \"Compile\"\nelseif fcfg.buildaction == \"Embed\" or ext == \".resx\" then\nreturn \"EmbeddedResource\"\nelseif fcfg.buildaction == \"Copy\" or ext == \".asax\" or ext == \".aspx\" then\nreturn \"Content\"\nelse\nreturn \"None\"\nend\nend\nfunction premake.dotnet.getcompilervar(cfg)\nif (_OPTIONS.dotnet == \"msnet\") then\nreturn \"csc\"\nelseif (_OPTIONS.dotnet == \"mono\") then\nreturn \"mcs\"\nelse\nreturn \"cscc\"\nend\nend\nfunction premake.dotnet.getflags(cfg)\nlocal result = table.translate(cfg.flags, flags)\nreturn result\nend\nfunction premake.dotnet.getkind(cfg)\nif (c"
+ "fg.kind == \"ConsoleApp\") then\nreturn \"Exe\"\nelseif (cfg.kind == \"WindowedApp\") then\nreturn \"WinExe\"\nelseif (cfg.kind == \"SharedLib\") then\nreturn \"Library\"\nend\nend\n",
/* tools/gcc.lua */
- "premake.gcc = { }\npremake.gcc.cc = \"gcc\"\npremake.gcc.cxx = \"g++\"\npremake.gcc.ar = \"ar\"\npremake.gcc.rc = \"windres\"\npremake.gcc.llvm = false\nlocal cflags =\n{\nEnableSSE = \"-msse\",\nEnableSSE2 = \"-msse2\",\nEnableAVX = \"-mavx\",\nEnableAVX2 = \"-mavx2\",\nPedanticWarnings = \"-Wall -Wextra -pedantic\",\nExtraWarnings = \"-Wall -Wextra\",\nFatalWarnings = \"-Werror\",\nFloatFast = \"-ffast-math\",\nFloatStrict = \"-ffloat-store\",\nNoFramePointer = \"-fomit-frame-pointer\",\nOptimize = \"-O2\",\nOptimizeSize = \"-Os\",\nOptimizeSpeed = \"-O3\",\nSymbols = \"-g\",\n}\nlocal cxxflags =\n{\nNoExceptions = \"-fno-exceptions\",\nNoRTTI = \"-fno-rtti\",\nUnsignedChar = \"-funsigned-char\",\n}\nlocal objcflags =\n{\nObjcARC = \"-fobjc-arc\",\n}\npremake.gcc.platforms =\n{\nNative = {\ncppflags = \"-MMD -MP\",\n},\nx32 = {\ncppflags = \"-MMD -MP\",\nflags = \"-m32\",\n},\nx64 = {\ncppflags = \"-MMD "
- "-MP\",\nflags = \"-m64\",\n},\nUniversal = {\nar = \"libtool\",\ncppflags = \"-MMD -MP\",\nflags = \"-arch i386 -arch x86_64 -arch ppc -arch ppc64\",\n},\nUniversal32 = {\nar = \"libtool\",\ncppflags = \"-MMD -MP\",\nflags = \"-arch i386 -arch ppc\",\n},\nUniversal64 = {\nar = \"libtool\",\ncppflags = \"-MMD -MP\",\nflags = \"-arch x86_64 -arch ppc64\",\n},\nPS3 = {\ncc = \"ppu-lv2-g++\",\ncxx = \"ppu-lv2-g++\",\nar = \"ppu-lv2-ar\",\ncppflags = \"-MMD -MP\",\n},\nWiiDev = {\ncppflags = \"-MMD -MP -I$(LIBOGC_INC) $(MACHDEP)\",\nldflags= \"-L$(LIBOGC_LIB) $(MACHDEP)\",\ncfgsettings = [[\n ifeq ($(strip $(DEVKITPPC)),)\n $(error \"DEVKITPPC environment variable is not set\")'\n endif\n include $(DEVKITPPC)/wii_rules']],\n},\nOrbis = {\ncc = \"orbis-clang\",\ncxx = \"orbis-clang++\",\nar = \"orbis-ar\",\ncppflags = \"-MMD -MP\",\n}\n}\nlocal platforms = premake.gcc.platforms\nfunction premake.gcc.getcppflags(cfg)\nlocal flags"
- " = { }\ntable.insert(flags, platforms[cfg.platform].cppflags)\nif flags[1]:startswith(\"-MMD\") then\ntable.insert(flags, \"-MP\")\nend\nreturn flags\nend\nfunction premake.gcc.getcflags(cfg)\nlocal result = table.translate(cfg.flags, cflags)\ntable.insert(result, platforms[cfg.platform].flags)\nif cfg.system ~= \"windows\" and cfg.kind == \"SharedLib\" then\ntable.insert(result, \"-fPIC\")\nend\nreturn result\nend\nfunction premake.gcc.getcxxflags(cfg)\nlocal result = table.translate(cfg.flags, cxxflags)\nreturn result\nend\nfunction premake.gcc.getobjcflags(cfg)\nreturn table.translate(cfg.flags, objcflags)\nend\nfunction premake.gcc.getldflags(cfg)\nlocal result = { }\nif not cfg.flags.Symbols then\nif cfg.system == \"macosx\" then\nelse\ntable.insert(result, \"-s\")\nend\nend\nif cfg.kind == \"SharedLib\" then\nif cfg.system == \"macosx\" then\ntable.insert(result, \"-dynamiclib\")\nelse\ntable.insert(result, \"-shared\")\nend\nif cfg.system == \"windows\" and not cfg.flags.NoImportLib then\ntable.insert(r"
- "esult, '-Wl,--out-implib=\"' .. cfg.linktarget.fullpath .. '\"')\nend\nend\nif cfg.kind == \"WindowedApp\" and cfg.system == \"windows\" then\ntable.insert(result, \"-mwindows\")\nend\nlocal platform = platforms[cfg.platform]\ntable.insert(result, platform.flags)\ntable.insert(result, platform.ldflags)\nreturn result\nend\nfunction premake.gcc.getlibdirflags(cfg)\nlocal result = { }\nfor _, value in ipairs(premake.getlinks(cfg, \"all\", \"directory\")) do\ntable.insert(result, '-L' .. _MAKE.esc(value))\nend\nreturn result\nend\nfunction premake.gcc.islibfile(p)\nif path.getextension(p) == \".a\" then\nreturn true\nend\nreturn false\nend\nfunction premake.gcc.getlibfiles(cfg)\nlocal result = {}\nfor _, value in ipairs(premake.getlinks(cfg, \"system\", \"fullpath\")) do\nif premake.gcc.islibfile(value) then\ntable.insert(result, _MAKE.esc(value))\nend\nend\nreturn result\nend\nfunction premake.gcc.getlinkflags(cfg)\nlocal result = {}\nfor _, value in ipairs(premake.getlinks(cfg, \"system\", \"fullpath\")) do\nif"
- " premake.gcc.islibfile(value) then\nvalue = path.rebase(value, cfg.project.location, cfg.location)\ntable.insert(result, _MAKE.esc(value))\nelseif path.getextension(value) == \".framework\" then\ntable.insert(result, '-framework ' .. _MAKE.esc(path.getbasename(value)))\nelse\ntable.insert(result, '-l' .. _MAKE.esc(path.getname(value)))\nend\nend\nreturn result\nend\nfunction premake.gcc.getarchiveflags(prj, cfg, ndx)\nlocal result = {}\nif cfg.platform:startswith(\"Universal\") then\nif prj.options.ArchiveSplit then\nerror(\"gcc tool 'Universal*' platforms do not support split archives\")\nend\ntable.insert(result, '-o')\nelse\nif (not prj.options.ArchiveSplit) then\nif premake.gcc.llvm then\ntable.insert(result, 'rcs')\nelse\ntable.insert(result, '-rcs')\nend\nelse\nif premake.gcc.llvm then\nif (not ndx) then\ntable.insert(result, 'qc')\nelse\ntable.insert(result, 'cs')\nend\nelse\nif (not ndx) then\ntable.insert(result, '-qc')\nelse\ntable.insert(result, '-cs')\nend\nend\nend\nend\nreturn result\nend\nfuncti"
- "on premake.gcc.getdefines(defines)\nlocal result = { }\nfor _,def in ipairs(defines) do\ntable.insert(result, \"-D\" .. def)\nend\nreturn result\nend\nfunction premake.gcc.getincludedirs(includedirs)\nlocal result = { }\nfor _,dir in ipairs(includedirs) do\ntable.insert(result, \"-I\\\"\" .. dir .. \"\\\"\")\nend\nreturn result\nend\nfunction premake.gcc.getquoteincludedirs(includedirs)\nlocal result = { }\nfor _,dir in ipairs(includedirs) do\ntable.insert(result, \"-iquote \\\"\" .. dir .. \"\\\"\")\nend\nreturn result\nend\nfunction premake.gcc.getcfgsettings(cfg)\nreturn platforms[cfg.platform].cfgsettings\nend\n",
+ "premake.gcc = { }\npremake.gcc.cc = \"gcc\"\npremake.gcc.cxx = \"g++\"\npremake.gcc.ar = \"ar\"\npremake.gcc.rc = \"windres\"\npremake.gcc.llvm = false\nlocal cflags =\n{\nEnableSSE = \"-msse\",\nEnableSSE2 = \"-msse2\",\nEnableAVX = \"-mavx\",\nEnableAVX2 = \"-mavx2\",\nPedanticWarnings = \"-Wall -Wextra -pedantic\",\nExtraWarnings = \"-Wall -Wextra\",\nFatalWarnings = \"-Werror\",\nFloatFast = \"-ffast-math\",\nFloatStrict = \"-ffloat-store\",\nNoFramePointer = \"-fomit-frame-pointer\",\nOptimize = \"-O2\",\nOptimizeSize = \"-Os\",\nOptimizeSpeed = \"-O3\",\nSymbols = \"-g\",\n}\nlocal cxxflags =\n{\nCpp11 = \"-std=c++11\",\nCpp14 = \"-std=c++14\",\nCpp17 = \"-std=c++17\",\nCppLatest = \"-std=c++2a\",\nNoExceptions = \"-fno-exceptions\",\nNoRTTI = \"-fno-rtti\",\nUnsignedChar = \"-funsigned-char\",\n}\nlocal objcflags =\n{\nObjcARC = \"-fobjc-arc\",\n}\npremake.gcc.platforms =\n{\nNative = {\n"
+ "cppflags = \"-MMD -MP\",\n},\nx32 = {\ncppflags = \"-MMD -MP\",\nflags = \"-m32\",\n},\nx64 = {\ncppflags = \"-MMD -MP\",\nflags = \"-m64\",\n},\nUniversal = {\nar = \"libtool\",\ncppflags = \"-MMD -MP\",\nflags = \"-arch i386 -arch x86_64 -arch ppc -arch ppc64\",\n},\nUniversal32 = {\nar = \"libtool\",\ncppflags = \"-MMD -MP\",\nflags = \"-arch i386 -arch ppc\",\n},\nUniversal64 = {\nar = \"libtool\",\ncppflags = \"-MMD -MP\",\nflags = \"-arch x86_64 -arch ppc64\",\n},\nPS3 = {\ncc = \"ppu-lv2-g++\",\ncxx = \"ppu-lv2-g++\",\nar = \"ppu-lv2-ar\",\ncppflags = \"-MMD -MP\",\n},\nWiiDev = {\ncppflags = \"-MMD -MP -I$(LIBOGC_INC) $(MACHDEP)\",\nldflags= \"-L$(LIBOGC_LIB) $(MACHDEP)\",\ncfgsettings = [[\n ifeq ($(strip $(DEVKITPPC)),)\n $(error \"DEVKITPPC environment variable is not set\")'\n endif\n include $(DEVKITPPC)/wii_rules']],\n},\nOrbis = {\ncc = \"orbis-clang\",\ncxx = \"orbis-clang++\",\nar = \"orbis-ar\",\ncppflag"
+ "s = \"-MMD -MP\",\n},\nEmscripten = {\ncc = \"$(EMSCRIPTEN)/emcc\",\ncxx = \"$(EMSCRIPTEN)/em++\",\nar = \"$(EMSCRIPTEN)/emar\",\ncppflags = \"-MMD -MP\",\n}\n}\nlocal platforms = premake.gcc.platforms\nfunction premake.gcc.getcppflags(cfg)\nlocal flags = { }\ntable.insert(flags, platforms[cfg.platform].cppflags)\nif flags[1]:startswith(\"-MMD\") then\ntable.insert(flags, \"-MP\")\nend\nreturn flags\nend\nfunction premake.gcc.getcflags(cfg)\nlocal result = table.translate(cfg.flags, cflags)\ntable.insert(result, platforms[cfg.platform].flags)\nif cfg.system ~= \"windows\" and cfg.kind == \"SharedLib\" then\ntable.insert(result, \"-fPIC\")\nend\nreturn result\nend\nfunction premake.gcc.getcxxflags(cfg)\nlocal result = table.translate(cfg.flags, cxxflags)\nreturn result\nend\nfunction premake.gcc.getobjcflags(cfg)\nreturn table.translate(cfg.flags, objcflags)\nend\nfunction premake.gcc.getldflags(cfg)\nlocal result = { }\nif not cfg.flags.Symbols then\nif cfg.system == \"macosx\" then"
+ "\nelse\ntable.insert(result, \"-s\")\nend\nend\nif cfg.kind == \"Bundle\" then\ntable.insert(result, \"-bundle\")\nend\nif cfg.kind == \"SharedLib\" then\nif cfg.system == \"macosx\" then\ntable.insert(result, \"-dynamiclib\")\nelse\ntable.insert(result, \"-shared\")\nend\nif cfg.system == \"windows\" and not cfg.flags.NoImportLib then\ntable.insert(result, '-Wl,--out-implib=\"' .. cfg.linktarget.fullpath .. '\"')\nend\nend\nif cfg.kind == \"WindowedApp\" and cfg.system == \"windows\" then\ntable.insert(result, \"-mwindows\")\nend\nlocal platform = platforms[cfg.platform]\ntable.insert(result, platform.flags)\ntable.insert(result, platform.ldflags)\nreturn result\nend\nfunction premake.gcc.getlibdirflags(cfg)\nlocal result = { }\nfor _, value in ipairs(premake.getlinks(cfg, \"all\", \"directory\")) do\ntable.insert(result, '-L\\\"' .. value .. '\\\"')\nend\nreturn result\nend\nfunction premake.gcc.islibfile(p)\nif path.getextension(p) == \".a\" then\nreturn true\nend\nreturn false\nend\nfunction premake.gcc.ge"
+ "tlibfiles(cfg)\nlocal result = {}\nfor _, value in ipairs(premake.getlinks(cfg, \"system\", \"fullpath\")) do\nif premake.gcc.islibfile(value) then\ntable.insert(result, _MAKE.esc(value))\nend\nend\nreturn result\nend\nfunction premake.gcc.getlinkflags(cfg)\nlocal result = {}\nfor _, value in ipairs(premake.getlinks(cfg, \"system\", \"fullpath\")) do\nif premake.gcc.islibfile(value) then\nvalue = path.rebase(value, cfg.project.location, cfg.location)\ntable.insert(result, _MAKE.esc(value))\nelseif path.getextension(value) == \".framework\" then\ntable.insert(result, '-framework ' .. _MAKE.esc(path.getbasename(value)))\nelse\ntable.insert(result, '-l' .. _MAKE.esc(path.getname(value)))\nend\nend\nreturn result\nend\nfunction premake.gcc.wholearchive(lib)\nif premake.gcc.llvm then\nreturn {\"-force_load\", lib}\nelse\nreturn {\"-Wl,--whole-archive\", lib, \"-Wl,--no-whole-archive\"}\nend\nend\nfunction premake.gcc.getarchiveflags(prj, cfg, ndx)\nlocal result = {}\nif cfg.platform:startswith(\"Universal\") then\n"
+ "if prj.options.ArchiveSplit then\nerror(\"gcc tool 'Universal*' platforms do not support split archives\")\nend\ntable.insert(result, '-o')\nelse\nif (not prj.options.ArchiveSplit) then\nif premake.gcc.llvm then\ntable.insert(result, 'rcs')\nelse\ntable.insert(result, '-rcs')\nend\nelse\nif premake.gcc.llvm then\nif (not ndx) then\ntable.insert(result, 'qc')\nelse\ntable.insert(result, 'cs')\nend\nelse\nif (not ndx) then\ntable.insert(result, '-qc')\nelse\ntable.insert(result, '-cs')\nend\nend\nend\nend\nreturn result\nend\nfunction premake.gcc.getdefines(defines)\nlocal result = { }\nfor _,def in ipairs(defines) do\ntable.insert(result, \"-D\" .. def)\nend\nreturn result\nend\nfunction premake.gcc.getincludedirs(includedirs)\nlocal result = { }\nfor _,dir in ipairs(includedirs) do\ntable.insert(result, \"-I\\\"\" .. dir .. \"\\\"\")\nend\nreturn result\nend\nfunction premake.gcc.getquoteincludedirs(includedirs)\nlocal result = { }\nfor _,dir in ipairs(includedirs) do\ntable.insert(result, \"-iquote \\\"\" .. "
+ "dir .. \"\\\"\")\nend\nreturn result\nend\nfunction premake.gcc.getsystemincludedirs(includedirs)\nlocal result = { }\nfor _,dir in ipairs(includedirs) do\ntable.insert(result, \"-isystem \\\"\" .. dir .. \"\\\"\")\nend\nreturn result\nend\nfunction premake.gcc.getcfgsettings(cfg)\nreturn platforms[cfg.platform].cfgsettings\nend\n",
/* tools/ghs.lua */
"premake.ghs = { }\npremake.ghs.namestyle = \"PS3\"\npremake.ghs.cc = \"ccppc\"\npremake.ghs.cxx = \"cxppc\"\npremake.ghs.ar = \"cxppc\"\nlocal cflags =\n{\nFatalWarnings = \"--quit_after_warnings\",\nOptimize = \"-Ogeneral\",\nOptimizeSize = \"-Osize\",\nOptimizeSpeed = \"-Ospeed\",\nSymbols = \"-g\",\n}\nlocal cxxflags =\n{\nNoExceptions = \"--no_exceptions\",\nNoRTTI = \"--no_rtti\",\nUnsignedChar = \"--unsigned_chars\",\n}\npremake.ghs.platforms =\n{\nNative = {\ncppflags = \"-MMD\",\n},\nPowerPC = {\ncc = \"ccppc\",\ncxx = \"cxppc\",\nar = \"cxppc\",\ncppflags = \"-MMD\",\narflags = \"-archive -o\",\n},\nARM = {\ncc = \"ccarm\",\ncxx = \"cxarm\",\nar = \"cxarm\",\ncppflags = \"-MMD\",\narflags = \"-archive -o\",\n}\n}\nlocal platforms = premake.ghs.platforms\nfunction premake.ghs.getcppflags(cfg)\nlocal flags = { }\ntable.insert(flags, platforms[cfg.platform].cppflags)\nreturn flags\nend\nfunction premake.ghs.getcf"
@@ -181,8 +190,8 @@ const char* builtin_scripts[] = {
"function premake.showhelp()\nprintf(\"\")\nprintf(\"Usage: genie [options] action [arguments]\")\nprintf(\"\")\nprintf(\"OPTIONS\")\nprintf(\"\")\nfor option in premake.option.each() do\nlocal trigger = option.trigger\nlocal description = option.description\nif (option.value) then trigger = trigger .. \"=\" .. option.value end\nif (option.allowed) then description = description .. \"; one of:\" end\nprintf(\" --%-15s %s\", trigger, description)\nif (option.allowed) then\nfor _, value in ipairs(option.allowed) do\nprintf(\" %-14s %s\", value[1], value[2])\nend\nend\nprintf(\"\")\nend\nprintf(\"ACTIONS\")\nprintf(\"\")\nfor action in premake.action.each() do\nprintf(\" %-17s %s\", action.trigger, action.description)\nend\nprintf(\"\")\nprintf(\"For additional information, see https://github.com/bkaradzic/genie\")\nend\n",
/* base/premake.lua */
- "premake._filelevelconfig = false\npremake._checkgenerate = true\nfunction premake.generate(obj, filename, callback)\nfilename = premake.project.getfilename(obj, filename)\nif (premake._checkgenerate) then\nio.capture()\ncallback(obj)\nlocal new = io.endcapture()\nlocal delta = false\nlocal f, err = io.open(filename, \"rb\")\nif (not f) then\nif string.find(err, \"No such file or directory\") then\ndelta = true\nelse\nerror(err, 0)\nend\nelse\nlocal existing = f:read(\"*all\")\nif existing ~= new then\ndelta = true\nend\nf:close()\nend\nif delta then\nprintf(\"Generating %s...\", filename)\nlocal f, err = io.open(filename, \"wb\")\nif (not f) then\nerror(err, 0)\nend\nf:write(new)\nf:close()\npremake.stats.num_generated = premake.stats.num_generated + 1\nelse\npremake.stats.num_skipped = premake.stats.num_skipped + 1\nend\nelse\nprintf(\"Generating %s...\", filename)\nlocal f, err = io.open(filename, \"wb\")\nif (not f) then\nerror(err, 0)\nend\nio.output(f)\ncallback(obj)\nf:close()\npremake.stats.num_generate"
- "d = premake.stats.num_generated + 1\nend\nend\nfunction premake.findDefaultScript(dir, search_upwards)\nsearch_upwards = search_upwards or true\nlocal last = \"\"\nwhile dir ~= last do\nfor _, name in ipairs({ \"genie.lua\", \"solution.lua\", \"premake4.lua\" }) do\nlocal script0 = dir .. \"/\" .. name\nif (os.isfile(script0)) then\nreturn dir, name\nend\nlocal script1 = dir .. \"/scripts/\" .. name\nif (os.isfile(script1)) then\nreturn dir .. \"/scripts/\", name\nend\nend\nlast = dir\ndir = path.getabsolute(dir .. \"/..\")\nif dir == \".\" or not search_upwards then break end\nend\nreturn nil, nil\nend\n",
+ "premake._filelevelconfig = false\npremake._checkgenerate = true\nfunction premake.generate(obj, filename, callback)\nlocal prev = io.capture()\nlocal abort = (callback(obj) == false)\nlocal new = io.endcapture(prev)\nif abort then\npremake.stats.num_skipped = premake.stats.num_skipped + 1\nreturn\nend\nfilename = premake.project.getfilename(obj, filename)\nif (premake._checkgenerate) then\nlocal delta = false\nlocal f, err = io.open(filename, \"rb\")\nif (not f) then\nif string.find(err, \"No such file or directory\") then\ndelta = true\nelse\nerror(err, 0)\nend\nelse\nlocal existing = f:read(\"*all\")\nif existing ~= new then\ndelta = true\nend\nf:close()\nend\nif delta then\nprintf(\"Generating %s...\", filename)\nlocal f, err = io.open(filename, \"wb\")\nif (not f) then\nerror(err, 0)\nend\nf:write(new)\nf:close()\npremake.stats.num_generated = premake.stats.num_generated + 1\nelse\npremake.stats.num_skipped = premake.stats.num_skipped + 1\nend\nelse\nprintf(\"Generating %s...\", filename)\nlocal f, err "
+ "= io.open(filename, \"wb\")\nif (not f) then\nerror(err, 0)\nend\nf:write(new)\nf:close()\npremake.stats.num_generated = premake.stats.num_generated + 1\nend\nend\nfunction premake.findDefaultScript(dir, search_upwards)\nsearch_upwards = search_upwards or true\nlocal last = \"\"\nwhile dir ~= last do\nfor _, name in ipairs({ \"genie.lua\", \"solution.lua\", \"premake4.lua\" }) do\nlocal script0 = dir .. \"/\" .. name\nif (os.isfile(script0)) then\nreturn dir, name\nend\nlocal script1 = dir .. \"/scripts/\" .. name\nif (os.isfile(script1)) then\nreturn dir .. \"/scripts/\", name\nend\nend\nlast = dir\ndir = path.getabsolute(dir .. \"/..\")\nif dir == \".\" or not search_upwards then break end\nend\nreturn nil, nil\nend\n",
/* base/iter.lua */
"iter = {}\nfunction iter.sortByKeys(arr, f)\nlocal a = table.keys(arr)\ntable.sort(a, f)\nlocal i = 0\nreturn function()\ni = i + 1\nif a[i] ~= nil then \nreturn a[i], arr[a[i]]\nend\nend\nend\n",
@@ -199,50 +208,53 @@ const char* builtin_scripts[] = {
/* actions/cmake/cmake_project.lua */
"local cmake = premake.cmake\nlocal tree = premake.tree\nlocal includestr = 'include_directories(../%s)'\nlocal definestr = 'add_definitions(-D%s)'\nlocal function is_excluded(prj, cfg, file)\n if table.icontains(prj.excludes, file) then\n return true\n end\n if table.icontains(cfg.excludes, file) then\n return true\n end\n return false\nend\nfunction cmake.excludedFiles(prj, cfg, src)\n for _, v in ipairs(src) do\n if (is_excluded(prj, cfg, v)) then\n _p(1, 'list(REMOVE_ITEM source_list ../%s)', v)\n end\n end\nend\nfunction cmake.list(value)\n if #value > 0 then\n return \" \" .. table.concat(value, \" \")\n else\n return \"\"\n end\nend\nfunction cmake.files(prj)\n local ret = {}\n local tr = premake.project.buildsourcetree(prj)\n tree.traverse(tr, {\n onbranchenter = function(node, depth)\n end,\n onbranchexit = function(node, depth)\n end,\n onleaf = function(node, depth)\n "
- " table.insert(ret, node.cfg.name)\n _p(1, '../%s', node.cfg.name)\n end,\n }, true, 1)\n return ret\nend\nfunction cmake.header(prj)\n _p('# %s project autogenerated by GENie', premake.action.current().shortname)\n _p('cmake_minimum_required(VERSION 2.8.4)')\n _p('')\n _p('project(%s)', premake.esc(prj.name))\nend\nfunction cmake.customtasks(prj)\n local dirs = {}\n local tasks = {}\n for _, custombuildtask in ipairs(prj.custombuildtask or {}) do\n for _, buildtask in ipairs(custombuildtask or {}) do\n table.insert(tasks, buildtask)\n local d = string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s\", path.getdirectory(path.getrelative(prj.location, buildtask[2])))\n if not table.contains(dirs, d) then\n table.insert(dirs, d)\n _p('file(MAKE_DIRECTORY \\\"%s\\\")', d)\n end\n end\n end\n _p('')\n for _, buildtask in ipairs(tasks) do\n local deps = string.format(\"${"
- "CMAKE_CURRENT_SOURCE_DIR}/../%s \", path.getrelative(prj.location, buildtask[1]))\n local outputs = string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s \", path.getrelative(prj.location, buildtask[2]))\n local msg = \"\"\n for _, depdata in ipairs(buildtask[3] or {}) do\n deps = deps .. string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s \", path.getrelative(prj.location, depdata))\n end\n _p('add_custom_command(')\n _p(1, 'OUTPUT %s', outputs)\n _p(1, 'DEPENDS %s', deps)\n for _, cmdline in ipairs(buildtask[4] or {}) do\n if (cmdline:sub(1, 1) ~= \"@\") then\n local cmd = cmdline\n local num = 1\n for _, depdata in ipairs(buildtask[3] or {}) do\n cmd = string.gsub(cmd, \"%$%(\" .. num .. \"%)\", string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s \", path.getrelative(prj.location, depdata)))\n num = num + 1\n end\n cmd = string"
- ".gsub(cmd, \"%$%(<%)\", string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s \", path.getrelative(prj.location, buildtask[1])))\n cmd = string.gsub(cmd, \"%$%(@%)\", outputs)\n _p(1, 'COMMAND %s', cmd)\n else\n msg = cmdline\n end\n end\n _p(1, 'COMMENT \\\"%s\\\"', msg)\n _p(')')\n _p('')\n end\nend\nfunction cmake.depRules(prj)\n local maintable = {}\n for _, dependency in ipairs(prj.dependency) do\n for _, dep in ipairs(dependency) do\n if path.issourcefile(dep[1]) then\n local dep1 = premake.esc(path.getrelative(prj.location, dep[1]))\n local dep2 = premake.esc(path.getrelative(prj.location, dep[2]))\n if not maintable[dep1] then maintable[dep1] = {} end\n table.insert(maintable[dep1], dep2)\n end\n end\n end\n for key, _ in pairs(maintable) do\n local deplist = {}\n local depsname = string.fo"
- "rmat('%s_deps', path.getname(key))\n for _, d2 in pairs(maintable[key]) do\n table.insert(deplist, d2)\n end\n _p('set(')\n _p(1, depsname)\n for _, v in pairs(deplist) do\n _p(1, '${CMAKE_CURRENT_SOURCE_DIR}/../%s', v)\n end\n _p(')')\n _p('')\n _p('set_source_files_properties(')\n _p(1, '\\\"${CMAKE_CURRENT_SOURCE_DIR}/../%s\\\"', key)\n _p(1, 'PROPERTIES OBJECT_DEPENDS \\\"${%s}\\\"', depsname)\n _p(')')\n _p('')\n end\nend\nfunction cmake.commonRules(conf, str)\n local Dupes = {}\n local t2 = {}\n for _, cfg in ipairs(conf) do\n local cfgd = iif(str == includestr, cfg.includedirs, cfg.defines)\n for _, v in ipairs(cfgd) do\n if(t2[v] == #conf - 1) then\n _p(str, v)\n table.insert(Dupes, v)\n end\n if not t2[v] then\n t2[v] = 1\n else\n t2[v] = t2[v] + 1\n e"
- "nd\n end\n end\n return Dupes\nend\nfunction cmake.cfgRules(cfg, dupes, str)\n for _, v in ipairs(cfg) do\n if (not table.icontains(dupes, v)) then\n _p(1, str, v)\n end\n end\nend\nfunction cmake.removeCrosscompiler(platforms)\n for i = #platforms, 1, -1 do\n if premake.platforms[platforms[i]].iscrosscompiler then\n table.remove(platforms, i)\n end\n end\nend\nfunction cmake.project(prj)\n io.indent = \" \"\n cmake.header(prj)\n _p('set(')\n _p('source_list')\n local source_files = cmake.files(prj)\n _p(')')\n _p('')\n local nativeplatform = iif(os.is64bit(), \"x64\", \"x32\")\n local cc = premake.gettool(prj)\n local platforms = premake.filterplatforms(prj.solution, cc.platforms, \"Native\")\n cmake.removeCrosscompiler(platforms)\n local configurations = {}\n for _, platform in ipairs(platforms) do\n for cfg in premake.eachconfig(prj, platform) do\n -- TODO: Extend support for "
- "32-bit targets on 64-bit hosts\n if cfg.platform == nativeplatform then\n table.insert(configurations, cfg)\n end\n end\n end\n local commonIncludes = cmake.commonRules(configurations, includestr)\n local commonDefines = cmake.commonRules(configurations, definestr)\n _p('')\n for _, cfg in ipairs(configurations) do\n _p('if(CMAKE_BUILD_TYPE MATCHES \\\"%s\\\")', cfg.name)\n -- list excluded files\n cmake.excludedFiles(prj, cfg, source_files)\n -- add includes directories\n cmake.cfgRules(cfg.includedirs, commonIncludes, includestr)\n -- add build defines\n cmake.cfgRules(cfg.defines, commonDefines, definestr)\n -- set CXX flags\n _p(1, 'set(CMAKE_CXX_FLAGS \\\"${CMAKE_CXX_FLAGS} %s\\\")', cmake.list(table.join(cc.getcppflags(cfg), cc.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp)))\n -- set C flags\n _p(1, 'set(CMAKE_C_FLAGS \\\"${CMAKE_C_FLAGS} %"
- "s\\\")', cmake.list(table.join(cc.getcppflags(cfg), cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)))\n _p('endif()')\n _p('')\n end\n -- force CPP if needed\n if (prj.options.ForceCPP) then\n _p('set_source_files_properties(${source_list} PROPERTIES LANGUAGE CXX)')\n end\n -- add custom tasks\n cmake.customtasks(prj)\n -- per-dependency build rules\n cmake.depRules(prj)\n for _, cfg in ipairs(configurations) do\n _p('if(CMAKE_BUILD_TYPE MATCHES \\\"%s\\\")', cfg.name)\n if (prj.kind == 'StaticLib') then\n _p(1, 'add_library(%s STATIC ${source_list})', premake.esc(cfg.buildtarget.basename))\n end\n if (prj.kind == 'SharedLib') then\n _p(1, 'add_library(%s SHARED ${source_list})', premake.esc(cfg.buildtarget.basename))\n end\n if (prj.kind == 'ConsoleApp' or prj.kind == 'WindowedApp') then\n _p(1, 'add_executable(%s ${source_list})', premake.esc(cfg.buildtarget.basename))\n "
- " _p(1, 'target_link_libraries(%s%s%s)', premake.esc(cfg.buildtarget.basename), cmake.list(premake.esc(premake.getlinks(cfg, \"siblings\", \"basename\"))), cmake.list(cc.getlinkflags(cfg)))\n end\n _p('endif()')\n _p('')\n end\nend",
+ " assert(node, \"unexpected empty node\")\n if node.cfg then\n table.insert(ret, node.cfg.name)\n _p(1, '../%s', node.cfg.name)\n end\n end,\n }, true, 1)\n return ret\nend\nfunction cmake.header(prj)\n _p('# %s project autogenerated by GENie', premake.action.current().shortname)\n _p('cmake_minimum_required(VERSION 2.8.4)')\n _p('')\n _p('project(%s)', premake.esc(prj.name))\nend\nfunction cmake.customtasks(prj)\n local dirs = {}\n local tasks = {}\n for _, custombuildtask in ipairs(prj.custombuildtask or {}) do\n for _, buildtask in ipairs(custombuildtask or {}) do\n table.insert(tasks, buildtask)\n local d = string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s\", path.getdirectory(path.getrelative(prj.location, buildtask[2])))\n if not table.contains(dirs, d) then\n table.insert(dirs, d)\n _p('file(MAKE_DIRECTORY \\\"%s\\\")', d)\n end\n "
+ " end\n end\n _p('')\n for _, buildtask in ipairs(tasks) do\n local deps = string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s \", path.getrelative(prj.location, buildtask[1]))\n local outputs = string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s \", path.getrelative(prj.location, buildtask[2]))\n local msg = \"\"\n for _, depdata in ipairs(buildtask[3] or {}) do\n deps = deps .. string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s \", path.getrelative(prj.location, depdata))\n end\n _p('add_custom_command(')\n _p(1, 'OUTPUT %s', outputs)\n _p(1, 'DEPENDS %s', deps)\n for _, cmdline in ipairs(buildtask[4] or {}) do\n if (cmdline:sub(1, 1) ~= \"@\") then\n local cmd = cmdline\n local num = 1\n for _, depdata in ipairs(buildtask[3] or {}) do\n cmd = string.gsub(cmd, \"%$%(\" .. num .. \"%)\", string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s \", path.getrelative(pr"
+ "j.location, depdata)))\n num = num + 1\n end\n cmd = string.gsub(cmd, \"%$%(<%)\", string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s \", path.getrelative(prj.location, buildtask[1])))\n cmd = string.gsub(cmd, \"%$%(@%)\", outputs)\n _p(1, 'COMMAND %s', cmd)\n else\n msg = cmdline\n end\n end\n _p(1, 'COMMENT \\\"%s\\\"', msg)\n _p(')')\n _p('')\n end\nend\nfunction cmake.depRules(prj)\n local maintable = {}\n for _, dependency in ipairs(prj.dependency) do\n for _, dep in ipairs(dependency) do\n if path.issourcefile(dep[1]) then\n local dep1 = premake.esc(path.getrelative(prj.location, dep[1]))\n local dep2 = premake.esc(path.getrelative(prj.location, dep[2]))\n if not maintable[dep1] then maintable[dep1] = {} end\n table.insert(maintable[dep1], dep2)\n end\n end\n "
+ " end\n for key, _ in pairs(maintable) do\n local deplist = {}\n local depsname = string.format('%s_deps', path.getname(key))\n for _, d2 in pairs(maintable[key]) do\n table.insert(deplist, d2)\n end\n _p('set(')\n _p(1, depsname)\n for _, v in pairs(deplist) do\n _p(1, '${CMAKE_CURRENT_SOURCE_DIR}/../%s', v)\n end\n _p(')')\n _p('')\n _p('set_source_files_properties(')\n _p(1, '\\\"${CMAKE_CURRENT_SOURCE_DIR}/../%s\\\"', key)\n _p(1, 'PROPERTIES OBJECT_DEPENDS \\\"${%s}\\\"', depsname)\n _p(')')\n _p('')\n end\nend\nfunction cmake.commonRules(conf, str)\n local Dupes = {}\n local t2 = {}\n for _, cfg in ipairs(conf) do\n local cfgd = iif(str == includestr, cfg.includedirs, cfg.defines)\n for _, v in ipairs(cfgd) do\n if(t2[v] == #conf - 1) then\n _p(str, v)\n table.insert(Dupes, v)\n end\n if n"
+ "ot t2[v] then\n t2[v] = 1\n else\n t2[v] = t2[v] + 1\n end\n end\n end\n return Dupes\nend\nfunction cmake.cfgRules(cfg, dupes, str)\n for _, v in ipairs(cfg) do\n if (not table.icontains(dupes, v)) then\n _p(1, str, v)\n end\n end\nend\nfunction cmake.removeCrosscompiler(platforms)\n for i = #platforms, 1, -1 do\n if premake.platforms[platforms[i]].iscrosscompiler then\n table.remove(platforms, i)\n end\n end\nend\nfunction cmake.project(prj)\n io.indent = \" \"\n cmake.header(prj)\n _p('set(')\n _p('source_list')\n local source_files = cmake.files(prj)\n _p(')')\n _p('')\n local nativeplatform = iif(os.is64bit(), \"x64\", \"x32\")\n local cc = premake.gettool(prj)\n local platforms = premake.filterplatforms(prj.solution, cc.platforms, \"Native\")\n cmake.removeCrosscompiler(platforms)\n local configurations = {}\n for _, platform in ipairs(plat"
+ "forms) do\n for cfg in premake.eachconfig(prj, platform) do\n -- TODO: Extend support for 32-bit targets on 64-bit hosts\n if cfg.platform == nativeplatform then\n table.insert(configurations, cfg)\n end\n end\n end\n local commonIncludes = cmake.commonRules(configurations, includestr)\n local commonDefines = cmake.commonRules(configurations, definestr)\n _p('')\n for _, cfg in ipairs(configurations) do\n _p('if(CMAKE_BUILD_TYPE MATCHES \\\"%s\\\")', cfg.name)\n -- list excluded files\n cmake.excludedFiles(prj, cfg, source_files)\n -- add includes directories\n cmake.cfgRules(cfg.includedirs, commonIncludes, includestr)\n -- add build defines\n cmake.cfgRules(cfg.defines, commonDefines, definestr)\n -- set CXX flags\n _p(1, 'set(CMAKE_CXX_FLAGS \\\"${CMAKE_CXX_FLAGS} %s\\\")', cmake.list(table.join(cc.getcppflags(cfg), cc.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptio"
+ "ns, cfg.buildoptions_cpp)))\n -- set C flags\n _p(1, 'set(CMAKE_C_FLAGS \\\"${CMAKE_C_FLAGS} %s\\\")', cmake.list(table.join(cc.getcppflags(cfg), cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)))\n _p('endif()')\n _p('')\n end\n -- force CPP if needed\n if (prj.options.ForceCPP) then\n _p('set_source_files_properties(${source_list} PROPERTIES LANGUAGE CXX)')\n end\n -- add custom tasks\n cmake.customtasks(prj)\n -- per-dependency build rules\n cmake.depRules(prj)\n for _, cfg in ipairs(configurations) do\n _p('if(CMAKE_BUILD_TYPE MATCHES \\\"%s\\\")', cfg.name)\n if (prj.kind == 'StaticLib') then\n _p(1, 'add_library(%s STATIC ${source_list})', premake.esc(cfg.buildtarget.basename))\n end\n if (prj.kind == 'SharedLib') then\n _p(1, 'add_library(%s SHARED ${source_list})', premake.esc(cfg.buildtarget.basename))\n end\n if (prj.kind == 'ConsoleApp' or prj.kind == 'WindowedApp') t"
+ "hen\n _p(1, 'add_executable(%s ${source_list})', premake.esc(cfg.buildtarget.basename))\n _p(1, 'target_link_libraries(%s%s%s)', premake.esc(cfg.buildtarget.basename), cmake.list(premake.esc(premake.getlinks(cfg, \"siblings\", \"basename\"))), cmake.list(cc.getlinkflags(cfg)))\n end\n _p('endif()')\n _p('')\n end\nend",
/* actions/make/_make.lua */
- "_MAKE = { }\npremake.make = { }\nlocal make = premake.make\nfunction _MAKE.esc(value)\nlocal result\nif (type(value) == \"table\") then\nresult = { }\nfor _,v in ipairs(value) do\ntable.insert(result, _MAKE.esc(v))\nend\nreturn result\nelse\nresult = value:gsub(\"\\\\\", \"\\\\\\\\\")\nresult = result:gsub(\" \", \"\\\\ \")\nresult = result:gsub(\"%%(\", \"\\\\%(\")\nresult = result:gsub(\"%%)\", \"\\\\%)\")\nresult = result:gsub(\"$\\\\%((.-)\\\\%)\", \"$%(%1%)\")\nreturn result\nend\nend\nfunction premake.make_copyrule(source, target)\n_p('%s: %s', target, source)\n_p('\\t@echo Copying $(notdir %s)', target)\n_p('\\t-$(call COPY,%s,%s)', source, target)\nend\nfunction premake.make_mkdirrule(var)\n_p('\\t@echo Creating %s', var)\n_p('\\t-$(call MKDIR,%s)', var)\n_p('')\nend\nfunction make.list(value)\nif #value > 0 then\nreturn \" \" .. table.concat(value, \" \")\nelse\nreturn \"\"\nend\nend\nfunction _MAKE.getmakefilename(this, searchprjs)\nlocal count = 0\nfor sln in premake.solution.each() do\nif (sln.loca"
- "tion == this.location) then count = count + 1 end\nif (searchprjs) then\nfor _,prj in ipairs(sln.projects) do\nif (prj.location == this.location) then count = count + 1 end\nend\nend\nend\nif (count == 1) then\nreturn \"Makefile\"\nelse\nreturn this.name .. \".make\"\nend\nend\nfunction _MAKE.getnames(tbl)\nlocal result = table.extract(tbl, \"name\")\nfor k,v in pairs(result) do\nresult[k] = _MAKE.esc(v)\nend\nreturn result\nend\nfunction make.settings(cfg, cc)\nif #cfg.makesettings > 0 then\nfor _, value in ipairs(cfg.makesettings) do\n_p(value)\nend\nend\nlocal toolsettings = cc.platforms[cfg.platform].cfgsettings\nif toolsettings then\n_p(toolsettings)\nend\nend\nnewaction {\ntrigger = \"gmake\",\nshortname = \"GNU Make\",\ndescription = \"Generate GNU makefiles for POSIX, MinGW, and Cygwin\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\", \"C#\", \"Vala\", \"Swift\" },\nvalid_tools = {\ncc = { "
- "\"gcc\", \"ghs\" },\ndotnet = { \"mono\", \"msnet\", \"pnet\" },\nvalac = { \"valac\" },\nswift = { \"swift\" },\n},\nonsolution = function(sln)\npremake.generate(sln, _MAKE.getmakefilename(sln, false), premake.make_solution)\nend,\nonproject = function(prj)\nlocal makefile = _MAKE.getmakefilename(prj, true)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, makefile, premake.make_csharp)\nelseif premake.iscppproject(prj) then\npremake.generate(prj, makefile, premake.make_cpp)\nelseif premake.isswiftproject(prj) then\npremake.generate(prj, makefile, premake.make_swift)\nelse\npremake.generate(prj, makefile, premake.make_vala)\nend\nend,\noncleansolution = function(sln)\npremake.clean.file(sln, _MAKE.getmakefilename(sln, false))\nend,\noncleanproject = function(prj)\npremake.clean.file(prj, _MAKE.getmakefilename(prj, true))\nend\n}\n",
+ "_MAKE = { }\npremake.make = { }\nlocal make = premake.make\nfunction _MAKE.esc(value)\nlocal result\nif (type(value) == \"table\") then\nresult = { }\nfor _,v in ipairs(value) do\ntable.insert(result, _MAKE.esc(v))\nend\nreturn result\nelse\nresult = value:gsub(\"\\\\\", \"\\\\\\\\\")\nresult = result:gsub(\" \", \"\\\\ \")\nresult = result:gsub(\"%%(\", \"\\\\%(\")\nresult = result:gsub(\"%%)\", \"\\\\%)\")\nresult = result:gsub(\"$\\\\%((.-)\\\\%)\", \"$%(%1%)\")\nreturn result\nend\nend\nfunction _MAKE.escquote(value)\nlocal result\nif (type(value) == \"table\") then\nresult = { }\nfor _,v in ipairs(value) do\ntable.insert(result, _MAKE.escquote(v))\nend\nreturn result\nelse\nresult = value:gsub(\" \", \"\\\\ \")\nresult = result:gsub(\"\\\"\", \"\\\\\\\"\")\nreturn result\nend\nend\nfunction premake.make_copyrule(source, target)\n_p('%s: %s', target, source)\n_p('\\t@echo Copying $(notdir %s)', target)\n_p('\\t-$(call COPY,%s,%s)', source, target)\nend\nfunction premake.make_mkdirrule(var)\n_p('\\t@echo Cr"
+ "eating %s', var)\n_p('\\t-$(call MKDIR,%s)', var)\n_p('')\nend\nfunction make.list(value)\nif #value > 0 then\nreturn \" \" .. table.concat(value, \" \")\nelse\nreturn \"\"\nend\nend\nfunction _MAKE.getmakefilename(this, searchprjs)\nlocal count = 0\nfor sln in premake.solution.each() do\nif (sln.location == this.location) then count = count + 1 end\nif (searchprjs) then\nfor _,prj in ipairs(sln.projects) do\nif (prj.location == this.location) then count = count + 1 end\nend\nend\nend\nif (count == 1) then\nreturn \"Makefile\"\nelse\nreturn this.name .. \".make\"\nend\nend\nfunction _MAKE.getnames(tbl)\nlocal result = table.extract(tbl, \"name\")\nfor k,v in pairs(result) do\nresult[k] = _MAKE.esc(v)\nend\nreturn result\nend\nfunction make.settings(cfg, cc)\nif #cfg.makesettings > 0 then\nfor _, value in ipairs(cfg.makesettings) do\n_p(value)\nend\nend\nlocal toolsettings = cc.platforms[cfg.platform].cfgsettings\nif toolsettings then\n_p(toolsettings)\nend\nend\nnewaction {\ntrigger = \"gmake\",\nshort"
+ "name = \"GNU Make\",\ndescription = \"Generate GNU makefiles for POSIX, MinGW, and Cygwin\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\", \"C#\", \"Vala\", \"Swift\" },\nvalid_tools = {\ncc = { \"gcc\", \"ghs\" },\ndotnet = { \"mono\", \"msnet\", \"pnet\" },\nvalac = { \"valac\" },\nswift = { \"swift\" },\n},\nonsolution = function(sln)\npremake.generate(sln, _MAKE.getmakefilename(sln, false), premake.make_solution)\nend,\nonproject = function(prj)\nlocal makefile = _MAKE.getmakefilename(prj, true)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, makefile, premake.make_csharp)\nelseif premake.iscppproject(prj) then\npremake.generate(prj, makefile, premake.make_cpp)\nelseif premake.isswiftproject(prj) then\npremake.generate(prj, makefile, premake.make_swift)\nelse\npremake.generate(prj, makefile, premake.make_vala)\nend\nend,\noncleansolution = function(sln)\npremake.clean.file(sln, _MAKE.ge"
+ "tmakefilename(sln, false))\nend,\noncleanproject = function(prj)\npremake.clean.file(prj, _MAKE.getmakefilename(prj, true))\nend,\ngmake = {}\n}\n",
/* actions/make/make_solution.lua */
"function premake.make_solution(sln)\nlocal cc = premake[_OPTIONS.cc]\nlocal platforms = premake.filterplatforms(sln, cc.platforms, \"Native\")\n_p('# %s solution makefile autogenerated by GENie', premake.action.current().shortname)\n_p('# Type \"make help\" for usage help')\n_p('')\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(premake.getconfigname(sln.configurations[1], platforms[1], true)))\n_p('endif')\n_p('export config')\n_p('')\nlocal projects = table.extract(sln.projects, \"name\")\ntable.sort(projects)\n_p('PROJECTS := %s', table.concat(_MAKE.esc(projects), \" \"))\n_p('')\n_p('.PHONY: all clean help $(PROJECTS)')\n_p('')\n_p('all: $(PROJECTS)')\n_p('')\nfor _, prj in ipairs(sln.projects) do\n_p('%s: %s', _MAKE.esc(prj.name), table.concat(_MAKE.esc(table.extract(premake.getdependencies(prj), \"name\")), \" \"))\nif (not sln.messageskip) or (not table.contains(sln.messageskip, \"SkipBuildingMessage\")) then\n_p('\\t@echo \"==== Building %s ($(config)) ====\"', prj.name)\nend\n_p('\\t@${MAKE} --no-pr"
"int-directory -C %s -f %s', _MAKE.esc(path.getrelative(sln.location, prj.location)), _MAKE.esc(_MAKE.getmakefilename(prj, true)))\n_p('')\nend\n_p('clean:')\nfor _ ,prj in ipairs(sln.projects) do\n_p('\\t@${MAKE} --no-print-directory -C %s -f %s clean', _MAKE.esc(path.getrelative(sln.location, prj.location)), _MAKE.esc(_MAKE.getmakefilename(prj, true)))\nend\n_p('')\n_p('help:')\n_p(1,'@echo \"Usage: make [config=name] [target]\"')\n_p(1,'@echo \"\"')\n_p(1,'@echo \"CONFIGURATIONS:\"')\nlocal cfgpairs = { }\nfor _, platform in ipairs(platforms) do\nfor _, cfgname in ipairs(sln.configurations) do\n_p(1,'@echo \" %s\"', premake.getconfigname(cfgname, platform, true))\nend\nend\n_p(1,'@echo \"\"')\n_p(1,'@echo \"TARGETS:\"')\n_p(1,'@echo \" all (default)\"')\n_p(1,'@echo \" clean\"')\nfor _, prj in ipairs(sln.projects) do\n_p(1,'@echo \" %s\"', prj.name)\nend\n_p(1,'@echo \"\"')\n_p(1,'@echo \"For more information, see https://github.com/bkaradzic/genie\"')\nend\n",
/* actions/make/make_cpp.lua */
- "premake.make.cpp = { }\npremake.make.override = { }\npremake.make.makefile_ignore = false\nlocal cpp = premake.make.cpp\nlocal make = premake.make\nfunction premake.make_cpp(prj)\nlocal cc = premake.gettool(prj)\nlocal platforms = premake.filterplatforms(prj.solution, cc.platforms, \"Native\")\npremake.gmake_cpp_header(prj, cc, platforms)\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\npremake.gmake_cpp_config(prj, cfg, cc)\nend\nend\ntable.sort(prj.allfiles)\nlocal objdirs = {}\nlocal additionalobjdirs = {}\nfor _, file in ipairs(prj.allfiles) do\nif path.issourcefile(file) then\nobjdirs[_MAKE.esc(path.getdirectory(path.trimdots(file)))] = 1\nend\nend\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nadditionalobjdirs[_MAKE.esc(path.getdirectory(path.getrelative(prj.location,buildtask[2])))] = 1\nend\nend\n_p('OBJDIRS := \\\\')\n_p('\\t$(OBJDIR) \\\\')\nfor dir, _ in iter.sortByKeys(objdirs) do\n_p("
- "'\\t$(OBJDIR)/%s \\\\', dir)\nend\nfor dir, _ in iter.sortByKeys(additionalobjdirs) do\n_p('\\t%s \\\\', dir)\nend\n_p('')\n_p('RESOURCES := \\\\')\nfor _, file in ipairs(prj.allfiles) do\nif path.isresourcefile(file) then\n_p('\\t$(OBJDIR)/%s.res \\\\', _MAKE.esc(path.getbasename(file)))\nend\nend\n_p('')\n_p('.PHONY: clean prebuild prelink')\n_p('')\nif os.is(\"MacOSX\") and prj.kind == \"WindowedApp\" then\n_p('all: $(OBJDIRS) $(TARGETDIR) prebuild prelink $(TARGET) $(dir $(TARGETDIR))PkgInfo $(dir $(TARGETDIR))Info.plist')\nelse\n_p('all: $(OBJDIRS) $(TARGETDIR) prebuild prelink $(TARGET)')\nend\n_p('\\t@:')\n_p('')\nif (prj.kind == \"StaticLib\" and prj.options.ArchiveSplit) then\n_p('define max_args')\n_p('\\t$(eval _args:=)')\n_p('\\t$(foreach obj,$3,$(eval _args+=$(obj))$(if $(word $2,$(_args)),$1$(_args)$(EOL)$(eval _args:=)))')\n_p('\\t$(if $(_args),$1$(_args))')\n_p('endef')\n_p('')\n_p('define EOL')\n_p('')\n_p('')\n_p('endef')\n_p('')\nend\n_p('$(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(EXTERNAL_LIB"
- "S) $(RESOURCES) | $(TARGETDIR) $(OBJDIRS)')\nif prj.kind == \"StaticLib\" then\nif prj.msgarchiving then\n_p('\\t@echo ' .. prj.msgarchiving)\nelse\n_p('\\t@echo Archiving %s', prj.name)\nend\nif (not prj.archivesplit_size) then\nprj.archivesplit_size=200\nend\nif (not prj.options.ArchiveSplit) then\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGET)) del $(subst /,\\\\\\\\,$(TARGET))')\n_p('endif')\n_p('\\t$(SILENT) $(LINKCMD) $(OBJECTS)' .. (os.is(\"MacOSX\") and \" 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'\" or \"\"))\nelse\n_p('\\t$(call RM,$(TARGET))')\n_p('\\t@$(call max_args,$(LINKCMD),'.. prj.archivesplit_size ..',$(OBJECTS))' .. (os.is(\"MacOSX\") and \" 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'\" or \"\"))\n_p('\\t$(SILENT) $(LINKCMD_NDX)')\nend\nelse\nif prj.msglinking then\n_p('\\t@echo ' .. prj.msglinking)\nelse\n_p('\\t@echo Linking %s', prj.name)\nend\n_p('\\t$(SILENT) $(LINKCMD)')\nend\n_p("
- "'\\t$(POSTBUILDCMDS)')\n_p('')\n_p('$(TARGETDIR):')\npremake.make_mkdirrule(\"$(TARGETDIR)\")\n_p('$(OBJDIRS):')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCreatingMessage\")) then\n_p('\\t@echo Creating $(@)')\nend\n_p('\\t-$(call MKDIR,$@)')\n_p('')\nif os.is(\"MacOSX\") and prj.kind == \"WindowedApp\" then\n_p('$(dir $(TARGETDIR))PkgInfo:')\n_p('$(dir $(TARGETDIR))Info.plist:')\n_p('')\nend\n_p('clean:')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCleaningMessage\")) then\n_p('\\t@echo Cleaning %s', prj.name)\nend\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET)')\n_p('\\t$(SILENT) rm -rf $(OBJDIR)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGET)) del $(subst /,\\\\\\\\,$(TARGET))')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\\\\\,$(OBJDIR))')\n_p('endif')\n_p('')\n_p('prebuild:')\n_p('\\t$(PREBUILDCMDS)')\n_p('')\n_p('prelink:')\n_p('\\t"
- "$(PRELINKCMDS)')\n_p('')\ncpp.pchrules(prj)\ncpp.fileRules(prj, cc)\ncpp.dependencyRules(prj)\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nlocal deps = string.format(\"%s \",path.getrelative(prj.location,buildtask[1]))\nfor _, depdata in ipairs(buildtask[3] or {}) do\ndeps = deps .. string.format(\"%s \",path.getrelative(prj.location,depdata))\nend\n_p('%s: %s | $(TARGETDIR) $(OBJDIRS)'\n,path.getrelative(prj.location,buildtask[2])\n, deps\n)\nfor _, cmdline in ipairs(buildtask[4] or {}) do\nlocal cmd = cmdline\nlocal num = 1\nfor _, depdata in ipairs(buildtask[3] or {}) do\ncmd = string.gsub(cmd,\"%$%(\" .. num ..\"%)\", string.format(\"%s \",path.getrelative(prj.location,depdata)))\nnum = num + 1\nend\ncmd = string.gsub(cmd, \"%$%(<%)\", \"$<\")\ncmd = string.gsub(cmd, \"%$%(@%)\", \"$@\")\n_p('\\t$(SILENT) %s',cmd)\nend\n_p('')\nend\nend\n_p('-include $(OBJECTS:%%.o=%%.d)')\n_p('ifneq (,$(PCH))')\n_p(' -include $(OBJDIR)/$(notdir $("
- "PCH)).d')\n_p(' -include $(OBJDIR)/$(notdir $(PCH))_objc.d')\n_p('endif')\nend\nfunction premake.gmake_cpp_header(prj, cc, platforms)\n_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p(' SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p(' MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p(' COPY = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p(' RM = $(SILENT) rm -f \"$(1)\"')\n_p('else')\n_p(' MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p(' COPY = $(SILENT) copy /Y \"$(s"
- "ubst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p(' RM = $(SILENT) del /F \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p('endif')\n_p('')\n_p('CC = %s', cc.cc)\n_p('CXX = %s', cc.cxx)\n_p('AR = %s', cc.ar)\n_p('')\n_p('ifndef RESCOMP')\n_p(' ifdef WINDRES')\n_p(' RESCOMP = $(WINDRES)')\n_p(' else')\n_p(' RESCOMP = %s', cc.rc or 'windres')\n_p(' endif')\n_p('endif')\n_p('')\nif (not premake.make.makefile_ignore) then\n_p('MAKEFILE = %s', _MAKE.getmakefilename(prj, true))\n_p('')\nend\nend\nlocal function is_excluded(prj, cfg, file)\nif table.icontains(prj.excludes, file) then\nreturn true\nend\nif table.icontains(cfg.excludes, file) then\nreturn true\nend\nreturn false\nend\nfunction premake.gmake_cpp_config(prj, cfg, cc)\n_p('ifeq ($(config),%s)', _MAKE.esc(cfg.shortname))\ncpp.platformtools(cfg, cc)\n_p(' ' .. (table.contains(premake.make.override,\"OBJDIR\") and \"override \" or \"\") .. 'OBJDIR = %s', _MAKE.esc(cfg.objectsdir))\n_p(' ' .. (table.contains(premak"
- "e.make.override,\"TARGETDIR\") and \"override \" or \"\") .. 'TARGETDIR = %s', _MAKE.esc(cfg.buildtarget.directory))\n_p(' ' .. (table.contains(premake.make.override,\"TARGET\") and \"override \" or \"\") .. 'TARGET = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name))\n_p(' DEFINES +=%s', make.list(cc.getdefines(cfg.defines)))\n_p(' INCLUDES +=%s', make.list(cc.getincludedirs(cfg.includedirs)))\n_p(' INCLUDES +=%s', make.list(cc.getquoteincludedirs(cfg.userincludedirs)))\ncpp.pchconfig(cfg)\ncpp.flags(cfg, cc)\ncpp.linker(prj, cfg, cc)\ntable.sort(cfg.files)\n_p(' OBJECTS := \\\\')\nfor _, file in ipairs(cfg.files) do\nif path.issourcefile(file) then\nif not is_excluded(prj, cfg, file) then\n_p('\\t$(OBJDIR)/%s.o \\\\'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n)\nend\nend\nend\n_p('')\n_p(' define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \""
- "\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define PRELINKCMDS')\nif #cfg.prelinkcommands > 0 then\n_p('\\t@echo Running pre-link commands')\n_p('\\t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define POSTBUILDCMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-build commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\nmake.settings(cfg, cc)\n_p('endif')\n_p('')\nend\nfunction cpp.platformtools(cfg, cc)\nlocal platform = cc.platforms[cfg.platform]\nif platform.cc then\n_p(' CC = %s', platform.cc)\nend\nif platform.cxx then\n_p(' CXX = %s', platform.cxx)\nend\nif platform.ar then\n_p(' AR = %s', platform.ar)\nend\nend\nfunction cpp.flags(cfg, cc)\nif cfg.pchheader and not cfg.flags.NoPCH then\n_p(' FORCE_INCLUDE += -include $(OBJDIR)/$(notdir $(PCH))')\n_p(' FORCE_INCLUDE_OBJC += -include $(OBJDIR)/$(notdir $(PCH))_objc')\nend\nif #cfg.forcedincludes > 0 t"
- "hen\n_p(' FORCE_INCLUDE += -include %s'\n,_MAKE.esc(table.concat(cfg.forcedincludes, \";\")))\nend\n_p(' ALL_CPPFLAGS += $(CPPFLAGS) %s $(DEFINES) $(INCLUDES)', table.concat(cc.getcppflags(cfg), \" \"))\n_p(' ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_asm)))\n_p(' ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)))\n_p(' ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp)))\n_p(' ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getobjcflags(cfg), cfg.buildoptions, cfg.buildoptions_objc)))\n_p(' ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cc.geto"
- "bjcflags(cfg), cfg.buildoptions, cfg.buildoptions_objcpp)))\n_p(' ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)%s',\n make.list(table.join(cc.getdefines(cfg.resdefines),\n cc.getincludedirs(cfg.resincludedirs), cfg.resoptions)))\nend\nfunction cpp.linker(prj, cfg, cc)\n_p(' ALL_LDFLAGS += $(LDFLAGS)%s', make.list(table.join(cc.getlibdirflags(cfg), cc.getldflags(cfg), cfg.linkoptions)))\n_p(' LDDEPS +=%s', make.list(_MAKE.esc(premake.getlinks(cfg, \"siblings\", \"fullpath\"))))\n_p(' LIBS += $(LDDEPS)%s', make.list(cc.getlinkflags(cfg)))\n_p(' EXTERNAL_LIBS +=%s', make.list(cc.getlibfiles(cfg)))\nif cfg.kind == \"StaticLib\" then\nif (not prj.options.ArchiveSplit) then\n_p(' LINKCMD = $(AR) %s $(TARGET)', make.list(cc.getarchiveflags(prj, cfg, false)))\nelse\n_p(' LINKCMD = $(AR) %s $(TARGET)', make.list(cc.getarchiveflags(prj, cfg, false)))\n_p(' LINKCMD_NDX = $(AR) %s $(TARGET)', make"
- ".list(cc.getarchiveflags(prj, cfg, true)))\nend\nelse\nlocal tool = iif(cfg.language == \"C\", \"CC\", \"CXX\")\n_p(' LINKCMD = $(%s) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)', tool)\nend\nend\nfunction cpp.pchconfig(cfg)\nif not cfg.pchheader or cfg.flags.NoPCH then\nreturn\nend\nlocal pch = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal abspath = path.getabsolute(path.join(cfg.project.location, incdir))\nlocal testname = path.join(abspath, pch)\nif os.isfile(testname) then\npch = path.getrelative(cfg.location, testname)\nbreak\nend\nend\n_p(' PCH = %s', _MAKE.esc(pch))\n_p(' GCH = $(OBJDIR)/$(notdir $(PCH)).gch')\n_p(' GCH_OBJC = $(OBJDIR)/$(notdir $(PCH))_objc.gch')\nend\nfunction cpp.pchrules(prj)\n_p('ifneq (,$(PCH))')\n_p('$(GCH): $(PCH) $(MAKEFILE) | $(OBJDIR)')\nif prj.msgprecompile then\n_p('\\t@echo ' .. prj.msgprecompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nlocal cmd = iif(prj.language == \""
- "C\", \"$(CC) $(ALL_CFLAGS) -x c-header\", \"$(CXX) $(ALL_CXXFLAGS) -x c++-header\")\n_p('\\t$(SILENT) %s $(DEFINES) $(INCLUDES) -o \"$@\" -c \"$<\"', cmd)\n_p('')\n_p('$(GCH_OBJC): $(PCH) $(MAKEFILE) | $(OBJDIR)')\nif prj.msgprecompile then\n_p('\\t@echo ' .. prj.msgprecompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nlocal cmd = iif(prj.language == \"C\", \"$(CC) $(ALL_OBJCFLAGS) -x objective-c-header\", \"$(CXX) $(ALL_OBJCPPFLAGS) -x objective-c++-header\")\n_p('\\t$(SILENT) %s $(DEFINES) $(INCLUDES) -o \"$@\" -c \"$<\"', cmd)\n_p('endif')\n_p('')\nend\nfunction cpp.fileRules(prj, cc)\nlocal platforms = premake.filterplatforms(prj.solution, cc.platforms, \"Native\")\ntable.sort(prj.allfiles)\nfor _, file in ipairs(prj.allfiles or {}) do\nif path.issourcefile(file) then\nif (path.isobjcfile(file)) then\n_p('$(OBJDIR)/%s.o: %s $(GCH_OBJC) $(MAKEFILE)'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n, _MAKE.esc(file)\n)\nelse\n_p('$(OBJDIR)/%s.o: %s $(GCH) $(MAKEFILE)'\n, _MAKE.esc(path.trimdots(path.removee"
- "xt(file)))\n, _MAKE.esc(file)\n)\nend\nif (path.isobjcfile(file) and prj.msgcompile_objc) then\n_p('\\t@echo ' .. prj.msgcompile_objc)\nelseif prj.msgcompile then\n_p('\\t@echo ' .. prj.msgcompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nif (path.isobjcfile(file)) then\nif (path.iscfile(file)) then\n_p('\\t$(SILENT) $(CXX) $(ALL_OBJCFLAGS) $(FORCE_INCLUDE_OBJC) -o \"$@\" -c \"$<\"')\nelse\n_p('\\t$(SILENT) $(CXX) $(ALL_OBJCPPFLAGS) $(FORCE_INCLUDE_OBJC) -o \"$@\" -c \"$<\"')\nend\nelseif (path.isasmfile(file)) then\n_p('\\t$(SILENT) $(CC) $(ALL_ASMFLAGS) -o \"$@\" -c \"$<\"')\nelse\ncpp.buildcommand(path.iscfile(file) and not prj.options.ForceCPP, \"o\")\nend\nfor _, task in ipairs(prj.postcompiletasks or {}) do\n_p('\\t$(SILENT) %s', task)\n_p('')\nend\n_p('')\nelseif (path.getextension(file) == \".rc\") then\n_p('$(OBJDIR)/%s.res: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file))\nif prj.msgresource then\n_p('\\t@echo ' .. prj.msgresource)\nelse\n_p('\\t@echo $(notdir $<)')\nend\n_p('\\t$(SILENT) $(R"
- "ESCOMP) $< -O coff -o \"$@\" $(ALL_RESFLAGS)')\n_p('')\nend\nend\nend\nfunction cpp.dependencyRules(prj)\nfor _, dependency in ipairs(prj.dependency or {}) do\nfor _, dep in ipairs(dependency or {}) do\nif (dep[3]==nil or dep[3]==false) then\n_p('$(OBJDIR)/%s.o: %s'\n, _MAKE.esc(path.trimdots(path.removeext(path.getrelative(prj.location, dep[1]))))\n, _MAKE.esc(path.getrelative(prj.location, dep[2]))\n)\nelse\n_p('%s: %s'\n, _MAKE.esc(dep[1])\n, _MAKE.esc(path.getrelative(prj.location, dep[2]))\n)\nend\n_p('')\nend\nend\nend\nfunction cpp.buildcommand(iscfile, objext)\nlocal flags = iif(iscfile, '$(CC) $(ALL_CFLAGS)', '$(CXX) $(ALL_CXXFLAGS)')\n_p('\\t$(SILENT) %s $(FORCE_INCLUDE) -o \"$@\" -c \"$<\"', flags, objext)\nend\n",
+ "-- --\npremake.make.cpp = { }\npremake.make.override = { }\npremake.make.makefile_ignore = false\nlocal cpp = premake.make.cpp\nlocal make = premake.make\nfunction premake.make_cpp(prj)\nlocal cc = premake.gettool(prj)\nlocal platforms = premake.filterplatforms(prj.solution, cc.platforms, \"Native\")\nlocal action = premake.action.current()\npremake.gmake_cpp_header(prj, cc, platforms)\npremake.gmake_cpp_configs(prj, cc, platforms)\ntable.sort(prj.allfiles)\nlocal objdirs = {}\nlocal additionalobjdirs = {}\nfor _, file in ipairs(prj.allfiles) do\nif path.issourcefile(file) then\nobjdirs[_MAKE.esc(path.getdirectory(path.trimdots(file)))] = 1\nend\nend\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nadditionalobjdirs[_MAKE.esc(path.getdirectory(path.getrelative(prj.location,buildtask[2])))] = 1\nend\nend\n_p('OBJDIRS := \\\\')\n_p('\\t$(OBJDIR) \\\\')\nfor dir, _ in iter.sortByKeys(objdirs) do\n_p('\\t$(OBJDIR)/%s \\\\', dir)\nend\nfor dir, _"
+ " in iter.sortByKeys(additionalobjdirs) do\n_p('\\t%s \\\\', dir)\nend\n_p('')\n_p('RESOURCES := \\\\')\nfor _, file in ipairs(prj.allfiles) do\nif path.isresourcefile(file) then\n_p('\\t$(OBJDIR)/%s.res \\\\', _MAKE.esc(path.getbasename(file)))\nend\nend\n_p('')\n_p('.PHONY: clean prebuild prelink')\n_p('')\nif os.is(\"MacOSX\") and prj.kind == \"WindowedApp\" and not prj.options.SkipBundling then\n_p('all: $(OBJDIRS) $(TARGETDIR) prebuild prelink $(TARGET) $(dir $(TARGETDIR))PkgInfo $(dir $(TARGETDIR))Info.plist')\nelse\n_p('all: $(OBJDIRS) $(TARGETDIR) prebuild prelink $(TARGET)')\nend\n_p('\\t@:')\n_p('')\nif (prj.kind == \"StaticLib\" and prj.options.ArchiveSplit) then\n_p('define max_args')\n_p('\\t$(eval _args:=)')\n_p('\\t$(foreach obj,$3,$(eval _args+=$(obj))$(if $(word $2,$(_args)),$1$(_args)$(EOL)$(eval _args:=)))')\n_p('\\t$(if $(_args),$1$(_args))')\n_p('endef')\n_p('')\n_p('define EOL')\n_p('')\n_p('')\n_p('endef')\n_p('')\nend\n_p('$(TARGET): $(GCH) $(OBJECTS) $(LIBDEPS) $(EXTERNAL_LIBS) $(RESOUR"
+ "CES) $(OBJRESP) $(LDRESP) | $(TARGETDIR) $(OBJDIRS)')\nif prj.kind == \"StaticLib\" then\nif prj.msgarchiving then\n_p('\\t@echo ' .. prj.msgarchiving)\nelse\n_p('\\t@echo Archiving %s', prj.name)\nend\nif (not prj.archivesplit_size) then\nprj.archivesplit_size=200\nend\nif (not prj.options.ArchiveSplit) then\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGET)) del $(subst /,\\\\\\\\,$(TARGET))')\n_p('endif')\n_p('\\t$(SILENT) $(LINKCMD) $(LINKOBJS)' .. (os.is(\"MacOSX\") and \" 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'\" or \"\"))\nelse\n_p('\\t$(call RM,$(TARGET))')\n_p('\\t@$(call max_args,$(LINKCMD),'.. prj.archivesplit_size ..',$(LINKOBJS))' .. (os.is(\"MacOSX\") and \" 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'\" or \"\"))\n_p('\\t$(SILENT) $(LINKCMD_NDX)')\nend\nelse\nif prj.msglinking then\n_p('\\t@echo ' .. prj.msglinking)\nelse\n_p('\\t@echo Linking %s', prj.name)\nend\n_p('\\t$(SILENT) $(LINKCMD)"
+ "')\nend\n_p('\\t$(POSTBUILDCMDS)')\n_p('')\n_p('$(TARGETDIR):')\npremake.make_mkdirrule(\"$(TARGETDIR)\")\n_p('$(OBJDIRS):')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCreatingMessage\")) then\n_p('\\t@echo Creating $(@)')\nend\n_p('\\t-$(call MKDIR,$@)')\n_p('')\nif os.is(\"MacOSX\") and prj.kind == \"WindowedApp\" and not prj.options.SkipBundling then\n_p('$(dir $(TARGETDIR))PkgInfo:')\n_p('$(dir $(TARGETDIR))Info.plist:')\n_p('')\nend\n_p('clean:')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCleaningMessage\")) then\n_p('\\t@echo Cleaning %s', prj.name)\nend\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET)')\n_p('\\t$(SILENT) rm -rf $(OBJDIR)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGET)) del $(subst /,\\\\\\\\,$(TARGET))')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\\\\\,$(OBJDIR))')\n_p('endif')\n_p('')\n_p('prebuild:')\n_p('\\t$(PRE"
+ "BUILDCMDS)')\n_p('')\n_p('prelink:')\n_p('\\t$(PRELINKCMDS)')\n_p('')\ncpp.pchrules(prj)\ncpp.fileRules(prj, cc)\ncpp.dependencyRules(prj)\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nlocal deps = string.format(\"%s \",path.getrelative(prj.location,buildtask[1]))\nfor _, depdata in ipairs(buildtask[3] or {}) do\ndeps = deps .. string.format(\"%s \",path.getrelative(prj.location,depdata))\nend\n_p('%s: %s | $(TARGETDIR) $(OBJDIRS)'\n,path.getrelative(prj.location,buildtask[2])\n, deps\n)\nfor _, cmdline in ipairs(buildtask[4] or {}) do\nlocal cmd = cmdline\nlocal num = 1\nfor _, depdata in ipairs(buildtask[3] or {}) do\ncmd = string.gsub(cmd,\"%$%(\" .. num ..\"%)\", string.format(\"%s \",path.getrelative(prj.location,depdata)))\nnum = num + 1\nend\ncmd = string.gsub(cmd, \"%$%(<%)\", \"$<\")\ncmd = string.gsub(cmd, \"%$%(@%)\", \"$@\")\n_p('\\t$(SILENT) %s',cmd)\nend\n_p('')\nend\nend\n_p('-include $(OBJECTS:%%.o=%%.d)')\n_p('ifneq (,$("
+ "PCH))')\n_p(' -include $(OBJDIR)/$(notdir $(PCH)).d')\n_p(' -include $(OBJDIR)/$(notdir $(PCH))_objc.d')\n_p('endif')\nend\nfunction premake.gmake_cpp_header(prj, cc, platforms)\n_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p(' SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p(' MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p(' COPY = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p(' RM = $(SILENT) rm -f \"$(1)\"')\n_p('else')\n_p(' MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul || ex"
+ "it 0')\n_p(' COPY = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p(' RM = $(SILENT) del /F \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p('endif')\n_p('')\n_p('CC = %s', cc.cc)\n_p('CXX = %s', cc.cxx)\n_p('AR = %s', cc.ar)\n_p('')\n_p('ifndef RESCOMP')\n_p(' ifdef WINDRES')\n_p(' RESCOMP = $(WINDRES)')\n_p(' else')\n_p(' RESCOMP = %s', cc.rc or 'windres')\n_p(' endif')\n_p('endif')\n_p('')\nif (not premake.make.makefile_ignore) then\n_p('MAKEFILE = %s', _MAKE.getmakefilename(prj, true))\n_p('')\nend\nend\nlocal function is_excluded(prj, cfg, file)\nif table.icontains(prj.excludes, file) then\nreturn true\nend\nif table.icontains(cfg.excludes, file) then\nreturn true\nend\nreturn false\nend\nfunction premake.gmake_cpp_configs(prj, cc, platforms)\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\npremake.gmake_cpp_config(prj, cfg, cc)\nend\nend\nend\nfunction premake.gmake_cpp_config(prj, cfg, cc)\n_p('ifeq ($(config"
+ "),%s)', _MAKE.esc(cfg.shortname))\ncpp.platformtools(cfg, cc)\nlocal targetDir = _MAKE.esc(cfg.buildtarget.directory)\n_p(' ' .. (table.contains(premake.make.override,\"OBJDIR\") and \"override \" or \"\") .. 'OBJDIR = %s', _MAKE.esc(cfg.objectsdir))\n_p(' ' .. (table.contains(premake.make.override,\"TARGETDIR\") and \"override \" or \"\") .. 'TARGETDIR = %s', iif(targetDir == \"\", \".\", targetDir))\n_p(' ' .. (table.contains(premake.make.override,\"TARGET\") and \"override \" or \"\") .. 'TARGET = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name))\n_p(' DEFINES +=%s', make.list(_MAKE.escquote(cc.getdefines(cfg.defines))))\nlocal id = make.list(cc.getincludedirs(cfg.includedirs));\nlocal uid = make.list(cc.getquoteincludedirs(cfg.userincludedirs))\nlocal sid = make.list(cc.getsystemincludedirs(cfg.systemincludedirs))\nif id ~= \"\" then\n_p(' INCLUDES +=%s', id)\nend\nif uid ~= \"\" then\n_p(' INCLUDES +=%s', uid)\nend\nif sid ~="
+ " \"\" then\n_p(' INCLUDES +=%s', sid)\nend\ncpp.pchconfig(cfg)\ncpp.flags(cfg, cc)\ncpp.linker(prj, cfg, cc)\ntable.sort(cfg.files)\nif cfg.flags.UseObjectResponseFile then\n_p(' OBJRESP = $(OBJDIR)/%s_objects', prj.name)\nelse\n_p(' OBJRESP =')\nend\n_p(' OBJECTS := \\\\')\nfor _, file in ipairs(cfg.files) do\nif path.issourcefile(file) then\nif not is_excluded(prj, cfg, file) then\n_p('\\t$(OBJDIR)/%s.o \\\\'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n)\nend\nend\nend\n_p('')\n_p(' define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define PRELINKCMDS')\nif #cfg.prelinkcommands > 0 then\n_p('\\t@echo Running pre-link commands')\n_p('\\t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define POSTBUILDCMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-build"
+ " commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\nmake.settings(cfg, cc)\n_p('endif')\n_p('')\nend\nfunction cpp.platformtools(cfg, cc)\nlocal platform = cc.platforms[cfg.platform]\nif platform.cc then\n_p(' CC = %s', platform.cc)\nend\nif platform.cxx then\n_p(' CXX = %s', platform.cxx)\nend\nif platform.ar then\n_p(' AR = %s', platform.ar)\nend\nend\nfunction cpp.flags(cfg, cc)\nif cfg.pchheader and not cfg.flags.NoPCH then\n_p(' FORCE_INCLUDE += -include $(OBJDIR)/$(notdir $(PCH))')\n_p(' FORCE_INCLUDE_OBJC += -include $(OBJDIR)/$(notdir $(PCH))_objc')\nend\nif #cfg.forcedincludes > 0 then\n_p(' FORCE_INCLUDE += -include %s'\n,_MAKE.esc(table.concat(cfg.forcedincludes, \";\")))\nend\n_p(' ALL_CPPFLAGS += $(CPPFLAGS) %s $(DEFINES) $(INCLUDES)', table.concat(cc.getcppflags(cfg), \" \"))\n_p(' ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg"
+ ".buildoptions, cfg.buildoptions_asm)))\n_p(' ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)))\n_p(' ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp)))\n_p(' ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getobjcflags(cfg), cfg.buildoptions, cfg.buildoptions_objc)))\n_p(' ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cc.getobjcflags(cfg), cfg.buildoptions, cfg.buildoptions_objcpp)))\n_p(' ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)%s',\n make.list(table.join(cc.getdefines(cfg.resdefines),\n cc.getincludedirs(cfg.resincludedirs), cfg.resoptions)))\nend\nfunction cpp.linker(prj, cfg, cc)\nlocal libdeps\nloc"
+ "al lddeps\nif #cfg.wholearchive > 0 then\nlibdeps = {}\nlddeps = {}\nfor _, linkcfg in ipairs(premake.getlinks(cfg, \"siblings\", \"object\")) do\nlocal linkpath = path.rebase(linkcfg.linktarget.fullpath, linkcfg.location, cfg.location)\nif table.icontains(cfg.wholearchive, linkcfg.project.name) then\nlddeps = table.join(lddeps, cc.wholearchive(linkpath))\nelse\ntable.insert(lddeps, linkpath)\nend\ntable.insert(libdeps, linkpath)\nend\nlibdeps = make.list(_MAKE.esc(libdeps))\nlddeps = make.list(_MAKE.esc(lddeps))\nelse\nlibdeps = make.list(_MAKE.esc(premake.getlinks(cfg, \"siblings\", \"fullpath\")))\nlddeps = libdeps\nend\n_p(' ALL_LDFLAGS += $(LDFLAGS)%s', make.list(table.join(cc.getlibdirflags(cfg), cc.getldflags(cfg), cfg.linkoptions)))\n_p(' LIBDEPS +=%s', libdeps)\n_p(' LDDEPS +=%s', lddeps)\nif cfg.flags.UseLDResponseFile then\n_p(' LDRESP = $(OBJDIR)/%s_libs', prj.name)\n_p(' LIBS += @$(LDRESP)%s', make.list(cc.getlinkflags(cfg)))\nelse\n"
+ "_p(' LDRESP =')\n_p(' LIBS += $(LDDEPS)%s', make.list(cc.getlinkflags(cfg)))\nend\n_p(' EXTERNAL_LIBS +=%s', make.list(cc.getlibfiles(cfg)))\n_p(' LINKOBJS = %s', (cfg.flags.UseObjectResponseFile and \"@$(OBJRESP)\" or \"$(OBJECTS)\"))\nif cfg.kind == \"StaticLib\" then\nif (not prj.options.ArchiveSplit) then\n_p(' LINKCMD = $(AR) %s $(TARGET)', make.list(cc.getarchiveflags(prj, cfg, false)))\nelse\n_p(' LINKCMD = $(AR) %s $(TARGET)', make.list(cc.getarchiveflags(prj, cfg, false)))\n_p(' LINKCMD_NDX = $(AR) %s $(TARGET)', make.list(cc.getarchiveflags(prj, cfg, true)))\nend\nelse\nlocal tool = iif(cfg.language == \"C\", \"CC\", \"CXX\")\nlocal startgroup = ''\nlocal endgroup = ''\nif (cfg.flags.LinkSupportCircularDependencies) then\nstartgroup = '-Wl,--start-group '\nendgroup = ' -Wl,--end-group'\nend\n_p(' LINKCMD = $(%s) -o $(TARGET) $(LINKOBJS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) %s$(LIBS)%s', tool, startgroup, e"
+ "ndgroup)\nend\nend\nfunction cpp.pchconfig(cfg)\nif not cfg.pchheader or cfg.flags.NoPCH then\nreturn\nend\nlocal pch = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal abspath = path.getabsolute(path.join(cfg.project.location, incdir))\nlocal testname = path.join(abspath, pch)\nif os.isfile(testname) then\npch = path.getrelative(cfg.location, testname)\nbreak\nend\nend\n_p(' PCH = %s', _MAKE.esc(pch))\n_p(' GCH = $(OBJDIR)/$(notdir $(PCH)).gch')\n_p(' GCH_OBJC = $(OBJDIR)/$(notdir $(PCH))_objc.gch')\nend\nfunction cpp.pchrules(prj)\n_p('ifneq (,$(PCH))')\n_p('$(GCH): $(PCH) $(MAKEFILE) | $(OBJDIR)')\nif prj.msgprecompile then\n_p('\\t@echo ' .. prj.msgprecompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nlocal cmd = iif(prj.language == \"C\", \"$(CC) $(ALL_CFLAGS) -x c-header\", \"$(CXX) $(ALL_CXXFLAGS) -x c++-header\")\n_p('\\t$(SILENT) %s $(DEFINES) $(INCLUDES) -o \"$@\" -c \"$<\"', cmd)\n_p('')\n_p('$(GCH_OBJC): $(PCH) $(MAKEFILE) | $(OBJDIR)')"
+ "\nif prj.msgprecompile then\n_p('\\t@echo ' .. prj.msgprecompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nlocal cmd = iif(prj.language == \"C\", \"$(CC) $(ALL_OBJCFLAGS) -x objective-c-header\", \"$(CXX) $(ALL_OBJCPPFLAGS) -x objective-c++-header\")\n_p('\\t$(SILENT) %s $(DEFINES) $(INCLUDES) -o \"$@\" -c \"$<\"', cmd)\n_p('endif')\n_p('')\nend\nfunction cpp.fileRules(prj, cc)\nlocal platforms = premake.filterplatforms(prj.solution, cc.platforms, \"Native\")\n_p('ifneq (,$(OBJRESP))')\n_p('$(OBJRESP): $(OBJECTS) | $(TARGETDIR) $(OBJDIRS)')\n_p('\\t$(SILENT) echo $^')\n_p('\\t$(SILENT) echo $^ > $@')\n_p('endif')\n_p('')\n_p('ifneq (,$(LDRESP))')\n_p('$(LDRESP): $(LDDEPS) | $(TARGETDIR) $(OBJDIRS)')\n_p('\\t$(SILENT) echo $^')\n_p('\\t$(SILENT) echo $^ > $@')\n_p('endif')\n_p('')\ntable.sort(prj.allfiles)\nfor _, file in ipairs(prj.allfiles or {}) do\nif path.issourcefile(file) then\nif (path.isobjcfile(file)) then\n_p('$(OBJDIR)/%s.o: %s $(GCH_OBJC) $(MAKEFILE) | $(OBJDIR)/%s'\n, _MAKE.esc(path.trimdots(path."
+ "removeext(file)))\n, _MAKE.esc(file)\n, _MAKE.esc(path.getdirectory(path.trimdots(file)))\n)\nelse\n_p('$(OBJDIR)/%s.o: %s $(GCH) $(MAKEFILE) | $(OBJDIR)/%s'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n, _MAKE.esc(file)\n, _MAKE.esc(path.getdirectory(path.trimdots(file)))\n)\nend\nif (path.isobjcfile(file) and prj.msgcompile_objc) then\n_p('\\t@echo ' .. prj.msgcompile_objc)\nelseif prj.msgcompile then\n_p('\\t@echo ' .. prj.msgcompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nif (path.isobjcfile(file)) then\nif (path.iscfile(file)) then\n_p('\\t$(SILENT) $(CXX) $(ALL_OBJCFLAGS) $(FORCE_INCLUDE_OBJC) -o \"$@\" -c \"$<\"')\nelse\n_p('\\t$(SILENT) $(CXX) $(ALL_OBJCPPFLAGS) $(FORCE_INCLUDE_OBJC) -o \"$@\" -c \"$<\"')\nend\nelseif (path.isasmfile(file)) then\n_p('\\t$(SILENT) $(CC) $(ALL_ASMFLAGS) -o \"$@\" -c \"$<\"')\nelse\ncpp.buildcommand(path.iscfile(file) and not prj.options.ForceCPP, \"o\")\nend\nfor _, task in ipairs(prj.postcompiletasks or {}) do\n_p('\\t$(SILENT) %s', task)\n_p('')\nend\n_p('')\ne"
+ "lseif (path.getextension(file) == \".rc\") then\n_p('$(OBJDIR)/%s.res: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file))\nif prj.msgresource then\n_p('\\t@echo ' .. prj.msgresource)\nelse\n_p('\\t@echo $(notdir $<)')\nend\n_p('\\t$(SILENT) $(RESCOMP) $< -O coff -o \"$@\" $(ALL_RESFLAGS)')\n_p('')\nend\nend\nend\nfunction cpp.dependencyRules(prj)\nfor _, dependency in ipairs(prj.dependency or {}) do\nfor _, dep in ipairs(dependency or {}) do\nif (dep[3]==nil or dep[3]==false) then\n_p('$(OBJDIR)/%s.o: %s'\n, _MAKE.esc(path.trimdots(path.removeext(path.getrelative(prj.location, dep[1]))))\n, _MAKE.esc(path.getrelative(prj.location, dep[2]))\n)\nelse\n_p('%s: %s'\n, _MAKE.esc(dep[1])\n, _MAKE.esc(path.getrelative(prj.location, dep[2]))\n)\nend\n_p('')\nend\nend\nend\nfunction cpp.buildcommand(iscfile, objext)\nlocal flags = iif(iscfile, '$(CC) $(ALL_CFLAGS)', '$(CXX) $(ALL_CXXFLAGS)')\n_p('\\t$(SILENT) %s $(FORCE_INCLUDE) -o \"$@\" -c \"$<\"', flags, objext)\nend\n",
/* actions/make/make_csharp.lua */
- "local function getresourcefilename(cfg, fname)\nif path.getextension(fname) == \".resx\" then\n local name = cfg.buildtarget.basename .. \".\"\n local dir = path.getdirectory(fname)\n if dir ~= \".\" then \nname = name .. path.translate(dir, \".\") .. \".\"\nend\nreturn \"$(OBJDIR)/\" .. _MAKE.esc(name .. path.getbasename(fname)) .. \".resources\"\nelse\nreturn fname\nend\nend\nfunction premake.make_csharp(prj)\nlocal csc = premake.dotnet\nlocal cfglibs = { }\nlocal cfgpairs = { }\nlocal anycfg\nfor cfg in premake.eachconfig(prj) do\nanycfg = cfg\ncfglibs[cfg] = premake.getlinks(cfg, \"siblings\", \"fullpath\")\ncfgpairs[cfg] = { }\nfor _, fname in ipairs(cfglibs[cfg]) do\nif path.getdirectory(fname) ~= cfg.buildtarget.directory then\ncfgpairs[cfg][\"$(TARGETDIR)/\" .. _MAKE.esc(path.getname(fname))] = _MAKE.esc(fname)\nend\nend\nend\nlocal sources = {}\nlocal embedded = { }\nlocal copypairs = { }\nfor fcfg in premake.project.eachfile(prj) do\nlocal action = csc.getbuildaction(fcfg)\nif action == \"Co"
- "mpile\" then\ntable.insert(sources, fcfg.name)\nelseif action == \"EmbeddedResource\" then\ntable.insert(embedded, fcfg.name)\nelseif action == \"Content\" then\ncopypairs[\"$(TARGETDIR)/\" .. _MAKE.esc(path.getname(fcfg.name))] = _MAKE.esc(fcfg.name)\nelseif path.getname(fcfg.name):lower() == \"app.config\" then\ncopypairs[\"$(TARGET).config\"] = _MAKE.esc(fcfg.name)\nend\nend\nlocal paths = table.translate(prj.libdirs, function(v) return path.join(prj.basedir, v) end)\npaths = table.join({prj.basedir}, paths)\nfor _, libname in ipairs(premake.getlinks(prj, \"system\", \"fullpath\")) do\nlocal libdir = os.pathsearch(libname..\".dll\", unpack(paths))\nif (libdir) then\nlocal target = \"$(TARGETDIR)/\" .. _MAKE.esc(path.getname(libname))\nlocal source = path.getrelative(prj.basedir, path.join(libdir, libname))..\".dll\"\ncopypairs[target] = _MAKE.esc(source)\nend\nend\n_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)\n_p('')\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc"
- "(prj.configurations[1]:lower()))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p(' SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p(' MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p(' COPY = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p('else')\n_p(' MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul')\n_p(' COPY = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p('endif')\n_p('')\n_p('ifndef CSC')\n_p(' CSC=%s', csc.getcompilervar(prj))\n_p('endif')\n_p('')\n_p('ifndef RESGEN')\n_p(' RESGEN=resgen')\n_p('endif')\n_p('')\nlocal platforms = premake.filterplatforms(prj.solution, premake[_OPTIONS.cc].platforms)\ntable.insert(platforms, 1, \"\")\nfor cfg in premake.each"
- "config(prj) do\npremake.gmake_cs_config(cfg, csc, cfglibs)\nend\n_p('# To maintain compatibility with VS.NET, these values must be set at the project level')\n_p('TARGET := $(TARGETDIR)/%s', _MAKE.esc(prj.buildtarget.name))\n_p('FLAGS += /t:%s %s', csc.getkind(prj):lower(), table.implode(_MAKE.esc(prj.libdirs), \"/lib:\", \"\", \" \"))\n_p('REFERENCES += %s', table.implode(_MAKE.esc(premake.getlinks(prj, \"system\", \"basename\")), \"/r:\", \".dll\", \" \"))\n_p('')\n_p('SOURCES := \\\\')\nfor _, fname in ipairs(sources) do\n_p('\\t%s \\\\', _MAKE.esc(path.translate(fname)))\nend\n_p('')\n_p('EMBEDFILES := \\\\')\nfor _, fname in ipairs(embedded) do\n_p('\\t%s \\\\', getresourcefilename(prj, fname))\nend\n_p('')\n_p('COPYFILES += \\\\')\nfor target, source in pairs(cfgpairs[anycfg]) do\n_p('\\t%s \\\\', target)\nend\nfor target, source in pairs(copypairs) do\n_p('\\t%s \\\\', target)\nend\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p"
- "('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('.PHONY: clean prebuild prelink')\n_p('')\n_p('all: $(TARGETDIR) $(OBJDIR) prebuild $(EMBEDFILES) $(COPYFILES) prelink $(TARGET)')\n_p('')\n_p('$(TARGET): $(SOURCES) $(EMBEDFILES) $(DEPENDS)')\n_p('\\t$(SILENT) $(CSC) /nologo /out:$@ $(FLAGS) $(REFERENCES) $(SOURCES) $(patsubst %%,/resource:%%,$(EMBEDFILES))')\n_p('\\t$(POSTBUILDCMDS)')\n_p('')\n_p('$(TARGETDIR):')\npremake.make_mkdirrule(\"$(TARGETDIR)\")\n_p('$(OBJDIR):')\npremake.make_mkdirrule(\"$(OBJDIR)\")\n_p('clean:')\n_p('\\t@echo Cleaning %s', prj.name)\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGETDIR)/%s.* $(COPYFILES)', prj.buildtarget.basename)\n_p('\\t$(SILENT) rm -rf $(OBJDIR)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGETDIR)/%s.*) del $(subst /,\\\\\\\\,$(TARGETDIR)/%s.*)', prj.buildtarget.basename, prj.buildtarget.b"
- "asename)\nfor target, source in pairs(cfgpairs[anycfg]) do\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,%s) del $(subst /,\\\\\\\\,%s)', target, target)\nend\nfor target, source in pairs(copypairs) do\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,%s) del $(subst /,\\\\\\\\,%s)', target, target)\nend\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\\\\\,$(OBJDIR))')\n_p('endif')\n_p('')\n_p('prebuild:')\n_p('\\t$(PREBUILDCMDS)')\n_p('')\n_p('prelink:')\n_p('\\t$(PRELINKCMDS)')\n_p('')\n_p('# Per-configuration copied file rules')\nfor cfg in premake.eachconfig(prj) do\n_p('ifneq (,$(findstring %s,$(config)))', _MAKE.esc(cfg.name:lower()))\nfor target, source in pairs(cfgpairs[cfg]) do\npremake.make_copyrule(source, target)\nend\n_p('endif')\n_p('')\nend\n_p('# Copied file rules')\nfor target, source in pairs(copypairs) do\npremake.make_copyrule(source, target)\nend\n_p('# Embedded file rules')\nfor _, fname in ipairs(embedded) do \nif path.getextension(fname) == \".resx\" then"
- "\n_p('%s: %s', getresourcefilename(prj, fname), _MAKE.esc(fname))\n_p('\\t$(SILENT) $(RESGEN) $^ $@')\nend\n_p('')\nend\nend\nfunction premake.gmake_cs_config(cfg, csc, cfglibs)\n_p('ifneq (,$(findstring %s,$(config)))', _MAKE.esc(cfg.name:lower()))\n_p(' TARGETDIR := %s', _MAKE.esc(cfg.buildtarget.directory))\n_p(' OBJDIR := %s', _MAKE.esc(cfg.objectsdir))\n_p(' DEPENDS := %s', table.concat(_MAKE.esc(premake.getlinks(cfg, \"dependencies\", \"fullpath\")), \" \"))\n_p(' REFERENCES := %s', table.implode(_MAKE.esc(cfglibs[cfg]), \"/r:\", \"\", \" \"))\n_p(' FLAGS += %s %s', table.implode(cfg.defines, \"/d:\", \"\", \" \"), table.concat(table.join(csc.getflags(cfg), cfg.buildoptions), \" \"))\n_p(' define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define PRELINKCMDS')\nif #cfg.prelinkcommands > 0 then\n_p('\\t@echo Running pre-link commands')\n_p"
- "('\\t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define POSTBUILDCMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-build commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p('endif')\n_p('')\nend\n",
+ "local function getresourcefilename(cfg, fname)\nif path.getextension(fname) == \".resx\" then\nlocal name = cfg.buildtarget.basename .. \".\"\nlocal dir = path.getdirectory(fname)\nif dir ~= \".\" then\nname = name .. path.translate(dir, \".\") .. \".\"\nend\nreturn \"$(OBJDIR)/\" .. _MAKE.esc(name .. path.getbasename(fname)) .. \".resources\"\nelse\nreturn fname\nend\nend\nfunction premake.make_csharp(prj)\nlocal csc = premake.dotnet\nlocal cfglibs = { }\nlocal cfgpairs = { }\nlocal anycfg\nfor cfg in premake.eachconfig(prj) do\nanycfg = cfg\ncfglibs[cfg] = premake.getlinks(cfg, \"siblings\", \"fullpath\")\ncfgpairs[cfg] = { }\nfor _, fname in ipairs(cfglibs[cfg]) do\nif path.getdirectory(fname) ~= cfg.buildtarget.directory then\ncfgpairs[cfg][\"$(TARGETDIR)/\" .. _MAKE.esc(path.getname(fname))] = _MAKE.esc(fname)\nend\nend\nend\nlocal sources = {}\nlocal embedded = { }\nlocal copypairs = { }\nfor fcfg in premake.project.eachfile(prj) do\nlocal action = csc.getbuildaction(fcfg)\nif action == \"Compile\" then"
+ "\ntable.insert(sources, fcfg.name)\nelseif action == \"EmbeddedResource\" then\ntable.insert(embedded, fcfg.name)\nelseif action == \"Content\" then\ncopypairs[\"$(TARGETDIR)/\" .. _MAKE.esc(path.getname(fcfg.name))] = _MAKE.esc(fcfg.name)\nelseif path.getname(fcfg.name):lower() == \"app.config\" then\ncopypairs[\"$(TARGET).config\"] = _MAKE.esc(fcfg.name)\nend\nend\nlocal paths = table.translate(prj.libdirs, function(v) return path.join(prj.basedir, v) end)\npaths = table.join({prj.basedir}, paths)\nfor _, libname in ipairs(premake.getlinks(prj, \"system\", \"fullpath\")) do\nlocal libdir = os.pathsearch(libname..\".dll\", unpack(paths))\nif (libdir) then\nlocal target = \"$(TARGETDIR)/\" .. _MAKE.esc(path.getname(libname))\nlocal source = path.getrelative(prj.basedir, path.join(libdir, libname))..\".dll\"\ncopypairs[target] = _MAKE.esc(source)\nend\nend\n_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)\n_p('')\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(prj.configu"
+ "rations[1]:lower()))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p(' SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p(' MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p(' COPY = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p('else')\n_p(' MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul')\n_p(' COPY = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p('endif')\n_p('')\n_p('ifndef CSC')\n_p(' CSC=%s', csc.getcompilervar(prj))\n_p('endif')\n_p('')\n_p('ifndef RESGEN')\n_p(' RESGEN=resgen')\n_p('endif')\n_p('')\nlocal platforms = premake.filterplatforms(prj.solution, premake[_OPTIONS.cc].platforms)\ntable.insert(platforms, 1, \"\")\nfor cfg in premake.eachconfig(prj) "
+ "do\npremake.gmake_cs_config(cfg, csc, cfglibs)\nend\n_p('# To maintain compatibility with VS.NET, these values must be set at the project level')\n_p('TARGET := $(TARGETDIR)/%s', _MAKE.esc(prj.buildtarget.name))\n_p('FLAGS += /t:%s %s', csc.getkind(prj):lower(), table.implode(_MAKE.esc(prj.libdirs), \"/lib:\", \"\", \" \"))\n_p('REFERENCES += %s', table.implode(_MAKE.esc(premake.getlinks(prj, \"system\", \"basename\")), \"/r:\", \".dll\", \" \"))\n_p('')\n_p('SOURCES := \\\\')\nfor _, fname in ipairs(sources) do\n_p('\\t%s \\\\', _MAKE.esc(path.translate(fname)))\nend\n_p('')\n_p('EMBEDFILES := \\\\')\nfor _, fname in ipairs(embedded) do\n_p('\\t%s \\\\', getresourcefilename(prj, fname))\nend\n_p('')\n_p('COPYFILES += \\\\')\nfor target, source in pairs(cfgpairs[anycfg]) do\n_p('\\t%s \\\\', target)\nend\nfor target, source in pairs(copypairs) do\n_p('\\t%s \\\\', target)\nend\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin"
+ ",$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('.PHONY: clean prebuild prelink')\n_p('')\n_p('all: $(TARGETDIR) $(OBJDIR) prebuild $(EMBEDFILES) $(COPYFILES) prelink $(TARGET)')\n_p('')\n_p('$(TARGET): $(SOURCES) $(EMBEDFILES) $(DEPENDS)')\n_p('\\t$(SILENT) $(CSC) /nologo /out:$@ $(FLAGS) $(REFERENCES) $(SOURCES) $(patsubst %%,/resource:%%,$(EMBEDFILES))')\n_p('\\t$(POSTBUILDCMDS)')\n_p('')\n_p('$(TARGETDIR):')\npremake.make_mkdirrule(\"$(TARGETDIR)\")\n_p('$(OBJDIR):')\npremake.make_mkdirrule(\"$(OBJDIR)\")\n_p('clean:')\n_p('\\t@echo Cleaning %s', prj.name)\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET) $(COPYFILES)')\n_p('\\t$(SILENT) rm -rf $(OBJDIR)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGETDIR)/%s.*) del $(subst /,\\\\\\\\,$(TARGETDIR)/%s.*)', prj.buildtarget.basename, prj.buildtarget.basename)\nfor target, source in pairs(cfgpairs"
+ "[anycfg]) do\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,%s) del $(subst /,\\\\\\\\,%s)', target, target)\nend\nfor target, source in pairs(copypairs) do\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,%s) del $(subst /,\\\\\\\\,%s)', target, target)\nend\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\\\\\,$(OBJDIR))')\n_p('endif')\n_p('')\n_p('prebuild:')\n_p('\\t$(PREBUILDCMDS)')\n_p('')\n_p('prelink:')\n_p('\\t$(PRELINKCMDS)')\n_p('')\n_p('# Per-configuration copied file rules')\nfor cfg in premake.eachconfig(prj) do\n_p('ifneq (,$(findstring %s,$(config)))', _MAKE.esc(cfg.name:lower()))\nfor target, source in pairs(cfgpairs[cfg]) do\npremake.make_copyrule(source, target)\nend\n_p('endif')\n_p('')\nend\n_p('# Copied file rules')\nfor target, source in pairs(copypairs) do\npremake.make_copyrule(source, target)\nend\n_p('# Embedded file rules')\nfor _, fname in ipairs(embedded) do\nif path.getextension(fname) == \".resx\" then\n_p('%s: %s', getresourcefilename(prj, fname), "
+ "_MAKE.esc(fname))\n_p('\\t$(SILENT) $(RESGEN) $^ $@')\nend\n_p('')\nend\nend\nfunction premake.gmake_cs_config(cfg, csc, cfglibs)\nlocal targetDir = _MAKE.esc(cfg.buildtarget.directory)\n_p('ifneq (,$(findstring %s,$(config)))', _MAKE.esc(cfg.name:lower()))\n_p(' TARGETDIR := %s', iif(targetDir == \"\", \".\", targetDir))\n_p(' OBJDIR := %s', _MAKE.esc(cfg.objectsdir))\n_p(' DEPENDS := %s', table.concat(_MAKE.esc(premake.getlinks(cfg, \"dependencies\", \"fullpath\")), \" \"))\n_p(' REFERENCES := %s', table.implode(_MAKE.esc(cfglibs[cfg]), \"/r:\", \"\", \" \"))\n_p(' FLAGS += %s %s', table.implode(cfg.defines, \"/d:\", \"\", \" \"), table.concat(table.join(csc.getflags(cfg), cfg.buildoptions), \" \"))\n_p(' define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define PRELINKCMDS')\nif #cfg.prelinkcommands > 0 then\n_p('\\t@echo Running pre-link co"
+ "mmands')\n_p('\\t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define POSTBUILDCMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-build commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p('endif')\n_p('')\nend\n",
/* actions/make/make_vala.lua */
"local make = premake.make\nfunction premake.make_vala(prj)\nlocal valac = premake.gettool(prj)\nlocal platforms = premake.filterplatforms(prj.solution, valac.platforms, \"Native\")\n_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p(' SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p(' MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p(' COPY = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p(' RM = $(SILENT) rm -f \"$(1)\"')\n_p('else')\n_p(' MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul || e"
@@ -259,64 +271,77 @@ const char* builtin_scripts[] = {
"GS = %s\", make.list(tool.getswiftlinkflags(cfg)))\n_p(1, \"AR_FLAGS = %s\", make.list(tool.getarchiveflags(cfg, cfg, false)))\n_p(1, \"LD_FLAGS = %s\", make.list(tool.getldflags(cfg)))\n_p(1, \"LDDEPS = %s\", make.list(premake.getlinks(cfg, \"siblings\", \"fullpath\")))\nif cfg.flags.Symbols then\n_p(1, \"SYMBOLS = $(TARGET).dSYM\")\nend\nlocal sdk = tool.get_sdk_path(cfg)\nif sdk then\n_p(1, \"TOOLCHAIN_PATH = %s\", tool.get_toolchain_path(cfg))\n_p(1, \"SDK_PATH = %s\", sdk)\n_p(1, \"PLATFORM_PATH = %s\", tool.get_sdk_platform_path(cfg))\n_p(1, \"SDK = -sdk $(SDK_PATH)\")\nelse\n_p(1, \"SDK_PATH =\")\n_p(1, \"SDK =\")\nend\n_p(1,'WORK_DIRS = $(OUT_DIR) $(OBJDIR)')\n_p('endif')\n_p('')\nend",
/* actions/vstudio/_vstudio.lua */
- "premake.vstudio = { }\nlocal toolsets = {\nvs2010 = \"v100\",\nvs2012 = \"v110\",\nvs2013 = \"v120\",\nvs2015 = \"v140\",\nvs2017 = \"v141\",\nvsllvm = \"llvm\",\n}\npremake.vstudio.toolset = toolsets[_ACTION] or \"unknown?\"\npremake.vstudio.splashpath = ''\nlocal vstudio = premake.vstudio\nvstudio.platforms = {\nany = \"Any CPU\",\nmixed = \"Mixed Platforms\",\nNative = \"Win32\",\nx86 = \"x86\",\nx32 = \"Win32\",\nx64 = \"x64\",\nPS3 = \"PS3\",\nXbox360 = \"Xbox 360\",\nARM = \"ARM\",\nOrbis = \"ORBIS\",\nDurango = \"Durango\",\n}\nfunction vstudio.arch(prj)\nif (prj.language == \"C#\") then\nreturn \"Any CPU\"\nelse\nreturn \"Win32\"\nend\nend\nfunction vstudio.iswinrt()\nreturn vstudio.storeapp ~= nil and vstudio.storeapp ~= ''\nend\nfunction vstudio.buildconfigs(sln)\nlocal cfgs = { }\nlocal platforms = premake.filterplatforms(sln, vstudio.platforms, \"Native\")\nlocal hascpp = premake.hascppproject(sln)\nlocal hasdotnet = premake.hasdotnetproject(sln)\nif hasdotnet and (_"
- "ACTION > \"vs2008\" or hascpp) then\ntable.insert(platforms, 1, \"mixed\")\nend\nif hasdotnet and (_ACTION < \"vs2010\" or not hascpp) then\ntable.insert(platforms, 1, \"any\")\nend\nif _ACTION > \"vs2008\" then\nlocal platforms2010 = { }\nfor _, platform in ipairs(platforms) do\nif vstudio.platforms[platform] == \"Win32\" then\nif hascpp then\ntable.insert(platforms2010, platform)\nend\nif hasdotnet then\ntable.insert(platforms2010, \"x86\")\nend\nelse\ntable.insert(platforms2010, platform)\nend\nend\nplatforms = platforms2010\nend\nfor _, buildcfg in ipairs(sln.configurations) do\nfor _, platform in ipairs(platforms) do\nlocal entry = { }\nentry.src_buildcfg = buildcfg\nentry.src_platform = platform\nif platform ~= \"PS3\" or _ACTION > \"vs2008\" then\nentry.buildcfg = buildcfg\nentry.platform = vstudio.platforms[platform]\nelse\nentry.buildcfg = platform .. \" \" .. buildcfg\nentry.platform = \"Win32\"\nend\nentry.name = entry.buildcfg .. \"|\" .. entry.platform\nentry.isreal = (platform ~= \"any\" and plat"
- "form ~= \"mixed\")\ntable.insert(cfgs, entry)\nend\nend\nreturn cfgs\nend\nfunction premake.vstudio.bakeimports(sln)\nfor _,iprj in ipairs(sln.importedprojects) do\nif string.find(iprj.location, \".csproj\") ~= nil then\niprj.language = \"C#\"\nelse\niprj.language = \"C++\"\nend\nlocal f, err = io.open(iprj.location, \"r\")\nif (not f) then\nerror(err, 1)\nend\nlocal projcontents = f:read(\"*all\")\nf:close()\nlocal found, _, uuid = string.find(projcontents, \"<ProjectGuid>{([%w%-]+)}</ProjectGuid>\")\nif not found then\nerror(\"Could not find ProjectGuid element in project \" .. iprj.location, 1)\nend\niprj.uuid = uuid\nif iprj.language == \"C++\" and string.find(projcontents, \"<CLRSupport>true</CLRSupport>\") then\niprj.flags.Managed = true\nend\niprj.relpath = path.getrelative(sln.location, iprj.location)\nend\nend\nfunction premake.vstudio.getimportprj(prjpath, sln)\nfor _,iprj in ipairs(sln.importedprojects) do\nif prjpath == iprj.relpath then\nreturn iprj\nend\nend\nerror(\"Could not find reference impo"
- "rt project \" .. prjpath, 1)\nend\nfunction vstudio.cleansolution(sln)\npremake.clean.file(sln, \"%%.sln\")\npremake.clean.file(sln, \"%%.suo\")\npremake.clean.file(sln, \"%%.ncb\")\npremake.clean.file(sln, \"%%.userprefs\")\npremake.clean.file(sln, \"%%.usertasks\")\nend\nfunction vstudio.cleanproject(prj)\nlocal fname = premake.project.getfilename(prj, \"%%\")\nos.remove(fname .. \".vcproj\")\nos.remove(fname .. \".vcproj.user\")\nos.remove(fname .. \".vcxproj\")\nos.remove(fname .. \".vcxproj.user\")\nos.remove(fname .. \".vcxproj.filters\")\nos.remove(fname .. \".csproj\")\nos.remove(fname .. \".csproj.user\")\nos.remove(fname .. \".pidb\")\nos.remove(fname .. \".sdf\")\nend\nfunction vstudio.cleantarget(name)\nos.remove(name .. \".pdb\")\nos.remove(name .. \".idb\")\nos.remove(name .. \".ilk\")\nos.remove(name .. \".vshost.exe\")\nos.remove(name .. \".exe.manifest\")\nend\nfunction vstudio.projectfile(prj)\nlocal pattern\nif prj.language == \"C#\" then\npattern = \"%%.csproj\"\nelse\npattern = iif(_ACTION"
- " > \"vs2008\", \"%%.vcxproj\", \"%%.vcproj\")\nend\nlocal fname = premake.project.getbasename(prj.name, pattern)\nfname = path.join(prj.location, fname)\nreturn fname\nend\nfunction vstudio.tool(prj)\nif (prj.language == \"C#\") then\nreturn \"FAE04EC0-301F-11D3-BF4B-00C04F79EFBC\"\nelse\nreturn \"8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942\"\nend\nend\n",
+ "premake.vstudio = { }\nlocal toolsets = {\nvs2010 = \"v100\",\nvs2012 = \"v110\",\nvs2013 = \"v120\",\nvs2015 = \"v140\",\nvs2017 = \"v141\",\nvs2019 = \"v142\",\nvsllvm = \"llvm\",\n}\npremake.vstudio.toolset = toolsets[_ACTION] or \"unknown?\"\npremake.vstudio.splashpath = ''\npremake.vstudio.xpwarning = true\nlocal vstudio = premake.vstudio\nvstudio.platforms = {\nany = \"Any CPU\",\nmixed = \"Mixed Platforms\",\nNative = \"Win32\",\nx86 = \"x86\",\nx32 = \"Win32\",\nx64 = \"x64\",\nPS3 = \"PS3\",\nXbox360 = \"Xbox 360\",\nARM = \"ARM\",\nOrbis = \"ORBIS\",\nDurango = \"Durango\",\nTegraAndroid = \"Tegra-Android\",\nNX32 = \"NX32\",\nNX64 = \"NX64\",\nEmscripten = \"Emscripten\",\n}\nfunction vstudio.arch(prj)\nif (prj.language == \"C#\") then\nreturn \"Any CPU\"\nelse\nreturn \"Win32\"\nend\nend\nfunction vstudio.iswinrt()\nreturn vstudio.storeapp ~= nil and vstudio.storeapp ~= ''\nend\nfunction vstudio.buildconfigs(sln)\nlocal cfgs = { }\nlocal platforms = premake.filter"
+ "platforms(sln, vstudio.platforms, \"Native\")\nlocal hascpp = premake.hascppproject(sln)\nlocal hasdotnet = premake.hasdotnetproject(sln)\nif hasdotnet and (_ACTION > \"vs2008\" or hascpp) then\ntable.insert(platforms, 1, \"mixed\")\nend\nif hasdotnet and (_ACTION < \"vs2010\" or not hascpp) then\ntable.insert(platforms, 1, \"any\")\nend\nif _ACTION > \"vs2008\" then\nlocal platforms2010 = { }\nfor _, platform in ipairs(platforms) do\nif vstudio.platforms[platform] == \"Win32\" then\nif hascpp then\ntable.insert(platforms2010, platform)\nend\nif hasdotnet then\ntable.insert(platforms2010, \"x86\")\nend\nelse\ntable.insert(platforms2010, platform)\nend\nend\nplatforms = platforms2010\nend\nfor _, buildcfg in ipairs(sln.configurations) do\nfor _, platform in ipairs(platforms) do\nlocal entry = { }\nentry.src_buildcfg = buildcfg\nentry.src_platform = platform\nif platform ~= \"PS3\" or _ACTION > \"vs2008\" then\nentry.buildcfg = buildcfg\nentry.platform = vstudio.platforms[platform]\nelse\nentry.buildcfg = pla"
+ "tform .. \" \" .. buildcfg\nentry.platform = \"Win32\"\nend\nentry.name = entry.buildcfg .. \"|\" .. entry.platform\nentry.isreal = (platform ~= \"any\" and platform ~= \"mixed\")\ntable.insert(cfgs, entry)\nend\nend\nreturn cfgs\nend\nfunction premake.vstudio.bakeimports(sln)\nfor _,iprj in ipairs(sln.importedprojects) do\nif string.find(iprj.location, \".csproj\") ~= nil then\niprj.language = \"C#\"\nelse\niprj.language = \"C++\"\nend\nlocal f, err = io.open(iprj.location, \"r\")\nif (not f) then\nerror(err, 1)\nend\nlocal projcontents = f:read(\"*all\")\nf:close()\nlocal found, _, uuid = string.find(projcontents, \"<ProjectGuid>{([%w%-]+)}</ProjectGuid>\")\nif not found then\nerror(\"Could not find ProjectGuid element in project \" .. iprj.location, 1)\nend\niprj.uuid = uuid\nif iprj.language == \"C++\" and string.find(projcontents, \"<CLRSupport>true</CLRSupport>\") then\niprj.flags.Managed = true\nend\niprj.relpath = path.getrelative(sln.location, iprj.location)\nend\nend\nfunction premake.vstudio.getimpo"
+ "rtprj(prjpath, sln)\nfor _,iprj in ipairs(sln.importedprojects) do\nif prjpath == iprj.relpath then\nreturn iprj\nend\nend\nerror(\"Could not find reference import project \" .. prjpath, 1)\nend\nfunction vstudio.cleansolution(sln)\npremake.clean.file(sln, \"%%.sln\")\npremake.clean.file(sln, \"%%.suo\")\npremake.clean.file(sln, \"%%.ncb\")\npremake.clean.file(sln, \"%%.userprefs\")\npremake.clean.file(sln, \"%%.usertasks\")\nend\nfunction vstudio.cleanproject(prj)\nlocal fname = premake.project.getfilename(prj, \"%%\")\nos.remove(fname .. \".vcproj\")\nos.remove(fname .. \".vcproj.user\")\nos.remove(fname .. \".vcxproj\")\nos.remove(fname .. \".vcxproj.user\")\nos.remove(fname .. \".vcxproj.filters\")\nos.remove(fname .. \".csproj\")\nos.remove(fname .. \".csproj.user\")\nos.remove(fname .. \".pidb\")\nos.remove(fname .. \".sdf\")\nend\nfunction vstudio.cleantarget(name)\nos.remove(name .. \".pdb\")\nos.remove(name .. \".idb\")\nos.remove(name .. \".ilk\")\nos.remove(name .. \".vshost.exe\")\nos.remove(name ."
+ ". \".exe.manifest\")\nend\nfunction vstudio.projectfile(prj)\nlocal pattern\nif prj.language == \"C#\" then\npattern = \"%%.csproj\"\nelse\npattern = iif(_ACTION > \"vs2008\", \"%%.vcxproj\", \"%%.vcproj\")\nend\nlocal fname = premake.project.getbasename(prj.name, pattern)\nfname = path.join(prj.location, fname)\nreturn fname\nend\nfunction vstudio.tool(prj)\nif (prj.language == \"C#\") then\nreturn \"FAE04EC0-301F-11D3-BF4B-00C04F79EFBC\"\nelse\nreturn \"8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942\"\nend\nend\n",
/* actions/vstudio/vstudio_solution.lua */
"premake.vstudio.sln2005 = { }\nlocal vstudio = premake.vstudio\nlocal sln2005 = premake.vstudio.sln2005\nfunction sln2005.generate(sln)\nio.eol = '\\r\\n'\nsln.vstudio_configs = premake.vstudio.buildconfigs(sln)\npremake.vstudio.bakeimports(sln)\n_p('\\239\\187\\191')\nsln2005.reorderProjects(sln)\nsln2005.header(sln)\nfor grp in premake.solution.eachgroup(sln) do\nsln2005.group(grp)\nend\nfor prj in premake.solution.eachproject(sln) do\nsln2005.project(prj)\nend\n \nfor _,iprj in ipairs(sln.importedprojects) do\nsln2005.importproject(iprj)\nend\n_p('Global')\nsln2005.platforms(sln)\nsln2005.project_platforms(sln)\nsln2005.properties(sln)\nsln2005.project_groups(sln)\n_p('EndGlobal')\nend\nfunction sln2005.reorderProjects(sln)\nif sln.startproject then\nfor i, prj in ipairs(sln.projects) do\nif sln.startproject == prj.name then\nlocal cur = prj.group\nwhile cur ~= nil do\nfor j, group in ipairs(sln.groups) do\nif group == cur then\ntable.remove(sln.groups, j)\nbreak\nend\nend\ntable.insert(sln.groups, 1"
", cur)\ncur = cur.parent\nend\ntable.remove(sln.projects, i)\ntable.insert(sln.projects, 1, prj)\nbreak\nend\nend\nend\nend\nfunction sln2005.header(sln)\nlocal action = premake.action.current()\n_p('Microsoft Visual Studio Solution File, Format Version %d.00', action.vstudio.solutionVersion)\nif(_ACTION:sub(3) == \"2015\" or _ACTION:sub(3) == \"2017\" or _ACTION:sub(3) == \"llvm\") then\n_p('# Visual Studio %s', action.vstudio.toolsVersion:sub(1,2))\nelse\n_p('# Visual Studio %s', _ACTION:sub(3))\nend\nend\nfunction sln2005.project(prj)\nlocal projpath = path.translate(path.getrelative(prj.solution.location, vstudio.projectfile(prj)), \"\\\\\")\n_p('Project(\"{%s}\") = \"%s\", \"%s\", \"{%s}\"', vstudio.tool(prj), prj.name, projpath, prj.uuid)\nsln2005.projectdependencies(prj)\n_p('EndProject')\nend\nfunction sln2005.group(grp)\n_p('Project(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"%s\", \"%s\", \"{%s}\"', grp.name, grp.name, grp.uuid)\n_p('EndProject')\nend\n \nfunction sln2005.importproject(iprj)"
- "\n_p('Project(\"{%s}\") = \"%s\", \"%s\", \"{%s}\"', vstudio.tool(iprj), path.getbasename(iprj.location), iprj.relpath, iprj.uuid)\n_p('EndProject')\nend\nfunction sln2005.projectdependencies(prj)\nlocal deps = premake.getdependencies(prj)\nif #deps > 0 then\n_p('\\tProjectSection(ProjectDependencies) = postProject')\nfor _, dep in ipairs(deps) do\n_p('\\t\\t{%s} = {%s}', dep.uuid, dep.uuid)\nend\n_p('\\tEndProjectSection')\nend\nend\nfunction sln2005.platforms(sln)\n_p('\\tGlobalSection(SolutionConfigurationPlatforms) = preSolution')\nfor _, cfg in ipairs(sln.vstudio_configs) do\n_p('\\t\\t%s = %s', cfg.name, cfg.name)\nend\n_p('\\tEndGlobalSection')\nend\nfunction sln2005.project_platform(prj, sln)\nfor _, cfg in ipairs(sln.vstudio_configs) do\nlocal mapped\nlocal buildfor\nif premake.isdotnetproject(prj) then\nbuildfor = \"x64\"\nmapped = \"Any CPU\"\nelseif prj.flags and prj.flags.Managed then\nmapped = \"x64\"\nelse\nif cfg.platform == \"Any CPU\" or cfg.platform == \"Mixed Platforms\" then\nmapped = sln."
- "vstudio_configs[3].platform\nelse\nmapped = cfg.platform\nend\nend\nlocal build_project = true\nif prj.solution ~= nil then\n build_project = premake.getconfig(prj, cfg.src_buildcfg, cfg.src_platform).build\nend\n_p('\\t\\t{%s}.%s.ActiveCfg = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped)\nif build_project then\n if mapped == cfg.platform or cfg.platform == \"Mixed Platforms\" or buildfor == cfg.platform then\n _p('\\t\\t{%s}.%s.Build.0 = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped)\n end\n if premake.vstudio.iswinrt() and prj.kind == \"WindowedApp\" then\n _p('\\t\\t{%s}.%s.Deploy.0 = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped)\n end\nend\nend\nend\nfunction sln2005.project_platforms(sln)\n_p('\\tGlobalSection(ProjectConfigurationPlatforms) = postSolution')\nfor prj in premake.solution.eachproject(sln) do\nsln2005.project_platform(prj, sln)\nend\nfor _,iprj in ipairs(sln.importedprojects) do\nsln2005.project_platform(iprj, sln)\nend\n_p('\\tEndGlobalSection')\nend\nfunc"
- "tion sln2005.properties(sln)\n_p('\\tGlobalSection(SolutionProperties) = preSolution')\n_p('\\t\\tHideSolutionNode = FALSE')\n_p('\\tEndGlobalSection')\nend\nfunction sln2005.project_groups(sln)\n_p('\\tGlobalSection(NestedProjects) = preSolution')\nfor grp in premake.solution.eachgroup(sln) do\nif grp.parent ~= nil then\n_p('\\t\\t{%s} = {%s}', grp.uuid, grp.parent.uuid)\nend\nend\nfor prj in premake.solution.eachproject(sln) do\nif prj.group ~= nil then\n_p('\\t\\t{%s} = {%s}', prj.uuid, prj.group.uuid)\nend\nend\nfor _,iprj in ipairs(sln.importedprojects) do\nif iprj.group ~= nil then\n_p('\\t\\t{%s} = {%s}', iprj.uuid, iprj.group.uuid)\nend\nend\n \n_p('\\tEndGlobalSection')\nend",
+ "\n_p('Project(\"{%s}\") = \"%s\", \"%s\", \"{%s}\"', vstudio.tool(iprj), path.getbasename(iprj.location), iprj.relpath, iprj.uuid)\n_p('EndProject')\nend\nfunction sln2005.projectdependencies(prj)\nlocal deps = premake.getdependencies(prj)\nif #deps > 0 then\nlocal function compareuuid(a, b) return a.uuid < b.uuid end\ntable.sort(deps, compareuuid)\n_p('\\tProjectSection(ProjectDependencies) = postProject')\nfor _, dep in ipairs(deps) do\n_p('\\t\\t{%s} = {%s}', dep.uuid, dep.uuid)\nend\n_p('\\tEndProjectSection')\nend\nend\nfunction sln2005.platforms(sln)\n_p('\\tGlobalSection(SolutionConfigurationPlatforms) = preSolution')\nfor _, cfg in ipairs(sln.vstudio_configs) do\n_p('\\t\\t%s = %s', cfg.name, cfg.name)\nend\n_p('\\tEndGlobalSection')\nend\nfunction sln2005.project_platform(prj, sln)\nfor _, cfg in ipairs(sln.vstudio_configs) do\nlocal mapped\nlocal buildfor\nif premake.isdotnetproject(prj) then\nbuildfor = \"x64\"\nmapped = \"Any CPU\"\nelseif prj.flags and prj.flags.Managed then\nmapped = \"x64\"\nels"
+ "e\nif cfg.platform == \"Any CPU\" or cfg.platform == \"Mixed Platforms\" then\nmapped = sln.vstudio_configs[3].platform\nelse\nmapped = cfg.platform\nend\nend\nlocal build_project = true\nif prj.solution ~= nil then\n build_project = premake.getconfig(prj, cfg.src_buildcfg, cfg.src_platform).build\nend\n_p('\\t\\t{%s}.%s.ActiveCfg = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped)\nif build_project then\n if mapped == cfg.platform or cfg.platform == \"Mixed Platforms\" or buildfor == cfg.platform then\n _p('\\t\\t{%s}.%s.Build.0 = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped)\n end\n if premake.vstudio.iswinrt() and prj.kind == \"WindowedApp\" then\n _p('\\t\\t{%s}.%s.Deploy.0 = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped)\n end\nend\nend\nend\nfunction sln2005.project_platforms(sln)\n_p('\\tGlobalSection(ProjectConfigurationPlatforms) = postSolution')\nfor prj in premake.solution.eachproject(sln) do\nsln2005.project_platform(prj, sln)\nend\nfor _,iprj in ipairs(sln.imported"
+ "projects) do\nsln2005.project_platform(iprj, sln)\nend\n_p('\\tEndGlobalSection')\nend\nfunction sln2005.properties(sln)\n_p('\\tGlobalSection(SolutionProperties) = preSolution')\n_p('\\t\\tHideSolutionNode = FALSE')\n_p('\\tEndGlobalSection')\nend\nfunction sln2005.project_groups(sln)\n_p('\\tGlobalSection(NestedProjects) = preSolution')\nfor grp in premake.solution.eachgroup(sln) do\nif grp.parent ~= nil then\n_p('\\t\\t{%s} = {%s}', grp.uuid, grp.parent.uuid)\nend\nend\nfor prj in premake.solution.eachproject(sln) do\nif prj.group ~= nil then\n_p('\\t\\t{%s} = {%s}', prj.uuid, prj.group.uuid)\nend\nend\nfor _,iprj in ipairs(sln.importedprojects) do\nif iprj.group ~= nil then\n_p('\\t\\t{%s} = {%s}', iprj.uuid, iprj.group.uuid)\nend\nend\n \n_p('\\tEndGlobalSection')\nend",
/* actions/vstudio/vstudio_vcxproj.lua */
- "premake.vstudio.vc2010 = { }\nlocal vc2010 = premake.vstudio.vc2010\nlocal vstudio = premake.vstudio\nlocal function vs2010_config(prj)\n_p(1,'<ItemGroup Label=\"ProjectConfigurations\">')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\n_p(2,'<ProjectConfiguration Include=\"%s\">', premake.esc(cfginfo.name))\n_p(3,'<Configuration>%s</Configuration>',cfginfo.buildcfg)\n_p(3,'<Platform>%s</Platform>',cfginfo.platform)\n_p(2,'</ProjectConfiguration>')\nend\n_p(1,'</ItemGroup>')\nend\nlocal function vs2010_globals(prj)\nlocal action = premake.action.current()\n_p(1,'<PropertyGroup Label=\"Globals\">')\n_p(2, '<ProjectGuid>{%s}</ProjectGuid>',prj.uuid)\n_p(2, '<RootNamespace>%s</RootNamespace>',prj.name)\nif vstudio.storeapp ~= \"durango\" then\nlocal windowsTargetPlatformVersion = prj.windowstargetplatformversion or action.vstudio.windowsTargetPlatformVersion\nif windowsTargetPlatformVersion ~= nil then\n_p(2,'<WindowsTargetPlatformVersion>%s</WindowsTargetPlatformVersion>',windowsTargetPlatformVersion"
- ")\nif windowsTargetPlatformVersion and string.startswith(windowsTargetPlatformVersion, \"10.\") then\n_p(2,'<WindowsTargetPlatformMinVersion>%s</WindowsTargetPlatformMinVersion>', prj.windowstargetplatformminversion or \"10.0.10240.0\")\nend\nend\nend\nif prj.flags and prj.flags.Managed then\nlocal frameworkVersion = prj.framework or \"4.0\"\n_p(2, '<TargetFrameworkVersion>v%s</TargetFrameworkVersion>', frameworkVersion)\n_p(2, '<Keyword>ManagedCProj</Keyword>')\nelseif vstudio.iswinrt() then\n_p(2, '<DefaultLanguage>en-US</DefaultLanguage>')\nif vstudio.storeapp == \"durango\" then\n_p(2, '<Keyword>Win32Proj</Keyword>')\n_p(2, '<ApplicationEnvironment>title</ApplicationEnvironment>')\n_p(2, '<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>')\n_p(2, '<TargetRuntime>Native</TargetRuntime>')\nelse\n_p(2, '<AppContainerApplication>true</AppContainerApplication>')\n_p(2, '<MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>')\nif vstudio.toolset == \"v120_wp81\" then\n_p(2, '<ApplicationType>"
- "Windows Phone</ApplicationType>')\nelse\n_p(2, '<ApplicationType>Windows Store</ApplicationType>')\nend\n_p(2, '<ApplicationTypeRevision>%s</ApplicationTypeRevision>', vstudio.storeapp)\nend\nelse\n_p(2, '<Keyword>Win32Proj</Keyword>')\nend\nif _ACTION:sub(3) == \"2015\" or _ACTION:sub(3) == \"2017\" or _ACTION:sub(3) == \"llvm\" then\n_p(2,'<PreferredToolArchitecture>x64</PreferredToolArchitecture>')\nend\nif (_ACTION:sub(3) == \"2017\" or _ACTION:sub(3) == \"llvm\")\nand os.isdir(path.join(os.getenv(\"VSINSTALLDIR\"), \"VC/Tools/MSVC/14.14.26428\")) then\n_p(2,'<VCToolsVersion>14.14.26428</VCToolsVersion>')\nend\n_p(1,'</PropertyGroup>')\nend\nfunction vc2010.config_type(config)\nlocal t =\n{\nSharedLib = \"DynamicLibrary\",\nStaticLib = \"StaticLibrary\",\nConsoleApp = \"Application\",\nWindowedApp = \"Application\"\n}\nreturn t[config.kind]\nend\nlocal function if_config_and_platform()\nreturn 'Condition=\"\\'$(Configuration)|$(Platform)\\'==\\'%s\\'\"'\nend\nlocal function optimisation(cfg)\nlocal result "
- "= \"Disabled\"\nfor _, value in ipairs(cfg.flags) do\nif (value == \"Optimize\") then\nresult = \"Full\"\nelseif (value == \"OptimizeSize\") then\nresult = \"MinSpace\"\nelseif (value == \"OptimizeSpeed\") then\nresult = \"MaxSpeed\"\nend\nend\nreturn result\nend\nfunction vc2010.configurationPropertyGroup(cfg, cfginfo)\n_p(1,'<PropertyGroup '..if_config_and_platform() ..' Label=\"Configuration\">'\n, premake.esc(cfginfo.name))\n_p(2,'<ConfigurationType>%s</ConfigurationType>',vc2010.config_type(cfg))\n_p(2,'<UseDebugLibraries>%s</UseDebugLibraries>', iif(optimisation(cfg) == \"Disabled\",\"true\",\"false\"))\n_p(2,'<PlatformToolset>%s</PlatformToolset>', premake.vstudio.toolset)\nif cfg.flags.MFC then\n_p(2,'<UseOfMfc>%s</UseOfMfc>', iif(cfg.flags.StaticRuntime, \"Static\", \"Dynamic\"))\nend\nif cfg.flags.ATL or cfg.flags.StaticATL then\n_p(2,'<UseOfAtl>%s</UseOfAtl>', iif(cfg.flags.StaticATL, \"Static\", \"Dynamic\"))\nend\nif cfg.flags.Unicode then\n_p(2,'<CharacterSet>Unicode</CharacterSet>')\nend\nif cfg"
- ".flags.Managed then\n_p(2,'<CLRSupport>true</CLRSupport>')\nend\n_p(1,'</PropertyGroup>')\nend\nlocal function import_props(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,'<ImportGroup '..if_config_and_platform() ..' Label=\"PropertySheets\">'\n,premake.esc(cfginfo.name))\n_p(2,'<Import Project=\"$(UserRootDir)\\\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists(\\'$(UserRootDir)\\\\Microsoft.Cpp.$(Platform).user.props\\')\" Label=\"LocalAppDataPlatform\" />')\nif #cfg.propertysheets > 0 then\nlocal dirs = cfg.propertysheets\nfor _, dir in ipairs(dirs) do\n_p(2,'<Import Project=\"%s\" />', path.translate(dir))\nend\nend\n_p(1,'</ImportGroup>')\nend\nend\nlocal function add_trailing_backslash(dir)\nif dir:len() > 0 and dir:sub(-1) ~= \"\\\\\" then\nreturn dir..\"\\\\\"\nend\nreturn dir\nend\nfunction vc2010.outputProperties(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = p"
- "remake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nlocal target = cfg.buildtarget\nlocal outdir = add_trailing_backslash(target.directory)\nlocal intdir = add_trailing_backslash(iif(action.vstudio.intDirAbsolute\n, path.translate(\n path.join(prj.solution.location, cfg.objectsdir)\n, '\\\\')\n, cfg.objectsdir\n))\n_p(1,'<PropertyGroup '..if_config_and_platform() ..'>', premake.esc(cfginfo.name))\n_p(2,'<OutDir>%s</OutDir>', iif(outdir:len() > 0, premake.esc(outdir), \".\\\\\"))\nif cfg.platform == \"Xbox360\" then\n_p(2,'<OutputFile>$(OutDir)%s</OutputFile>', premake.esc(target.name))\nend\n_p(2,'<IntDir>%s</IntDir>', premake.esc(intdir))\n_p(2,'<TargetName>%s</TargetName>', premake.esc(path.getbasename(target.name)))\n_p(2,'<TargetExt>%s</TargetExt>', premake.esc(path.getextension(target.name)))\nif cfg.kind == \"SharedLib\" then\nlocal ignore = (cfg.flags.NoImportLib ~= nil)\n_p(2,'<IgnoreImportLibrary>%s</IgnoreImportLibrary>', tostring(ignore))\nend\nif cfg.platform == \"Durango\" then\n_p"
- "(2, '<ReferencePath>$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)</ReferencePath>')\n_p(2, '<LibraryPath>$(Console_SdkLibPath)</LibraryPath>')\n_p(2, '<LibraryWPath>$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)</LibraryWPath>')\n_p(2, '<IncludePath>$(Console_SdkIncludeRoot)</IncludePath>')\n_p(2, '<ExecutablePath>$(Console_SdkRoot)bin;$(VCInstallDir)bin\\\\x86_amd64;$(VCInstallDir)bin;$(WindowsSDK_ExecutablePath_x86);$(VSInstallDir)Common7\\\\Tools\\\\bin;$(VSInstallDir)Common7\\\\tools;$(VSInstallDir)Common7\\\\ide;$(ProgramFiles)\\\\HTML Help Workshop;$(MSBuildToolsPath32);$(FxCopDir);$(PATH);</ExecutablePath>')\nif cfg.imagepath then\n_p(2, '<LayoutDir>%s</LayoutDir>', cfg.imagepath)\nelse\n_p(2, '<LayoutDir>%s</LayoutDir>', prj.name)\nend\nif cfg.pullmappingfile ~= nil then\n_p(2,'<PullMappingFile>%s</PullMappingFile>', premake.esc(cfg.pullmappingfile))\nend\n_p(2, '<LayoutExtensionFilter>*.pdb;*.ilk;*.exp;*.lib;*.winmd;*.appxrecipe;*.pri;*.idb</LayoutExtensionFilter>')\n_p(2, '<Isolate"
- "ConfigurationsOnDeploy>true</IsolateConfigurationsOnDeploy>')\nend\nif cfg.kind ~= \"StaticLib\" then\n_p(2,'<LinkIncremental>%s</LinkIncremental>', tostring(premake.config.isincrementallink(cfg)))\nend\nif cfg.flags.NoManifest then\n_p(2,'<GenerateManifest>false</GenerateManifest>')\nend\n_p(1,'</PropertyGroup>')\nend\nend\nlocal function runtime(cfg)\nlocal runtime\nlocal flags = cfg.flags\nif premake.config.isdebugbuild(cfg) then\nruntime = iif(flags.StaticRuntime and not flags.Managed, \"MultiThreadedDebug\", \"MultiThreadedDebugDLL\")\nelse\nruntime = iif(flags.StaticRuntime and not flags.Managed, \"MultiThreaded\", \"MultiThreadedDLL\")\nend\nreturn runtime\nend\nlocal function precompiled_header(cfg)\n if not cfg.flags.NoPCH and cfg.pchheader then\n_p(3,'<PrecompiledHeader>Use</PrecompiledHeader>')\n_p(3,'<PrecompiledHeaderFile>%s</PrecompiledHeaderFile>', cfg.pchheader)\nelse\n_p(3,'<PrecompiledHeader></PrecompiledHeader>')\nend\nend\nlocal function preprocessor(indent,cfg)\nif #cfg.defines > 0 th"
- "en\n_p(indent,'<PreprocessorDefinitions>%s;%%(PreprocessorDefinitions)</PreprocessorDefinitions>'\n,premake.esc(table.concat(cfg.defines, \";\")))\nelse\n_p(indent,'<PreprocessorDefinitions></PreprocessorDefinitions>')\nend\nend\nlocal function include_dirs(indent,cfg)\nlocal includedirs = table.join(cfg.userincludedirs, cfg.includedirs)\nif #includedirs> 0 then\n_p(indent,'<AdditionalIncludeDirectories>%s;%%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>'\n,premake.esc(path.translate(table.concat(includedirs, \";\"), '\\\\')))\nend\nend\nlocal function using_dirs(indent,cfg)\nif #cfg.usingdirs > 0 then\n_p(indent,'<AdditionalUsingDirectories>%s;%%(AdditionalUsingDirectories)</AdditionalUsingDirectories>'\n,premake.esc(path.translate(table.concat(cfg.usingdirs, \";\"), '\\\\')))\nend\nend\nlocal function resource_compile(cfg)\n_p(2,'<ResourceCompile>')\npreprocessor(3,cfg)\ninclude_dirs(3,cfg)\n_p(2,'</ResourceCompile>')\nend\nlocal function exceptions(cfg)\nif cfg.flags.NoExceptions then\n_p(3, "
- "'<ExceptionHandling>false</ExceptionHandling>')\nelseif cfg.flags.SEH then\n_p(3, '<ExceptionHandling>Async</ExceptionHandling>')\nend\nend\nlocal function rtti(cfg)\nif cfg.flags.NoRTTI and not cfg.flags.Managed then\n_p(3,'<RuntimeTypeInfo>false</RuntimeTypeInfo>')\nend\nend\nlocal function calling_convention(cfg)\nif cfg.flags.FastCall then\n_p(3,'<CallingConvention>FastCall</CallingConvention>')\nelseif cfg.flags.StdCall then\n_p(3,'<CallingConvention>StdCall</CallingConvention>')\nend\nend\nlocal function wchar_t_builtin(cfg)\nif cfg.flags.NativeWChar then\n_p(3,'<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>')\nelseif cfg.flags.NoNativeWChar then\n_p(3,'<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>')\nend\nend\nlocal function sse(cfg)\nif cfg.flags.EnableSSE then\n_p(3, '<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>')\nelseif cfg.flags.EnableSSE2 then\n_p(3, '<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructio"
- "nSet>')\nelseif cfg.flags.EnableAVX then\n_p(3, '<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>')\nelseif cfg.flags.EnableAVX2 then\n_p(3, '<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>')\nend\nend\nlocal function floating_point(cfg)\n if cfg.flags.FloatFast then\n_p(3,'<FloatingPointModel>Fast</FloatingPointModel>')\nelseif cfg.flags.FloatStrict and not cfg.flags.Managed then\n_p(3,'<FloatingPointModel>Strict</FloatingPointModel>')\nend\nend\nlocal function debug_info(cfg)\nlocal debug_info = ''\nif cfg.flags.Symbols then\nif cfg.flags.C7DebugInfo then\ndebug_info = \"OldStyle\"\nelseif (action.vstudio.supports64bitEditContinue == false and cfg.platform == \"x64\")\nor cfg.flags.Managed\nor premake.config.isoptimizedbuild(cfg.flags)\nor cfg.flags.NoEditAndContinue\nthen\ndebug_info = \"ProgramDatabase\"\nelse\ndebug_info = \"EditAndContinue\"\nend\nend\n_p(3,'<DebugInformationFormat>%s</DebugInformationFormat>',debug_info)\nen"
- "d\nlocal function minimal_build(cfg)\nif premake.config.isdebugbuild(cfg) and cfg.flags.EnableMinimalRebuild then\n_p(3,'<MinimalRebuild>true</MinimalRebuild>')\nelse\n_p(3,'<MinimalRebuild>false</MinimalRebuild>')\nend\nend\nlocal function compile_language(cfg)\nif cfg.options.ForceCPP then\n_p(3,'<CompileAs>CompileAsCpp</CompileAs>')\nelse\nif cfg.language == \"C\" then\n_p(3,'<CompileAs>CompileAsC</CompileAs>')\nend\nend\nend\nlocal function forcedinclude_files(indent,cfg)\nif #cfg.forcedincludes > 0 then\n_p(indent,'<ForcedIncludeFiles>%s</ForcedIncludeFiles>'\n,premake.esc(path.translate(table.concat(cfg.forcedincludes, \";\"), '\\\\')))\nend\nend\nlocal function vs10_clcompile(cfg)\n_p(2,'<ClCompile>')\nlocal unsignedChar = \"/J \"\nlocal buildoptions = cfg.buildoptions\nif cfg.platform == \"Orbis\" then\nunsignedChar = \"-funsigned-char \";\n_p(3,'<GenerateDebugInformation>%s</GenerateDebugInformation>', tostring(cfg.flags.Symbols ~= nil))\nend\nif cfg.language == \"C\" and not cfg.options.ForceCPP then"
- "\nbuildoptions = table.join(buildoptions, cfg.buildoptions_c)\nelse\nbuildoptions = table.join(buildoptions, cfg.buildoptions_cpp)\nend\n_p(3,'<AdditionalOptions>%s %s%%(AdditionalOptions)</AdditionalOptions>'\n, table.concat(premake.esc(buildoptions), \" \")\n, iif(cfg.flags.UnsignedChar, unsignedChar, \" \")\n)\n_p(3,'<Optimization>%s</Optimization>',optimisation(cfg))\ninclude_dirs(3, cfg)\nusing_dirs(3, cfg)\npreprocessor(3, cfg)\nminimal_build(cfg)\nif not premake.config.isoptimizedbuild(cfg.flags) then\nif not cfg.flags.Managed then\n_p(3, '<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>')\nend\nif cfg.flags.ExtraWarnings then\nend\nelse\n_p(3, '<StringPooling>true</StringPooling>')\nend\nif cfg.platform == \"Durango\" or cfg.flags.NoWinRT then\n_p(3, '<CompileAsWinRT>false</CompileAsWinRT>')\nend\n_p(3, '<RuntimeLibrary>%s</RuntimeLibrary>', runtime(cfg))\nif cfg.flags.NoBufferSecurityCheck then\n_p(3, '<BufferSecurityCheck>false</BufferSecurityCheck>')\nend\n_p(3,'<FunctionLevelLinking>true<"
- "/FunctionLevelLinking>')\nif not cfg.flags.NoMultiProcessorCompilation and not cfg.flags.EnableMinimalRebuild then\n_p(3, '<MultiProcessorCompilation>true</MultiProcessorCompilation>')\nelse\n_p(3, '<MultiProcessorCompilation>false</MultiProcessorCompilation>')\nend\nprecompiled_header(cfg)\nif cfg.flags.PedanticWarnings then\n_p(3, '<WarningLevel>EnableAllWarnings</WarningLevel>')\nelseif cfg.flags.ExtraWarnings then\n_p(3, '<WarningLevel>Level4</WarningLevel>')\nelseif cfg.flags.MinimumWarnings then\n_p(3, '<WarningLevel>Level1</WarningLevel>')\nelse\n_p(3 ,'<WarningLevel>Level3</WarningLevel>')\nend\nif cfg.flags.FatalWarnings then\n_p(3, '<TreatWarningAsError>true</TreatWarningAsError>')\nend\nexceptions(cfg)\nrtti(cfg)\ncalling_convention(cfg)\nwchar_t_builtin(cfg)\nsse(cfg)\nfloating_point(cfg)\ndebug_info(cfg)\nif _ACTION:sub(3) == \"llvm\" then\n_p(3,'<SupportJustMyCode>false</SupportJustMyCode>')\nend\nif cfg.flags.Symbols\nand _ACTION:sub(3) ~= \"2017\" and _ACTION:sub(3) ~= \"llvm\"\nthen\n_p(3, '<"
- "ProgramDataBaseFileName>$(OutDir)%s.pdb</ProgramDataBaseFileName>'\n, path.getbasename(cfg.buildtarget.name)\n)\nend\nif cfg.flags.NoFramePointer then\n_p(3, '<OmitFramePointers>true</OmitFramePointers>')\nend\nif cfg.flags.UseFullPaths then\n_p(3, '<UseFullPaths>true</UseFullPaths>')\nend\ncompile_language(cfg)\nforcedinclude_files(3,cfg);\n_p(2,'</ClCompile>')\nend\nlocal function event_hooks(cfg)\nif #cfg.postbuildcommands> 0 then\n _p(2,'<PostBuildEvent>')\n_p(3,'<Command>%s</Command>',premake.esc(table.implode(cfg.postbuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'</PostBuildEvent>')\nend\nif #cfg.prebuildcommands> 0 then\n _p(2,'<PreBuildEvent>')\n_p(3,'<Command>%s</Command>',premake.esc(table.implode(cfg.prebuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'</PreBuildEvent>')\nend\nif #cfg.prelinkcommands> 0 then\n _p(2,'<PreLinkEvent>')\n_p(3,'<Command>%s</Command>',premake.esc(table.implode(cfg.prelinkcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'</PreLinkEvent>')\nend\nend\nlocal function additio"
- "nal_options(indent,cfg)\nif #cfg.linkoptions > 0 then\n_p(indent,'<AdditionalOptions>%s %%(AdditionalOptions)</AdditionalOptions>',\ntable.concat(premake.esc(cfg.linkoptions), \" \"))\nend\nend\nlocal function link_target_machine(index,cfg)\nlocal platforms = {x32 = 'MachineX86', x64 = 'MachineX64'}\nif platforms[cfg.platform] then\n_p(index,'<TargetMachine>%s</TargetMachine>', platforms[cfg.platform])\nend\nend\nlocal function item_def_lib(prj, cfg)\nif cfg.kind == 'StaticLib' and cfg.platform ~= \"Xbox360\" then\n_p(1,'<Lib>')\n_p(2,'<OutputFile>$(OutDir)%s</OutputFile>',cfg.buildtarget.name)\nadditional_options(2,cfg)\nlink_target_machine(2,cfg)\nif _ACTION:sub(3) == \"llvm\" and prj.name == \"portaudio\" then -- MSVC-LLVM needs special help\n_p(3,'<AdditionalDependencies>ksuser.lib;%%(AdditionalDependencies)</AdditionalDependencies>')\nend\n_p(1,'</Lib>')\nend\nend\nlocal function import_lib(cfg)\nif cfg.kind == \"SharedLib\" then\nlocal implibname = cfg.linktarget.fullpath\n_p(3,'<ImportLibrary>%s</Import"
- "Library>',iif(cfg.flags.NoImportLib, cfg.objectsdir .. \"\\\\\" .. path.getname(implibname), implibname))\nend\nend\nlocal function hasmasmfiles(prj)\nlocal files = vc2010.getfilegroup(prj, \"MASM\")\nreturn #files > 0\nend\nlocal function vs10_masm(prj, cfg)\nif hasmasmfiles(prj) then\n_p(2, '<MASM>')\n_p(3,'<AdditionalOptions>%s %%(AdditionalOptions)</AdditionalOptions>'\n, table.concat(premake.esc(table.join(cfg.buildoptions, cfg.buildoptions_asm)), \" \")\n)\nlocal includedirs = table.join(cfg.userincludedirs, cfg.includedirs)\nif #includedirs > 0 then\n_p(3, '<IncludePaths>%s;%%(IncludePaths)</IncludePaths>'\n, premake.esc(path.translate(table.concat(includedirs, \";\"), '\\\\'))\n)\nend\nlocal defines = table.join(cfg.defines)\ntable.insertflat(defines, iif(premake.config.isdebugbuild(cfg), \"_DEBUG\", {}))\ntable.insert(defines, iif(cfg.platform == \"x64\", \"_WIN64\", \"_WIN32\"))\ntable.insert(defines, iif(prj.kind == \"SharedLib\", \"_EXPORT=EXPORT\", \"_EXPORT=\"))\n_p(3, '<PreprocessorDefinitions>%"
- "s;%%(PreprocessorDefinitions)</PreprocessorDefinitions>'\n, premake.esc(table.concat(defines, \";\"))\n)\nif cfg.flags.FatalWarnings then\n_p(3,'<TreatWarningsAsErrors>true</TreatWarningsAsErrors>')\nend\nif cfg.flags.MinimumWarnings then\n_p(3,'<WarningLevel>0</WarningLevel>')\nelse\n_p(3,'<WarningLevel>3</WarningLevel>')\nend\n_p(2, '</MASM>')\nend\nend\nfunction vc2010.link(cfg)\n_p(2,'<Link>')\n_p(3,'<SubSystem>%s</SubSystem>', iif(cfg.kind == \"ConsoleApp\", \"Console\", \"Windows\"))\n_p(3,'<GenerateDebugInformation>%s</GenerateDebugInformation>',\niif(cfg.flags.Symbols ~= nil, iif(_ACTION:sub(3) ~= \"llvm\", \"true\", \"DebugFull\"), \"false\")\n)\nif cfg.flags.Symbols\nand (_ACTION:sub(3) == \"2017\" or _ACTION:sub(3) == \"llvm\")\nthen\n_p(3, '<ProgramDataBaseFileName>$(OutDir)%s.pdb</ProgramDataBaseFileName>'\n, path.getbasename(cfg.buildtarget.name)\n)\nend\nif premake.config.isoptimizedbuild(cfg.flags) then\n_p(3,'<EnableCOMDATFolding>true</EnableCOMDATFolding>')\n_p(3,'<OptimizeReferences>true</O"
- "ptimizeReferences>')\nend\nif cfg.kind ~= 'StaticLib' then\nvc2010.additionalDependencies(3,cfg)\n_p(3,'<OutputFile>$(OutDir)%s</OutputFile>', cfg.buildtarget.name)\nif #cfg.libdirs > 0 then\n_p(3,'<AdditionalLibraryDirectories>%s;%%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>'\n, premake.esc(path.translate(table.concat(cfg.libdirs, ';'), '\\\\'))\n)\nend\nif vc2010.config_type(cfg) == 'Application' and not cfg.flags.WinMain and not cfg.flags.Managed then\nif cfg.flags.Unicode then\n_p(3,'<EntryPointSymbol>wmainCRTStartup</EntryPointSymbol>')\nelse\n_p(3,'<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>')\nend\nend\nimport_lib(cfg)\nlocal deffile = premake.findfile(cfg, \".def\")\nif deffile then\n_p(3,'<ModuleDefinitionFile>%s</ModuleDefinitionFile>', deffile)\nend\nlink_target_machine(3,cfg)\nadditional_options(3,cfg)\nif cfg.flags.NoWinMD and vstudio.iswinrt() and prj.kind == \"WindowedApp\" then\n_p(3,'<GenerateWindowsMetadata>false</GenerateWindowsMetadata>' )\nend\nend\n_p(2,'</Link>'"
- ")\nend\nfunction vc2010.additionalDependencies(tab,cfg)\nlocal links = premake.getlinks(cfg, \"system\", \"fullpath\")\nif #links > 0 then\nlocal deps = \"\"\nif cfg.platform == \"Orbis\" then\nfor _, v in ipairs(links) do\ndeps = deps .. \"-l\" .. v .. \";\"\nend\nelse\ndeps = table.concat(links, \";\")\nend\n_p(tab, '<AdditionalDependencies>%s;%s</AdditionalDependencies>'\n, deps\n, iif(cfg.platform == \"Durango\"\n, '%(XboxExtensionsDependencies)'\n, '%(AdditionalDependencies)'\n)\n)\nelseif cfg.platform == \"Durango\" then\n_p(tab, '<AdditionalDependencies>%%(XboxExtensionsDependencies)</AdditionalDependencies>')\nend\nend\nlocal function item_definitions(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,'<ItemDefinitionGroup ' ..if_config_and_platform() ..'>'\n,premake.esc(cfginfo.name))\nvs10_clcompile(cfg)\nresource_compile(cfg)\nitem_def_lib(prj, cfg)\nvc2010.link(cfg)\nevent_hooks(cfg)\nvs10_masm(prj, c"
- "fg)\n_p(1,'</ItemDefinitionGroup>')\nend\nend\nfunction vc2010.getfilegroup(prj, group)\nlocal sortedfiles = prj.vc2010sortedfiles\nif not sortedfiles then\nsortedfiles = {\nClCompile = {},\nClInclude = {},\nMASM = {},\nNone = {},\nResourceCompile = {},\nAppxManifest = {},\nNatvis = {},\nImage = {},\nDeploymentContent = {}\n}\nlocal foundAppxManifest = false\nfor file in premake.project.eachfile(prj, true) do\nif path.issourcefilevs(file.name) then\ntable.insert(sortedfiles.ClCompile, file)\nelseif path.iscppheader(file.name) then\nif not table.icontains(prj.removefiles, file) then\ntable.insert(sortedfiles.ClInclude, file)\nend\nelseif path.isresourcefile(file.name) then\ntable.insert(sortedfiles.ResourceCompile, file)\nelseif path.isimagefile(file.name) then\ntable.insert(sortedfiles.Image, file)\nelseif path.isappxmanifest(file.name) then\nfoundAppxManifest = true\ntable.insert(sortedfiles.AppxManifest, file)\nelseif path.isnatvis(file.name) then\ntable.insert(sortedfiles.Natvis, file)\nelseif path.isasmfil"
- "e(file.name) then\ntable.insert(sortedfiles.MASM, file)\nelseif file.flags and table.icontains(file.flags, \"DeploymentContent\") then\ntable.insert(sortedfiles.DeploymentContent, file)\nelse\ntable.insert(sortedfiles.None, file)\nend\nend\nif vstudio.iswinrt() and prj.kind == \"WindowedApp\" and not foundAppxManifest then\nvstudio.needAppxManifest = true\nlocal fcfg = {}\nfcfg.name = prj.name .. \"/Package.appxmanifest\"\nfcfg.vpath = premake.project.getvpath(prj, fcfg.name)\ntable.insert(sortedfiles.AppxManifest, fcfg)\nlocal logo = {}\nlogo.name = prj.name .. \"/Logo.png\"\nlogo.vpath = logo.name\ntable.insert(sortedfiles.Image, logo)\nlocal smallLogo = {}\nsmallLogo.name = prj.name .. \"/SmallLogo.png\"\nsmallLogo.vpath = smallLogo.name\ntable.insert(sortedfiles.Image, smallLogo)\nlocal storeLogo = {}\nstoreLogo.name = prj.name .. \"/StoreLogo.png\"\nstoreLogo.vpath = storeLogo.name\ntable.insert(sortedfiles.Image, storeLogo)\nlocal splashScreen = {}\nsplashScreen.name = prj.name .. \"/SplashScreen.png"
- "\"\nsplashScreen.vpath = splashScreen.name\ntable.insert(sortedfiles.Image, splashScreen)\nend\nprj.vc2010sortedfiles = sortedfiles\nend\nreturn sortedfiles[group]\nend\nfunction vc2010.files(prj)\nvc2010.simplefilesgroup(prj, \"ClInclude\")\nvc2010.compilerfilesgroup(prj)\nvc2010.simplefilesgroup(prj, \"None\")\nvc2010.customtaskgroup(prj)\nvc2010.simplefilesgroup(prj, \"ResourceCompile\")\nvc2010.simplefilesgroup(prj, \"AppxManifest\")\nvc2010.simplefilesgroup(prj, \"Natvis\")\nvc2010.deploymentcontentgroup(prj, \"Image\")\nvc2010.deploymentcontentgroup(prj, \"DeploymentContent\", \"None\")\nend\nfunction vc2010.customtaskgroup(prj)\nlocal files = { }\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nlocal fcfg = { }\nfcfg.name = path.getrelative(prj.location,buildtask[1])\nfcfg.vpath = path.trimdots(fcfg.name)\ntable.insert(files, fcfg)\nend\nend\nif #files > 0 then\n_p(1,'<ItemGroup>')\nlocal groupedBuildTasks = {}\nfor _, custombuildtas"
- "k in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nif (groupedBuildTasks[buildtask[1]] == nil) then\ngroupedBuildTasks[buildtask[1]] = {}\nend\ntable.insert(groupedBuildTasks[buildtask[1]], buildtask)\nend\nend\nfor name, custombuildtask in pairs(groupedBuildTasks or {}) do\n_p(2,'<CustomBuild Include=\\\"%s\\\">', path.translate(path.getrelative(prj.location,name), \"\\\\\"))\n_p(3,'<FileType>Text</FileType>')\nlocal cmd = \"\"\nlocal outputs = \"\"\nfor _, buildtask in ipairs(custombuildtask or {}) do\nfor _, cmdline in ipairs(buildtask[4] or {}) do\ncmd = cmd .. cmdline\nlocal num = 1\nfor _, depdata in ipairs(buildtask[3] or {}) do\ncmd = string.gsub(cmd,\"%$%(\" .. num ..\"%)\", string.format(\"%s \",path.getrelative(prj.location,depdata)))\nnum = num + 1\nend\ncmd = string.gsub(cmd, \"%$%(<%)\", string.format(\"%s \",path.getrelative(prj.location,buildtask[1])))\ncmd = string.gsub(cmd, \"%$%(@%)\", string.format(\"%s \",path.getrelative(prj.location,buildtask"
- "[2])))\ncmd = cmd .. \"\\r\\n\"\nend\noutputs = outputs .. path.getrelative(prj.location,buildtask[2]) .. \";\"\nend\n_p(3,'<Command>%s</Command>',cmd)\n_p(3,'<Outputs>%s%%(Outputs)</Outputs>',outputs)\n_p(3,'<SubType>Designer</SubType>')\n_p(3,'<Message></Message>')\n_p(2,'</CustomBuild>')\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.simplefilesgroup(prj, section, subtype)\nlocal files = vc2010.getfilegroup(prj, section)\nif #files > 0 then\n_p(1,'<ItemGroup>')\nfor _, file in ipairs(files) do\nif subtype then\n_p(2,'<%s Include=\\\"%s\\\">', section, path.translate(file.name, \"\\\\\"))\n_p(3,'<SubType>%s</SubType>', subtype)\n_p(2,'</%s>', section)\nelse\n_p(2,'<%s Include=\\\"%s\\\" />', section, path.translate(file.name, \"\\\\\"))\nend\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.deploymentcontentgroup(prj, section, filetype)\nif filetype == nil then\nfiletype = section\nend\nlocal files = vc2010.getfilegroup(prj, section)\nif #files > 0 then\n_p(1,'<ItemGroup>')\nfor _, file in ipair"
- "s(files) do\n_p(2,'<%s Include=\\\"%s\\\">', filetype, path.translate(file.name, \"\\\\\"))\n_p(3,'<DeploymentContent>true</DeploymentContent>')\n_p(3,'<Link>%s</Link>', path.translate(file.vpath, \"\\\\\"))\n_p(2,'</%s>', filetype)\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.compilerfilesgroup(prj)\nlocal configs = prj.solution.vstudio_configs\nlocal files = vc2010.getfilegroup(prj, \"ClCompile\")\nif #files > 0 then\nlocal config_mappings = {}\nfor _, cfginfo in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nif cfg.pchheader and cfg.pchsource and not cfg.flags.NoPCH then\nconfig_mappings[cfginfo] = path.translate(cfg.pchsource, \"\\\\\")\nend\nend\n_p(1,'<ItemGroup>')\nfor _, file in ipairs(files) do\nlocal translatedpath = path.translate(file.name, \"\\\\\")\n_p(2, '<ClCompile Include=\\\"%s\\\">', translatedpath)\n_p(3, '<ObjectFileName>$(IntDir)%s\\\\</ObjectFileName>'\n, premake.esc(path.translate(path.trimdots(path.getdirectory(file.name)))"
- ")\n)\nif path.iscxfile(file.name) then\n_p(3, '<CompileAsWinRT>true</CompileAsWinRT>')\n_p(3, '<RuntimeTypeInfo>true</RuntimeTypeInfo>')\n_p(3, '<PrecompiledHeader>NotUsing</PrecompiledHeader>')\nend\nif vstudio.iswinrt() and string.len(file.name) > 2 and string.sub(file.name, -2) == \".c\" then\n_p(3,'<CompileAsWinRT>FALSE</CompileAsWinRT>')\nend\nfor _, cfginfo in ipairs(configs) do\nif config_mappings[cfginfo] and translatedpath == config_mappings[cfginfo] then\n_p(3,'<PrecompiledHeader '.. if_config_and_platform() .. '>Create</PrecompiledHeader>', premake.esc(cfginfo.name))\nconfig_mappings[cfginfo] = nil --only one source file per pch\nend\nend\nlocal nopch = table.icontains(prj.nopch, file.name)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nif nopch or table.icontains(cfg.nopch, file.name) then\n_p(3,'<PrecompiledHeader '.. if_config_and_platform() .. '>NotUsing</PrecompiledHeader>', premake.esc(vsconfig.name))\nend\nend\nlocal "
- "excluded = table.icontains(prj.excludes, file.name)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nlocal fileincfg = table.icontains(cfg.files, file.name)\nlocal cfgexcluded = table.icontains(cfg.excludes, file.name)\nif excluded or not fileincfg or cfgexcluded then\n_p(3, '<ExcludedFromBuild '\n.. if_config_and_platform()\n.. '>true</ExcludedFromBuild>'\n, premake.esc(vsconfig.name)\n)\nend\nend\nif prj.flags and prj.flags.Managed then\nlocal prjforcenative = table.icontains(prj.forcenative, file.name)\nfor _,vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nif prjforcenative or table.icontains(cfg.forcenative, file.name) then\n_p(3, '<CompileAsManaged ' .. if_config_and_platform() .. '>false</CompileAsManaged>', premake.esc(vsconfig.name))\nend\nend\nend\n_p(2,'</ClCompile>')\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.masmfiles(prj)\nlocal configs = prj.solutio"
- "n.vstudio_configs\nlocal files = vc2010.getfilegroup(prj, \"MASM\")\nif #files > 0 then\n_p(1, '<ItemGroup>')\nfor _, file in ipairs(files) do\nlocal translatedpath = path.translate(file.name, \"\\\\\")\n_p(2, '<MASM Include=\"%s\">', translatedpath)\nlocal excluded = table.icontains(prj.excludes, file.name)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nlocal fileincfg = table.icontains(cfg.files, file.name)\nlocal cfgexcluded = table.icontains(cfg.excludes, file.name)\nif excluded or not fileincfg or cfgexcluded then\n_p(3, '<ExcludedFromBuild '\n.. if_config_and_platform()\n.. '>true</ExcludedFromBuild>'\n, premake.esc(vsconfig.name)\n)\nend\nend\n_p(2, '</MASM>')\nend\n_p(1, '</ItemGroup>')\nend\nend\nfunction vc2010.header(targets)\nio.eol = \"\\r\\n\"\n_p('<?xml version=\"1.0\" encoding=\"utf-8\"?>')\nlocal t = \"\"\nif targets then\nt = ' DefaultTargets=\"' .. targets .. '\"'\nend\n_p('<Project%s ToolsVersion=\"%s\" xmlns=\"http:"
- "//schemas.microsoft.com/developer/msbuild/2003\">', t, action.vstudio.toolsVersion)\nend\nfunction premake.vs2010_vcxproj(prj)\nlocal usemasm = hasmasmfiles(prj)\nio.indent = \" \"\nvc2010.header(\"Build\")\nvs2010_config(prj)\nvs2010_globals(prj)\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.Default.props\" />')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nvc2010.configurationPropertyGroup(cfg, cfginfo)\nend\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.props\" />')\n_p(1,'<ImportGroup Label=\"ExtensionSettings\">')\nif usemasm then\n_p(2, '<Import Project=\"$(VCTargetsPath)\\\\BuildCustomizations\\\\masm.props\" />')\nend\n_p(1,'</ImportGroup>')\nimport_props(prj)\n_p(1,'<PropertyGroup Label=\"UserMacros\" />')\nvc2010.outputProperties(prj)\nitem_definitions(prj)\nif prj.flags.Managed then\nvc2010.clrReferences(prj)\nend\nvc2010.files(prj)\nvc2010.projectReferences(prj)\nvc2010.sdkReferen"
- "ces(prj)\nvc2010.masmfiles(prj)\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.targets\" />')\n_p(1,'<ImportGroup Label=\"ExtensionTargets\">')\nif usemasm then\n_p(2, '<Import Project=\"$(VCTargetsPath)\\\\BuildCustomizations\\\\masm.targets\" />')\nend\n_p(1,'</ImportGroup>')\n_p('</Project>')\nend\nfunction vc2010.clrReferences(prj)\nif #prj.clrreferences == 0 then\nreturn\nend\n_p(1,'<ItemGroup>')\nfor _, ref in ipairs(prj.clrreferences) do\nif os.isfile(ref) then\nlocal assembly = path.getbasename(ref)\n_p(2,'<Reference Include=\"%s\">', assembly)\n_p(3,'<HintPath>%s</HintPath>', path.getrelative(prj.location, ref))\n_p(2,'</Reference>')\nelse\n_p(2,'<Reference Include=\"%s\" />', ref)\nend\nend\n_p(1,'</ItemGroup>')\nend\nfunction vc2010.projectReferences(prj)\nlocal deps = premake.getdependencies(prj)\nif #deps == 0 and #prj.vsimportreferences == 0 then\nreturn\nend\n_p(1,'<ItemGroup>')\nfor _, dep in ipairs(deps) do\nlocal deppath = path.getrelative(prj.location, vstudio.projectfile(dep))\n"
- "_p(2,'<ProjectReference Include=\\\"%s\\\">', path.translate(deppath, \"\\\\\"))\n_p(3,'<Project>{%s}</Project>', dep.uuid)\nif vstudio.iswinrt() then\n_p(3,'<ReferenceOutputAssembly>false</ReferenceOutputAssembly>')\nend\n_p(2,'</ProjectReference>')\nend\nfor _, ref in ipairs(prj.vsimportreferences) do\nlocal iprj = premake.vstudio.getimportprj(ref, prj.solution)\n_p(2,'<ProjectReference Include=\\\"%s\\\">', iprj.relpath)\n_p(3,'<Project>{%s}</Project>', iprj.uuid)\n_p(2,'</ProjectReference>')\nend\n_p(1,'</ItemGroup>')\nend\nfunction vc2010.sdkReferences(prj)\nlocal refs = prj.sdkreferences\nif #refs > 0 then\n_p(1,'<ItemGroup>')\nfor _, ref in ipairs(refs) do\n_p(2,'<SDKReference Include=\\\"%s\\\" />', ref)\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.debugdir(cfg)\nlocal debuggerFlavor =\n iif(cfg.platform == \"Orbis\", 'ORBISDebugger'\n, iif(cfg.platform == \"Durango\", 'XboxOneVCppDebugger'\n, 'WindowsLocalDebugger'\n))\n_p(2, '<DebuggerFlavor>%s</DebuggerFlav"
- "or>', debuggerFlavor)\nif cfg.debugdir and not vstudio.iswinrt() then\n_p(2, '<LocalDebuggerWorkingDirectory>%s</LocalDebuggerWorkingDirectory>'\n, path.translate(cfg.debugdir, '\\\\')\n)\nend\nif cfg.debugargs then\n_p(2, '<LocalDebuggerCommandArguments>%s</LocalDebuggerCommandArguments>'\n, table.concat(cfg.debugargs, \" \")\n)\nend\nif cfg.debugenvs and #cfg.debugenvs > 0 then\n_p(2, '<LocalDebuggerEnvironment>%s%s</LocalDebuggerEnvironment>'\n, table.concat(cfg.debugenvs, \"\\n\")\n, iif(cfg.flags.DebugEnvsInherit,'\\n$(LocalDebuggerEnvironment)', '')\n)\nif cfg.flags.DebugEnvsDontMerge then\n_p(2, '<LocalDebuggerMergeEnvironment>false</LocalDebuggerMergeEnvironment>')\nend\nend\nif cfg.deploymode then\n_p(' <DeployMode>%s</DeployMode>', cfg.deploymode)\nend\nend\nfunction premake.vs2010_vcxproj_user(prj)\nio.indent = \" \"\nvc2010.header()\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(' <PropertyGroup '.."
- " if_config_and_platform() ..'>', premake.esc(cfginfo.name))\nvc2010.debugdir(cfg)\n_p(' </PropertyGroup>')\nend\n_p('</Project>')\nend\nlocal png1x1data = {\n0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, -- .PNG........IHDR\n0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x00, 0x00, 0x00, 0x25, 0xdb, 0x56, -- .............%.V\n0xca, 0x00, 0x00, 0x00, 0x03, 0x50, 0x4c, 0x54, 0x45, 0x00, 0x00, 0x00, 0xa7, 0x7a, 0x3d, 0xda, -- .....PLTE....z=.\n0x00, 0x00, 0x00, 0x01, 0x74, 0x52, 0x4e, 0x53, 0x00, 0x40, 0xe6, 0xd8, 0x66, 0x00, 0x00, 0x00, -- ....tRNS.@..f...\n0x0a, 0x49, 0x44, 0x41, 0x54, 0x08, 0xd7, 0x63, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0xe2, -- .IDAT..c`.......\n0x21, 0xbc, 0x33, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, -- !.3....IEND.B`.\n}\nfunction png1x1(obj, filename)\nfilename = premake.project.getfilename(obj, filename)\nlocal f, err = io.open(filename, \"wb\")\nif f then\nfor _, byte in ipairs("
- "png1x1data) do\nf:write(string.char(byte))\nend\nf:close()\nend\nend\nfunction premake.vs2010_appxmanifest(prj)\nio.indent = \" \"\nio.eol = \"\\r\\n\"\n_p('<?xml version=\"1.0\" encoding=\"utf-8\"?>')\nif vstudio.toolset == \"v120_wp81\" then\n_p('<Package xmlns=\"http://schemas.microsoft.com/appx/2010/manifest\" xmlns:m2=\"http://schemas.microsoft.com/appx/2013/manifest\" xmlns:m3=\"http://schemas.microsoft.com/appx/2014/manifest\" xmlns:mp=\"http://schemas.microsoft.com/appx/2014/phone/manifest\">')\nelseif vstudio.storeapp == \"8.1\" then\n_p('<Package xmlns=\"http://schemas.microsoft.com/appx/2010/manifest\" xmlns:m3=\"http://schemas.microsoft.com/appx/2013/manifest\">')\nelseif vstudio.storeapp == \"durango\" then\n_p('<Package xmlns=\"http://schemas.microsoft.com/appx/2010/manifest\" xmlns:mx=\"http://schemas.microsoft.com/appx/2013/xbox/manifest\" IgnorableNamespaces=\"mx\">')\nelse\n_p('<Package xmlns=\"http://schemas.microsoft.com/appx/manifest/foundation/windows10\" xmlns:mp=\"http://schemas.micros"
- "oft.com/appx/2014/phone/manifest\" xmlns:m3=\"http://schemas.microsoft.com/appx/manifest/uap/windows10\">')\nend\n_p(1,'<Identity Name=\"' .. prj.uuid .. '\"')\n_p(2,'Publisher=\"CN=Publisher\"')\n_p(2,'Version=\"1.0.0.0\" />')\nif vstudio.toolset == \"v120_wp81\" or vstudio.storeapp == \"8.2\" then\n_p(1,'<mp:PhoneIdentity PhoneProductId=\"' .. prj.uuid .. '\" PhonePublisherId=\"00000000-0000-0000-0000-000000000000\"/>')\nend\n_p(1, '<Properties>')\n_p(2, '<DisplayName>' .. prj.name .. '</DisplayName>')\n_p(2, '<PublisherDisplayName>PublisherDisplayName</PublisherDisplayName>')\n_p(2, '<Logo>' .. prj.name .. '\\\\StoreLogo.png</Logo>')\npng1x1(prj, \"%%/StoreLogo.png\")\n_p(2, '<Description>' .. prj.name .. '</Description>')\n_p(1,'</Properties>')\nif vstudio.storeapp == \"8.2\" then\n_p(1, '<Dependencies>')\n_p(2, '<TargetDeviceFamily Name=\"Windows.Universal\" MinVersion=\"10.0.10069.0\" MaxVersionTested=\"10.0.10069.0\" />')\n_p(1, '</Dependencies>')\nelseif vstudio.storeapp == \"durango\" then\n_p(1, '<Pr"
- "erequisites>')\n_p(2, '<OSMinVersion>6.2</OSMinVersion>')\n_p(2, '<OSMaxVersionTested>6.2</OSMaxVersionTested>')\n_p(1, '</Prerequisites>')\nelse\n_p(1, '<Prerequisites>')\n_p(2, '<OSMinVersion>6.3.0</OSMinVersion>')\n_p(2, '<OSMaxVersionTested>6.3.0</OSMaxVersionTested>')\n_p(1, '</Prerequisites>')\nend\n_p(1,'<Resources>')\n_p(2,'<Resource Language=\"en-us\"/>')\n_p(1,'</Resources>')\n_p(1,'<Applications>')\n_p(2,'<Application Id=\"App\"')\n_p(3,'Executable=\"$targetnametoken$.exe\"')\n_p(3,'EntryPoint=\"' .. prj.name .. '.App\">')\nif vstudio.storeapp == \"durango\" then\n_p(3, '<VisualElements')\n_p(4, 'DisplayName=\"' .. prj.name .. '\"')\n_p(4, 'Logo=\"' .. prj.name .. '\\\\Logo.png\"')\npng1x1(prj, \"%%/Logo.png\")\n_p(4, 'SmallLogo=\"' .. prj.name .. '\\\\SmallLogo.png\"')\npng1x1(prj, \"%%/SmallLogo.png\")\n_p(4, 'Description=\"' .. prj.name .. '\"')\n_p(4, 'ForegroundText=\"light\"')\n_p(4, 'BackgroundColor=\"transparent\">')\n_p(5, '<SplashScreen Image=\"' .. prj.name .. '\\\\SplashScreen.png\" />')"
- "\npng1x1(prj, \"%%/SplashScreen.png\")\n_p(3, '</VisualElements>')\n_p(3, '<Extensions>')\n_p(4, '<mx:Extension Category=\"xbox.system.resources\">')\n_p(4, '<mx:XboxSystemResources />')\n_p(4, '</mx:Extension>')\n_p(3, '</Extensions>')\nelse\n_p(3, '<m3:VisualElements')\n_p(4, 'DisplayName=\"' .. prj.name .. '\"')\n_p(4, 'Square150x150Logo=\"' .. prj.name .. '\\\\Logo.png\"')\npng1x1(prj, \"%%/Logo.png\")\nif vstudio.toolset == \"v120_wp81\" or vstudio.storeapp == \"8.2\" then\n_p(4, 'Square44x44Logo=\"' .. prj.name .. '\\\\SmallLogo.png\"')\npng1x1(prj, \"%%/SmallLogo.png\")\nelse\n_p(4, 'Square30x30Logo=\"' .. prj.name .. '\\\\SmallLogo.png\"')\npng1x1(prj, \"%%/SmallLogo.png\")\nend\n_p(4, 'Description=\"' .. prj.name .. '\"')\n_p(4, 'ForegroundText=\"light\"')\n_p(4, 'BackgroundColor=\"transparent\">')\n_p(4, '<m3:SplashScreen Image=\"' .. prj.name .. '\\\\SplashScreen.png\" />')\npng1x1(prj, \"%%/SplashScreen.png\")\n_p(3, '</m3:VisualElements>')\nend\n_p(2,'</Application>')\n_p(1,'</Applications>')\n_p("
- "'</Package>')\nend\n",
+ "premake.vstudio.vc2010 = { }\nlocal vc2010 = premake.vstudio.vc2010\nlocal vstudio = premake.vstudio\nlocal function vs2010_config(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nif cfginfo.src_platform == \"TegraAndroid\" then\n_p(1,'<PropertyGroup Label=\"NsightTegraProject\">')\n_p(2,'<NsightTegraProjectRevisionNumber>11</NsightTegraProjectRevisionNumber>')\n_p(1,'</PropertyGroup>')\nbreak\nend\nend\n_p(1,'<ItemGroup Label=\"ProjectConfigurations\">')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\n_p(2,'<ProjectConfiguration Include=\"%s\">', premake.esc(cfginfo.name))\n_p(3,'<Configuration>%s</Configuration>',cfginfo.buildcfg)\n_p(3,'<Platform>%s</Platform>',cfginfo.platform)\n_p(2,'</ProjectConfiguration>')\nend\n_p(1,'</ItemGroup>')\nend\nlocal function vs2010_globals(prj)\nlocal action = premake.action.current()\n_p(1,'<PropertyGroup Label=\"Globals\">')\n_p(2, '<ProjectGuid>{%s}</ProjectGuid>',prj.uuid)\n_p(2, '<RootNamespace>%s</RootNamespace>',prj.name)\nif vstudio.store"
+ "app ~= \"durango\" then\nlocal windowsTargetPlatformVersion = prj.windowstargetplatformversion or action.vstudio.windowsTargetPlatformVersion\nif windowsTargetPlatformVersion ~= nil then\n_p(2,'<WindowsTargetPlatformVersion>%s</WindowsTargetPlatformVersion>',windowsTargetPlatformVersion)\nif windowsTargetPlatformVersion and string.startswith(windowsTargetPlatformVersion, \"10.\") then\n_p(2,'<WindowsTargetPlatformMinVersion>%s</WindowsTargetPlatformMinVersion>', prj.windowstargetplatformminversion or \"10.0.10240.0\")\nend\nend\nend\nif prj.flags and prj.flags.Managed then\nlocal frameworkVersion = prj.framework or \"4.0\"\n_p(2, '<TargetFrameworkVersion>v%s</TargetFrameworkVersion>', frameworkVersion)\n_p(2, '<Keyword>ManagedCProj</Keyword>')\nelseif vstudio.iswinrt() then\n_p(2, '<DefaultLanguage>en-US</DefaultLanguage>')\nif vstudio.storeapp == \"durango\" then\n_p(2, '<Keyword>Win32Proj</Keyword>')\n_p(2, '<ApplicationEnvironment>title</ApplicationEnvironment>')\n_p(2, '<MinimumVisualStudioVersion>14.0</Mi"
+ "nimumVisualStudioVersion>')\n_p(2, '<TargetRuntime>Native</TargetRuntime>')\nelse\n_p(2, '<AppContainerApplication>true</AppContainerApplication>')\n_p(2, '<MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>')\n_p(2, '<ApplicationType>Windows Store</ApplicationType>')\n_p(2, '<ApplicationTypeRevision>%s</ApplicationTypeRevision>', vstudio.storeapp)\nend\nelse\n_p(2, '<Keyword>Win32Proj</Keyword>')\nend\nif _ACTION:sub(3) == \"2015\" or _ACTION:sub(3) == \"2017\" or _ACTION:sub(3) == \"llvm\" then\n_p(2,'<PreferredToolArchitecture>x64</PreferredToolArchitecture>')\nend\nif (_ACTION:sub(3) == \"2017\" or _ACTION:sub(3) == \"llvm\")\nand os.isdir(path.join(os.getenv(\"VSINSTALLDIR\"), \"VC/Tools/MSVC/14.14.26428\")) then\n_p(2,'<VCToolsVersion>14.14.26428</VCToolsVersion>')\nend\nif not vstudio.xpwarning then\n_p(2, '<XPDeprecationWarning>false</XPDeprecationWarning>')\nend\n_p(1,'</PropertyGroup>')\nend\nfunction vc2010.config_type(config)\nlocal t =\n{\nSharedLib = \"DynamicLibrary\",\nStaticLib = \"S"
+ "taticLibrary\",\nConsoleApp = \"Application\",\nWindowedApp = \"Application\"\n}\nreturn t[config.kind]\nend\nlocal function if_config_and_platform()\nreturn 'Condition=\"\\'$(Configuration)|$(Platform)\\'==\\'%s\\'\"'\nend\nlocal function optimisation(cfg)\nlocal result = \"Disabled\"\nfor _, value in ipairs(cfg.flags) do\nif (value == \"Optimize\") then\nresult = \"Full\"\nelseif (value == \"OptimizeSize\") then\nresult = \"MinSpace\"\nelseif (value == \"OptimizeSpeed\") then\nresult = \"MaxSpeed\"\nend\nend\nreturn result\nend\nfunction vc2010.configurationPropertyGroup(cfg, cfginfo)\n_p(1, '<PropertyGroup '..if_config_and_platform() ..' Label=\"Configuration\">'\n, premake.esc(cfginfo.name))\nlocal is2019 = premake.action.current() == premake.action.get(\"vs2019\")\nif is2019 then\n _p(2, '<VCProjectVersion>%s</VCProjectVersion>', action.vstudio.toolsVersion)\nif cfg.flags.UnitySupport then\n _p(2, '<EnableUnitySupport>true</EnableUnitySupport>')\nend\nend\n_p(2, '<ConfigurationType>%s</Configuration"
+ "Type>', vc2010.config_type(cfg))\n_p(2, '<UseDebugLibraries>%s</UseDebugLibraries>', iif(optimisation(cfg) == \"Disabled\",\"true\",\"false\"))\n_p(2, '<PlatformToolset>%s</PlatformToolset>', premake.vstudio.toolset)\nif os.is64bit() then\n_p(2, '<PreferredToolArchitecture>x64</PreferredToolArchitecture>')\nend\nif cfg.flags.MFC then\n_p(2,'<UseOfMfc>%s</UseOfMfc>', iif(cfg.flags.StaticRuntime, \"Static\", \"Dynamic\"))\nend\nif cfg.flags.ATL or cfg.flags.StaticATL then\n_p(2,'<UseOfAtl>%s</UseOfAtl>', iif(cfg.flags.StaticATL, \"Static\", \"Dynamic\"))\nend\nif cfg.flags.Unicode then\n_p(2,'<CharacterSet>Unicode</CharacterSet>')\nend\nif cfg.flags.Managed then\n_p(2,'<CLRSupport>true</CLRSupport>')\nend\nif cfg.platform == \"TegraAndroid\" then\nif cfg.androidtargetapi then\n_p(2,'<AndroidTargetAPI>android-%s</AndroidTargetAPI>', cfg.androidtargetapi)\nend\nif cfg.androidminapi then\n_p(2,'<AndroidMinAPI>android-%s</AndroidMinAPI>', cfg.androidminapi)\nend\nif cfg.androidarch then\n_p(2,'<AndroidArch>%s</A"
+ "ndroidArch>', cfg.androidarch)\nend\nif cfg.androidndktoolchainversion then\n_p(2,'<NdkToolchainVersion>%s</NdkToolchainVersion>', cfg.androidndktoolchainversion)\nend\nif cfg.androidstltype then\n_p(2,'<AndroidStlType>%s</AndroidStlType>', cfg.androidstltype)\nend\nend\nif cfg.platform == \"NX32\" or cfg.platform == \"NX64\" then\n_p(2,'<NintendoSdkRoot>$(NINTENDO_SDK_ROOT)\\\\</NintendoSdkRoot>')\n_p(2,'<NintendoSdkSpec>NX</NintendoSdkSpec>')\nif premake.config.isdebugbuild(cfg) then\n_p(2,'<NintendoSdkBuildType>Debug</NintendoSdkBuildType>')\nelse\n_p(2,'<NintendoSdkBuildType>Release</NintendoSdkBuildType>')\nend\nend\nif cfg.flags.Symbols and (premake.action.current() == premake.action.get(\"vs2017\") or is2019) then\n_p(2, '<DebugSymbols>true</DebugSymbols>')\nend\n_p(1,'</PropertyGroup>')\nend\nlocal function import_props(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,'<ImportGroup '..if_config_and_plat"
+ "form() ..' Label=\"PropertySheets\">'\n,premake.esc(cfginfo.name))\n_p(2,'<Import Project=\"$(UserRootDir)\\\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists(\\'$(UserRootDir)\\\\Microsoft.Cpp.$(Platform).user.props\\')\" Label=\"LocalAppDataPlatform\" />')\nif #cfg.propertysheets > 0 then\nlocal dirs = cfg.propertysheets\nfor _, dir in ipairs(dirs) do\n_p(2,'<Import Project=\"%s\" />', path.translate(dir))\nend\nend\n_p(1,'</ImportGroup>')\nend\nend\nlocal function add_trailing_backslash(dir)\nif dir:len() > 0 and dir:sub(-1) ~= \"\\\\\" then\nreturn dir..\"\\\\\"\nend\nreturn dir\nend\nfunction vc2010.outputProperties(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nlocal target = cfg.buildtarget\nlocal outdir = add_trailing_backslash(target.directory)\nlocal intdir = add_trailing_backslash(iif(action.vstudio.intDirAbsolute\n, path.translate(\n path.join(prj.solution.location, cfg.objectsdir)\n, '\\\\')"
+ "\n, cfg.objectsdir\n))\n_p(1,'<PropertyGroup '..if_config_and_platform() ..'>', premake.esc(cfginfo.name))\n_p(2,'<OutDir>%s</OutDir>', iif(outdir:len() > 0, premake.esc(outdir), \".\\\\\"))\nif cfg.platform == \"Xbox360\" then\n_p(2,'<OutputFile>$(OutDir)%s</OutputFile>', premake.esc(target.name))\nend\n_p(2,'<IntDir>%s</IntDir>', premake.esc(intdir))\n_p(2,'<TargetName>%s</TargetName>', premake.esc(path.getbasename(target.name)))\n_p(2,'<TargetExt>%s</TargetExt>', premake.esc(path.getextension(target.name)))\nif cfg.kind == \"SharedLib\" then\nlocal ignore = (cfg.flags.NoImportLib ~= nil)\n_p(2,'<IgnoreImportLibrary>%s</IgnoreImportLibrary>', tostring(ignore))\nend\nif cfg.platform == \"Durango\" then\n_p(2, '<ReferencePath>$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)</ReferencePath>')\n_p(2, '<LibraryPath>$(Console_SdkLibPath)</LibraryPath>')\n_p(2, '<LibraryWPath>$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)</LibraryWPath>')\n_p(2, '<IncludePath>$(Console_SdkIncludeRoot)</IncludePath>'"
+ ")\n_p(2, '<ExecutablePath>$(Console_SdkRoot)bin;$(VCInstallDir)bin\\\\x86_amd64;$(VCInstallDir)bin;$(WindowsSDK_ExecutablePath_x86);$(VSInstallDir)Common7\\\\Tools\\\\bin;$(VSInstallDir)Common7\\\\tools;$(VSInstallDir)Common7\\\\ide;$(ProgramFiles)\\\\HTML Help Workshop;$(MSBuildToolsPath32);$(FxCopDir);$(PATH);</ExecutablePath>')\nif cfg.imagepath then\n_p(2, '<LayoutDir>%s</LayoutDir>', cfg.imagepath)\nelse\n_p(2, '<LayoutDir>%s</LayoutDir>', prj.name)\nend\nif cfg.pullmappingfile ~= nil then\n_p(2,'<PullMappingFile>%s</PullMappingFile>', premake.esc(cfg.pullmappingfile))\nend\n_p(2, '<LayoutExtensionFilter>*.pdb;*.ilk;*.exp;*.lib;*.winmd;*.appxrecipe;*.pri;*.idb</LayoutExtensionFilter>')\n_p(2, '<IsolateConfigurationsOnDeploy>true</IsolateConfigurationsOnDeploy>')\nend\nif cfg.kind ~= \"StaticLib\" then\n_p(2,'<LinkIncremental>%s</LinkIncremental>', tostring(premake.config.isincrementallink(cfg)))\nend\nif cfg.applicationdatadir ~= nil then\n_p(2,'<ApplicationDataDir>%s</ApplicationDataDir>', premake.esc(cf"
+ "g.applicationdatadir))\nend\nif cfg.flags.NoManifest then\n_p(2,'<GenerateManifest>false</GenerateManifest>')\nend\n_p(1,'</PropertyGroup>')\nend\nend\nlocal function runtime(cfg)\nlocal runtime\nlocal flags = cfg.flags\nif premake.config.isdebugbuild(cfg) then\nruntime = iif(flags.StaticRuntime and not flags.Managed, \"MultiThreadedDebug\", \"MultiThreadedDebugDLL\")\nelse\nruntime = iif(flags.StaticRuntime and not flags.Managed, \"MultiThreaded\", \"MultiThreadedDLL\")\nend\nreturn runtime\nend\nlocal function precompiled_header(cfg)\n if not cfg.flags.NoPCH and cfg.pchheader then\n_p(3,'<PrecompiledHeader>Use</PrecompiledHeader>')\n_p(3,'<PrecompiledHeaderFile>%s</PrecompiledHeaderFile>', cfg.pchheader)\nelse\n_p(3,'<PrecompiledHeader></PrecompiledHeader>')\nend\nend\nlocal function preprocessor(indent,cfg,escape)\nif #cfg.defines > 0 then\nlocal defines = table.concat(cfg.defines, \";\")\nif escape then\ndefines = defines:gsub('\"', '\\\\\"')\nend\nlocal isPreprocessorDefinitionPresent = string.find(d"
+ "efines, \"%%%(PreprocessorDefinitions%)\")\nif isPreprocessorDefinitionPresent then\n_p(indent,'<PreprocessorDefinitions>%s</PreprocessorDefinitions>'\n,premake.esc(defines))\nelse\n_p(indent,'<PreprocessorDefinitions>%s;%%(PreprocessorDefinitions)</PreprocessorDefinitions>'\n,premake.esc(defines))\nend\nelse\n_p(indent,'<PreprocessorDefinitions></PreprocessorDefinitions>')\nend\nend\nlocal function include_dirs(indent,cfg)\nlocal includedirs = table.join(cfg.userincludedirs, cfg.includedirs, cfg.systemincludedirs)\nif #includedirs> 0 then\n_p(indent,'<AdditionalIncludeDirectories>%s;%%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>'\n,premake.esc(path.translate(table.concat(includedirs, \";\"), '\\\\')))\nend\nend\nlocal function using_dirs(indent,cfg)\nif #cfg.usingdirs > 0 then\n_p(indent,'<AdditionalUsingDirectories>%s;%%(AdditionalUsingDirectories)</AdditionalUsingDirectories>'\n,premake.esc(path.translate(table.concat(cfg.usingdirs, \";\"), '\\\\')))\nend\nend\nlocal function resource_compi"
+ "le(cfg)\n_p(2,'<ResourceCompile>')\npreprocessor(3,cfg,true)\ninclude_dirs(3,cfg)\n_p(2,'</ResourceCompile>')\nend\nlocal function cppstandard_vs2017_or_2019(cfg)\nif cfg.flags.CppLatest then\n_p(3, '<LanguageStandard>stdcpplatest</LanguageStandard>')\n_p(3, '<EnableModules>true</EnableModules>')\nelseif cfg.flags.Cpp17 then\n_p(3, '<LanguageStandard>stdcpp17</LanguageStandard>')\nelseif cfg.flags.Cpp14 then\n_p(3, '<LanguageStandard>stdcpp14</LanguageStandard>')\nend\nend\nlocal function exceptions(cfg)\nif cfg.platform == \"Orbis\" then\nif cfg.flags.NoExceptions then\n_p(3, '<CppExceptions>false</CppExceptions>')\nend\nelseif cfg.platform == \"TegraAndroid\" then\nif cfg.flags.NoExceptions then\n_p(3, '<GccExceptionHandling>false</GccExceptionHandling>')\nend\nelse\nif cfg.flags.NoExceptions then\n_p(3, '<ExceptionHandling>false</ExceptionHandling>')\nelseif cfg.flags.SEH then\n_p(3, '<ExceptionHandling>Async</ExceptionHandling>')\nend\nend\nend\nlocal function rtti(cfg)\nif cfg.flags.NoRTTI and not cfg.fla"
+ "gs.Managed then\n_p(3,'<RuntimeTypeInfo>false</RuntimeTypeInfo>')\nend\nend\nlocal function calling_convention(cfg)\nif cfg.flags.FastCall then\n_p(3,'<CallingConvention>FastCall</CallingConvention>')\nelseif cfg.flags.StdCall then\n_p(3,'<CallingConvention>StdCall</CallingConvention>')\nend\nend\nlocal function wchar_t_builtin(cfg)\nif cfg.flags.NativeWChar then\n_p(3,'<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>')\nelseif cfg.flags.NoNativeWChar then\n_p(3,'<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>')\nend\nend\nlocal function sse(cfg)\nif cfg.flags.EnableSSE then\n_p(3, '<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>')\nelseif cfg.flags.EnableSSE2 then\n_p(3, '<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>')\nelseif cfg.flags.EnableAVX then\n_p(3, '<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>')\nelseif cfg.flags.EnableAVX2 then\n_p(3, '<EnableEnhancedInstruct"
+ "ionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>')\nend\nend\nlocal function floating_point(cfg)\nif cfg.platform == \"Orbis\" then\nif cfg.flags.FloatFast then\n_p(3,'<FastMath>true</FastMath>')\nend\nelseif cfg.platform == \"TegraAndroid\" then\nelse\nif cfg.flags.FloatFast then\n_p(3,'<FloatingPointModel>Fast</FloatingPointModel>')\nelseif cfg.flags.FloatStrict and not cfg.flags.Managed then\n_p(3,'<FloatingPointModel>Strict</FloatingPointModel>')\nend\nend\nend\nlocal function debug_info(cfg)\nlocal debug_info = ''\nif cfg.flags.Symbols then\nif cfg.flags.C7DebugInfo then\ndebug_info = \"OldStyle\"\nelseif (action.vstudio.supports64bitEditContinue == false and cfg.platform == \"x64\")\nor not premake.config.iseditandcontinue(cfg)\nthen\ndebug_info = \"ProgramDatabase\"\nelse\ndebug_info = \"EditAndContinue\"\nend\nend\n_p(3,'<DebugInformationFormat>%s</DebugInformationFormat>',debug_info)\nend\nlocal function minimal_build(cfg)\nif premake.config.isdebugbuild(cfg) and cfg.flags.EnableMinimal"
+ "Rebuild then\n_p(3,'<MinimalRebuild>true</MinimalRebuild>')\nelse\n_p(3,'<MinimalRebuild>false</MinimalRebuild>')\nend\nend\nlocal function compile_language(cfg)\nif cfg.options.ForceCPP then\n_p(3,'<CompileAs>CompileAsCpp</CompileAs>')\nelse\nif cfg.language == \"C\" then\n_p(3,'<CompileAs>CompileAsC</CompileAs>')\nend\nend\nend\nlocal function forcedinclude_files(indent,cfg)\nif #cfg.forcedincludes > 0 then\n_p(indent,'<ForcedIncludeFiles>%s</ForcedIncludeFiles>'\n,premake.esc(path.translate(table.concat(cfg.forcedincludes, \";\"), '\\\\')))\nend\nend\nlocal function vs10_clcompile(cfg)\n_p(2,'<ClCompile>')\nlocal unsignedChar = \"/J \"\nlocal buildoptions = cfg.buildoptions\nif cfg.platform == \"Orbis\" then\nunsignedChar = \"-funsigned-char \";\n_p(3,'<GenerateDebugInformation>%s</GenerateDebugInformation>', tostring(cfg.flags.Symbols ~= nil))\nend\nif cfg.language == \"C\" and not cfg.options.ForceCPP then\nbuildoptions = table.join(buildoptions, cfg.buildoptions_c)\nelse\nbuildoptions = table.join(buildo"
+ "ptions, cfg.buildoptions_cpp)\nend\n_p(3,'<AdditionalOptions>%s %s%%(AdditionalOptions)</AdditionalOptions>'\n, table.concat(premake.esc(buildoptions), \" \")\n, iif(cfg.flags.UnsignedChar and cfg.platform ~= \"TegraAndroid\", unsignedChar, \" \")\n)\nif cfg.platform == \"TegraAndroid\" then\n_p(3,'<SignedChar>%s</SignedChar>', tostring(cfg.flags.UnsignedChar == nil))\n_p(3,'<GenerateDebugInformation>%s</GenerateDebugInformation>', tostring(cfg.flags.Symbols ~= nil))\nif cfg.androidcppstandard then\n_p(3,'<CppLanguageStandard>%s</CppLanguageStandard>', cfg.androidcppstandard)\nend\nend\nif cfg.platform == \"Orbis\" then\nlocal opt = optimisation(cfg)\nif opt == \"Disabled\" then\n_p(3,'<OptimizationLevel>Level0</OptimizationLevel>')\nelseif opt == \"MinSpace\" then\n_p(3,'<OptimizationLevel>Levelz</OptimizationLevel>') -- Oz is more aggressive than Os\nelseif opt == \"MaxSpeed\" then\n_p(3,'<OptimizationLevel>Level3</OptimizationLevel>')\nelse\n_p(3,'<OptimizationLevel>Level2</OptimizationLevel>')\nend\nelseif"
+ " cfg.platform == \"TegraAndroid\" then\nlocal opt = optimisation(cfg)\nif opt == \"Disabled\" then\n_p(3,'<OptimizationLevel>O0</OptimizationLevel>')\nelseif opt == \"MinSpace\" then\n_p(3,'<OptimizationLevel>Os</OptimizationLevel>')\nelseif opt == \"MaxSpeed\" then\n_p(3,'<OptimizationLevel>O3</OptimizationLevel>')\nelse\n_p(3,'<OptimizationLevel>O2</OptimizationLevel>')\nend\nelse\n_p(3,'<Optimization>%s</Optimization>', optimisation(cfg))\nend\ninclude_dirs(3, cfg)\nusing_dirs(3, cfg)\npreprocessor(3, cfg)\nminimal_build(cfg)\nif premake.config.isoptimizedbuild(cfg.flags) then\nif cfg.flags.NoOptimizeLink and cfg.flags.NoEditAndContinue then\n_p(3, '<StringPooling>false</StringPooling>')\n_p(3, '<FunctionLevelLinking>false</FunctionLevelLinking>')\nelse\n_p(3, '<StringPooling>true</StringPooling>')\n_p(3, '<FunctionLevelLinking>true</FunctionLevelLinking>')\nend\nelse\n_p(3, '<FunctionLevelLinking>true</FunctionLevelLinking>')\nif cfg.flags.NoRuntimeChecks then\n_p(3, '<BasicRuntimeChecks>Default</BasicRunt"
+ "imeChecks>')\nelseif not cfg.flags.Managed then\n_p(3, '<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>')\nend\nif cfg.flags.ExtraWarnings then\nend\nend\nif cfg.platform == \"Durango\" or cfg.flags.NoWinRT then\n_p(3, '<CompileAsWinRT>false</CompileAsWinRT>')\nend\n_p(3, '<RuntimeLibrary>%s</RuntimeLibrary>', runtime(cfg))\nif cfg.flags.NoBufferSecurityCheck then\n_p(3, '<BufferSecurityCheck>false</BufferSecurityCheck>')\nend\nif not cfg.flags.NoMultiProcessorCompilation and not cfg.flags.EnableMinimalRebuild then\n_p(3, '<MultiProcessorCompilation>true</MultiProcessorCompilation>')\nelse\n_p(3, '<MultiProcessorCompilation>false</MultiProcessorCompilation>')\nend\nprecompiled_header(cfg)\nif cfg.platform == \"Orbis\" then\nif cfg.flags.PedanticWarnings then\n_p(3, '<Warnings>MoreWarnings</Warnings>')\n_p(3, '<ExtraWarnings>true</ExtraWarnings>')\nelseif cfg.flags.ExtraWarnings then\n_p(3, '<Warnings>NormalWarnings</Warnings>')\n_p(3, '<ExtraWarnings>true</ExtraWarnings>')\nelseif cfg.flags.MinimumWa"
+ "rnings then\n_p(3, '<Warnings>WarningsOff</Warnings>')\n_p(3, '<ExtraWarnings>false</ExtraWarnings>')\nelse\n_p(3, '<Warnings>NormalWarnings</Warnings>')\n_p(3, '<ExtraWarnings>false</ExtraWarnings>')\nend\nif cfg.flags.FatalWarnings then\n_p(3, '<WarningsAsErrors>true</WarningsAsErrors>')\nend\nelseif cfg.platform == \"TegraAndroid\" then\nif cfg.flags.PedanticWarnings or cfg.flags.ExtraWarnings then\n_p(3, '<Warnings>AllWarnings</Warnings>')\nelseif cfg.flags.MinimumWarnings then\n_p(3, '<Warnings>DisableAllWarnings</Warnings>')\nelse\n_p(3, '<Warnings>NormalWarnings</Warnings>')\nend\nif cfg.flags.FatalWarnings then\n_p(3, '<WarningsAsErrors>true</WarningsAsErrors>')\nend\nelse\nif cfg.flags.PedanticWarnings then\n_p(3, '<WarningLevel>EnableAllWarnings</WarningLevel>')\nelseif cfg.flags.ExtraWarnings then\n_p(3, '<WarningLevel>Level4</WarningLevel>')\nelseif cfg.flags.MinimumWarnings then\n_p(3, '<WarningLevel>Level1</WarningLevel>')\nelse\n_p(3 ,'<WarningLevel>Level3</WarningLevel>')\nend\nend\nif cfg.flag"
+ "s.FatalWarnings then\n_p(3, '<TreatWarningAsError>true</TreatWarningAsError>')\nend\nif premake.action.current() == premake.action.get(\"vs2017\") or\n premake.action.current() == premake.action.get(\"vs2019\") then\ncppstandard_vs2017_or_2019(cfg)\nend\nexceptions(cfg)\nrtti(cfg)\ncalling_convention(cfg)\nwchar_t_builtin(cfg)\nsse(cfg)\nfloating_point(cfg)\ndebug_info(cfg)\nif _ACTION:sub(3) == \"llvm\" then\n_p(3,'<SupportJustMyCode>false</SupportJustMyCode>')\nend\nif cfg.flags.Symbols then\nif cfg.kind == \"StaticLib\" then\n_p(3, '<ProgramDataBaseFileName>$(OutDir)%s.pdb</ProgramDataBaseFileName>'\n, path.getbasename(cfg.buildtarget.name)\n)\nelse\n_p(3, '<ProgramDataBaseFileName>$(IntDir)%s.compile.pdb</ProgramDataBaseFileName>'\n, path.getbasename(cfg.buildtarget.name)\n)\nend\nend\nif cfg.flags.Hotpatchable then\n_p(3, '<CreateHotpatchableImage>true</CreateHotpatchableImage>')\nend\nif cfg.flags.NoFramePointer then\n_p(3, '<OmitFramePointers>true</OmitFramePointers>')\nend\nif cfg.flags.UseFullPaths "
+ "then\n_p(3, '<UseFullPaths>true</UseFullPaths>')\nend\nif cfg.flags.NoJMC then\n_p(3,'<SupportJustMyCode>false</SupportJustMyCode>' )\nend\ncompile_language(cfg)\nforcedinclude_files(3,cfg);\nif vstudio.diagformat then\n_p(3, '<DiagnosticsFormat>%s</DiagnosticsFormat>', vstudio.diagformat)\nelse\n_p(3, '<DiagnosticsFormat>Caret</DiagnosticsFormat>')\nend\n_p(2,'</ClCompile>')\nend\nlocal function event_hooks(cfg)\nif #cfg.postbuildcommands> 0 then\n _p(2,'<PostBuildEvent>')\n_p(3,'<Command>%s</Command>',premake.esc(table.implode(cfg.postbuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'</PostBuildEvent>')\nend\nif #cfg.prebuildcommands> 0 then\n _p(2,'<PreBuildEvent>')\n_p(3,'<Command>%s</Command>',premake.esc(table.implode(cfg.prebuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'</PreBuildEvent>')\nend\nif #cfg.prelinkcommands> 0 then\n _p(2,'<PreLinkEvent>')\n_p(3,'<Command>%s</Command>',premake.esc(table.implode(cfg.prelinkcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'</PreLinkEvent>')\nend\nend\nlocal fu"
+ "nction additional_options(indent,cfg)\nif #cfg.linkoptions > 0 then\n_p(indent,'<AdditionalOptions>%s %%(AdditionalOptions)</AdditionalOptions>',\ntable.concat(premake.esc(cfg.linkoptions), \" \"))\nend\nend\nlocal function link_target_machine(index,cfg)\nlocal platforms = {x32 = 'MachineX86', x64 = 'MachineX64'}\nif platforms[cfg.platform] then\n_p(index,'<TargetMachine>%s</TargetMachine>', platforms[cfg.platform])\nend\nend\nlocal function item_def_lib(prj, cfg)\nif cfg.kind == 'StaticLib' and cfg.platform ~= \"Xbox360\" then\n_p(1,'<Lib>')\n_p(2,'<OutputFile>$(OutDir)%s</OutputFile>',cfg.buildtarget.name)\nadditional_options(2,cfg)\nlink_target_machine(2,cfg)\nif _ACTION:sub(3) == \"llvm\" and prj.name == \"portaudio\" then -- MSVC-LLVM needs special help\n_p(2,'<AdditionalDependencies>ksuser.lib;%%(AdditionalDependencies)</AdditionalDependencies>')\nend\n_p(1,'</Lib>')\nend\nend\nlocal function import_lib(cfg)\nif cfg.kind == \"SharedLib\" then\nlocal implibname = cfg.linktarget.fullpath\n_p(3,'<ImportLibr"
+ "ary>%s</ImportLibrary>',iif(cfg.flags.NoImportLib, cfg.objectsdir .. \"\\\\\" .. path.getname(implibname), implibname))\nend\nend\nlocal function hasmasmfiles(prj)\nlocal files = vc2010.getfilegroup(prj, \"MASM\")\nreturn #files > 0\nend\nlocal function ismanagedprj(prj, cfgname, pltname)\nlocal cfg = premake.getconfig(prj, cfgname, pltname)\nreturn cfg.flags.Managed == true\nend\nlocal function getcfglinks(cfg)\nlocal haswholearchive = #cfg.wholearchive > 0\nlocal msvcnaming = premake.getnamestyle(cfg) == \"windows\"\nlocal iscppprj = premake.iscppproject(cfg)\nlocal isnetprj = premake.isdotnetproject(cfg)\nlocal linkobjs = {}\nlocal links = iif(haswholearchive\n, premake.getlinks(cfg, \"all\", \"object\")\n, premake.getlinks(cfg, \"system\", \"fullpath\")\n)\nfor _, link in ipairs(links) do\nlocal name = nil\nlocal directory = nil\nlocal whole = nil\nif type(link) == \"table\" then\nif not ismanagedprj(link.project, cfg.name, cfg.platform) then\nname = link.linktarget.basen"
+ "ame\ndirectory = path.rebase(link.linktarget.directory, link.location, cfg.location)\nwhole = table.icontains(cfg.wholearchive, link.project.name)\nend\nelse\nname = link\nwhole = table.icontains(cfg.wholearchive, link)\nend\nif name then\nif haswholearchive and msvcnaming then\nif iscppprj then\nname = name .. \".lib\"\nelseif isnetprj then\nname = name .. \".dll\"\nend\nend\ntable.insert(linkobjs, {name=name, directory=directory, wholearchive=whole})\nend\nend\nreturn linkobjs\nend\nlocal function vs10_masm(prj, cfg)\nif hasmasmfiles(prj) then\n_p(2, '<MASM>')\n_p(3,'<AdditionalOptions>%s %%(AdditionalOptions)</AdditionalOptions>'\n, table.concat(premake.esc(table.join(cfg.buildoptions, cfg.buildoptions_asm)), \" \")\n)\nlocal includedirs = table.join(cfg.userincludedirs, cfg.includedirs, cfg.systemincludedirs)\nif #includedirs > 0 then\n_p(3, '<IncludePaths>%s;%%(IncludePaths)</IncludePaths>'\n, premake.esc(path.translate(table.concat(includedirs, \";\"), '\\\\'))\n)\nend\nlocal defines = table"
+ ".join(cfg.defines)\ntable.insertflat(defines, iif(premake.config.isdebugbuild(cfg), \"_DEBUG\", {}))\ntable.insert(defines, iif(cfg.platform == \"x64\", \"_WIN64\", \"_WIN32\"))\ntable.insert(defines, iif(prj.kind == \"SharedLib\", \"_EXPORT=EXPORT\", \"_EXPORT=\"))\n_p(3, '<PreprocessorDefinitions>%s;%%(PreprocessorDefinitions)</PreprocessorDefinitions>'\n, premake.esc(table.concat(defines, \";\"))\n)\nif cfg.flags.FatalWarnings then\n_p(3,'<TreatWarningsAsErrors>true</TreatWarningsAsErrors>')\nend\nif cfg.flags.MinimumWarnings then\n_p(3,'<WarningLevel>0</WarningLevel>')\nelse\n_p(3,'<WarningLevel>3</WarningLevel>')\nend\n_p(2, '</MASM>')\nend\nend\nlocal function additional_manifest(cfg)\nif(cfg.dpiawareness ~= nil) then\n_p(2,'<Manifest>')\nif(cfg.dpiawareness == \"None\") then\n_p(3, '<EnableDpiAwareness>false</EnableDpiAwareness>')\nend\nif(cfg.dpiawareness == \"High\") then\n_p(3, '<EnableDpiAwareness>true</EnableDpiAwareness>')\nend\nif(cfg.dpiawareness == \"HighPerMonitor\") then\n_p(3, '<EnableDpiAwa"
+ "reness>PerMonitorHighDPIAware</EnableDpiAwareness>')\nend\n_p(2,'</Manifest>')\nend\nend\nfunction vc2010.link(cfg)\nlocal vs2017OrLater = premake.action.current() == premake.action.get(\"vs2017\") or\n premake.action.current() == premake.action.get(\"vs2019\")\nlocal vsllvm = premake.action.current() == premake.action.get(\"vsllvm\")\nlocal links = getcfglinks(cfg)\n_p(2,'<Link>')\n_p(3,'<SubSystem>%s</SubSystem>', iif(cfg.kind == \"ConsoleApp\", \"Console\", \"Windows\"))\nif (vs2017OrLater or vsllvm) and cfg.flags.FullSymbols then\n_p(3,'<GenerateDebugInformation>DebugFull</GenerateDebugInformation>')\nelse\n_p(3,'<GenerateDebugInformation>%s</GenerateDebugInformation>', tostring(cfg.flags.Symbols ~= nil))\nend\nif cfg.flags.Symbols then\n_p(3, '<ProgramDatabaseFile>$(OutDir)%s.pdb</ProgramDatabaseFile>'\n, path.getbasename(cfg.buildtarget.name)\n)\nend\nif premake.config.islinkeroptimizedbuild(cfg.flags) then\nif cfg.platform == \"Orbis\" then\n_p(3,'<DataStripping>StripFuncsAndData</DataStripping>')\n"
+ "_p(3,'<DuplicateStripping>true</DuplicateStripping>')\nelse\n_p(3,'<EnableCOMDATFolding>true</EnableCOMDATFolding>')\n_p(3,'<OptimizeReferences>true</OptimizeReferences>')\nend\nelseif cfg.platform == \"Orbis\" and premake.config.iseditandcontinue(cfg) then\n_p(3,'<EditAndContinue>true</EditAndContinue>')\nend\nif cfg.finalizemetasource ~= nil then\n_p(3,'<FinalizeMetaSource>%s</FinalizeMetaSource>', premake.esc(cfg.finalizemetasource))\nend\nif cfg.kind ~= 'StaticLib' then\nvc2010.additionalDependencies(3, cfg, links)\nvc2010.additionalLibraryDirectories(3, cfg, links)\n_p(3,'<OutputFile>$(OutDir)%s</OutputFile>', cfg.buildtarget.name)\nif vc2010.config_type(cfg) == 'Application' and not cfg.flags.WinMain and not cfg.flags.Managed then\nif cfg.flags.Unicode then\n_p(3,'<EntryPointSymbol>wmainCRTStartup</EntryPointSymbol>')\nelse\n_p(3,'<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>')\nend\nend\nimport_lib(cfg)\nlocal deffile = premake.findfile(cfg, \".def\")\nif deffile then\n_p(3,'<ModuleDefinitionFile>"
+ "%s</ModuleDefinitionFile>', deffile)\nend\nlink_target_machine(3,cfg)\nadditional_options(3,cfg)\nif cfg.flags.NoWinMD and vstudio.iswinrt() and prj.kind == \"WindowedApp\" then\n_p(3,'<GenerateWindowsMetadata>false</GenerateWindowsMetadata>' )\nend\nend\nif cfg.platform == \"TegraAndroid\" then\nif cfg.androidlinker then\n_p(3,'<UseLinker>%s</UseLinker>',cfg.androidlinker)\nend\nend\nif cfg.flags.Hotpatchable then\n_p(3, '<CreateHotPatchableImage>Enabled</CreateHotPatchableImage>')\nend\n_p(2,'</Link>')\nif #cfg.wholearchive > 0 then\n_p(2, '<ProjectReference>')\n_p(3, '<LinkLibraryDependencies>false</LinkLibraryDependencies>')\n_p(2, '</ProjectReference>')\nend\nend\nfunction vc2010.additionalLibraryDirectories(tab, cfg, links)\nlocal dirs = cfg.libdirs\nfor _, link in ipairs(links) do\nif link.directory and not table.icontains(dirs, link.directory) then\ntable.insert(dirs, link.directory)\nend\nend\n_p(tab, '<AdditionalLibraryDirectories>%s;%%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>'\n,"
+ " premake.esc(path.translate(table.concat(dirs, ';'), '\\\\'))\n)\nend\nfunction vc2010.additionalDependencies(tab, cfg, links)\nif #links > 0 then\nlocal deps = \"\"\nif cfg.platform == \"Orbis\" then\nlocal iswhole = false\nfor _, link in ipairs(links) do\nif link.wholearchive and not iswhole then\ndeps = deps .. \"--whole-archive;\"\niswhole = true\nelseif not link.wholearchive and iswhole then\ndeps = deps .. \"--no-whole-archive;\"\niswhole = false\nend\ndeps = deps .. \"-l\" .. link.name .. \";\"\nend\nelse\nfor _, link in ipairs(links) do\nif link.wholearchive then\ndeps = deps .. \"/WHOLEARCHIVE:\" .. link.name .. \";\"\nelse\ndeps = deps .. link.name .. \";\"\nend\nend\nend\nif cfg.platform == \"TegraAndroid\" then\ndeps = \"-Wl,--start-group;\" .. deps .. \";-Wl,--end-group\"\nend\n_p(tab, '<AdditionalDependencies>%s;%s</AdditionalDependencies>'\n, deps\n, iif(cfg.platform == \"Durango\"\n, '%(XboxExtensionsDependencies)'\n, '%(AdditionalDependencies)'\n)\n)\nelseif cfg.platform == \"Durango\" then\n_"
+ "p(tab, '<AdditionalDependencies>%%(XboxExtensionsDependencies)</AdditionalDependencies>')\nend\nend\nfunction ant_build(prj, cfg)\nif cfg.platform == \"TegraAndroid\" then\nlocal files = vc2010.getfilegroup(prj, \"AndroidBuild\")\n_p(2,'<AntBuild>')\nif #files > 0 then\n_p(3,'<AndroidManifestLocation>%s</AndroidManifestLocation>',path.translate(files[1].name))\nend\nlocal isdebugbuild = premake.config.isdebugbuild(cfg)\n_p(3,'<AntBuildType>%s</AntBuildType>',iif(isdebugbuild, 'Debug','Release'))\n_p(3,'<Debuggable>%s</Debuggable>',tostring(cfg.flags.AntBuildDebuggable ~= nil))\nif #cfg.antbuildjavasourcedirs > 0 then\nlocal dirs = table.concat(cfg.antbuildjavasourcedirs,\";\")\n_p(3,'<JavaSourceDir>%s</JavaSourceDir>',dirs)\nend\nif #cfg.antbuildjardirs > 0 then\nlocal dirs = table.concat(cfg.antbuildjardirs,\";\")\n_p(3,'<JarDirectories>%s</JarDirectories>',dirs)\nend\nif #cfg.antbuildjardependencies > 0 then\nlocal dirs = table.concat(cfg.antbuildjardependencies,\";\")\n_p(3,'<JarDependencies>%s</JarDependen"
+ "cies>',dirs)\nend\nif #cfg.antbuildnativelibdirs > 0 then\nlocal dirs = table.concat(cfg.antbuildnativelibdirs,\";\")\n_p(3,'<NativeLibDirectories>%s</NativeLibDirectories>',dirs)\nend\nif #cfg.antbuildnativelibdependencies > 0 then\nlocal dirs = table.concat(cfg.antbuildnativelibdependencies,\";\")\n_p(3,'<NativeLibDependencies>%s</NativeLibDependencies>',dirs)\nend\nif #cfg.antbuildassetsdirs > 0 then\nlocal dirs = table.concat(cfg.antbuildassetsdirs,\";\")\n_p(3,'<AssetsDirectories>%s</AssetsDirectories>',dirs)\nend\n_p(2,'</AntBuild>')\nend\nend\nlocal function item_definitions(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,'<ItemDefinitionGroup ' ..if_config_and_platform() ..'>'\n,premake.esc(cfginfo.name))\nvs10_clcompile(cfg)\nresource_compile(cfg)\nitem_def_lib(prj, cfg)\nvc2010.link(cfg)\nant_build(prj, cfg)\nevent_hooks(cfg)\nvs10_masm(prj, cfg)\nadditional_manifest(cfg)\n_p(1,'</ItemDefinitionGroup"
+ ">')\nend\nend\nfunction vc2010.getfilegroup(prj, group)\nlocal sortedfiles = prj.vc2010sortedfiles\nif not sortedfiles then\nsortedfiles = {\nClCompile = {},\nClInclude = {},\nMASM = {},\nObject = {},\nNone = {},\nResourceCompile = {},\nAppxManifest = {},\nAndroidBuild = {},\nNatvis = {},\nImage = {},\nDeploymentContent = {}\n}\nlocal foundAppxManifest = false\nfor file in premake.project.eachfile(prj, true) do\nif path.issourcefilevs(file.name) then\ntable.insert(sortedfiles.ClCompile, file)\nelseif path.iscppheader(file.name) then\nif not table.icontains(prj.removefiles, file) then\ntable.insert(sortedfiles.ClInclude, file)\nend\nelseif path.isobjectfile(file.name) then\ntable.insert(sortedfiles.Object, file)\nelseif path.isresourcefile(file.name) then\ntable.insert(sortedfiles.ResourceCompile, file)\nelseif path.isimagefile(file.name) then\ntable.insert(sortedfiles.Image, file)\nelseif path.isappxmanifest(file.name) then\nfoundAppxManifest = true\ntable.insert(sortedfiles.AppxManifest, file)\nelseif path.is"
+ "androidbuildfile(file.name) then\ntable.insert(sortedfiles.AndroidBuild, file)\nelseif path.isnatvis(file.name) then\ntable.insert(sortedfiles.Natvis, file)\nelseif path.isasmfile(file.name) then\ntable.insert(sortedfiles.MASM, file)\nelseif file.flags and table.icontains(file.flags, \"DeploymentContent\") then\ntable.insert(sortedfiles.DeploymentContent, file)\nelse\ntable.insert(sortedfiles.None, file)\nend\nend\nif vstudio.iswinrt() and prj.kind == \"WindowedApp\" and not foundAppxManifest then\nvstudio.needAppxManifest = true\nlocal fcfg = {}\nfcfg.name = prj.name .. \"/Package.appxmanifest\"\nfcfg.vpath = premake.project.getvpath(prj, fcfg.name)\ntable.insert(sortedfiles.AppxManifest, fcfg)\nlocal logo = {}\nlogo.name = prj.name .. \"/Logo.png\"\nlogo.vpath = logo.name\ntable.insert(sortedfiles.Image, logo)\nlocal smallLogo = {}\nsmallLogo.name = prj.name .. \"/SmallLogo.png\"\nsmallLogo.vpath = smallLogo.name\ntable.insert(sortedfiles.Image, smallLogo)\nlocal storeLogo = {}\nstoreLogo.name = prj.name "
+ ".. \"/StoreLogo.png\"\nstoreLogo.vpath = storeLogo.name\ntable.insert(sortedfiles.Image, storeLogo)\nlocal splashScreen = {}\nsplashScreen.name = prj.name .. \"/SplashScreen.png\"\nsplashScreen.vpath = splashScreen.name\ntable.insert(sortedfiles.Image, splashScreen)\nend\nprj.vc2010sortedfiles = sortedfiles\nend\nreturn sortedfiles[group]\nend\nfunction vc2010.files(prj)\nvc2010.simplefilesgroup(prj, \"ClInclude\")\nvc2010.compilerfilesgroup(prj)\nvc2010.simplefilesgroup(prj, \"Object\")\nvc2010.simplefilesgroup(prj, \"None\")\nvc2010.customtaskgroup(prj)\nvc2010.simplefilesgroup(prj, \"ResourceCompile\")\nvc2010.simplefilesgroup(prj, \"AppxManifest\")\nvc2010.simplefilesgroup(prj, \"AndroidBuild\")\nvc2010.simplefilesgroup(prj, \"Natvis\")\nvc2010.deploymentcontentgroup(prj, \"Image\")\nvc2010.deploymentcontentgroup(prj, \"DeploymentContent\", \"None\")\nend\nfunction vc2010.customtaskgroup(prj)\nlocal files = { }\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(cus"
+ "tombuildtask or {}) do\nlocal fcfg = { }\nfcfg.name = path.getrelative(prj.location,buildtask[1])\nfcfg.vpath = path.trimdots(fcfg.name)\ntable.insert(files, fcfg)\nend\nend\nif #files > 0 then\n_p(1,'<ItemGroup>')\nlocal groupedBuildTasks = {}\nlocal buildTaskNames = {}\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nif (groupedBuildTasks[buildtask[1]] == nil) then\ngroupedBuildTasks[buildtask[1]] = {}\ntable.insert(buildTaskNames, buildtask[1])\nend\ntable.insert(groupedBuildTasks[buildtask[1]], buildtask)\nend\nend\nfor _, name in ipairs(buildTaskNames) do\ncustombuildtask = groupedBuildTasks[name]\n_p(2,'<CustomBuild Include=\\\"%s\\\">', path.translate(path.getrelative(prj.location,name), \"\\\\\"))\n_p(3,'<FileType>Text</FileType>')\nlocal cmd = \"\"\nlocal outputs = \"\"\nfor _, buildtask in ipairs(custombuildtask or {}) do\nfor _, cmdline in ipairs(buildtask[4] or {}) do\ncmd = cmd .. cmdline\nlocal num = 1\nfor _, depdata in ipair"
+ "s(buildtask[3] or {}) do\ncmd = string.gsub(cmd,\"%$%(\" .. num ..\"%)\", string.format(\"%s \",path.getrelative(prj.location,depdata)))\nnum = num + 1\nend\ncmd = string.gsub(cmd, \"%$%(<%)\", string.format(\"%s \",path.getrelative(prj.location,buildtask[1])))\ncmd = string.gsub(cmd, \"%$%(@%)\", string.format(\"%s \",path.getrelative(prj.location,buildtask[2])))\ncmd = cmd .. \"\\r\\n\"\nend\noutputs = outputs .. path.getrelative(prj.location,buildtask[2]) .. \";\"\nend\n_p(3,'<Command>%s</Command>',cmd)\n_p(3,'<Outputs>%s%%(Outputs)</Outputs>',outputs)\n_p(3,'<SubType>Designer</SubType>')\n_p(3,'<Message></Message>')\n_p(2,'</CustomBuild>')\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.simplefilesgroup(prj, section, subtype)\nlocal configs = prj.solution.vstudio_configs\nlocal files = vc2010.getfilegroup(prj, section)\nif #files > 0 then\nlocal config_mappings = {}\nfor _, cfginfo in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nif cfg.pchheader"
+ " and cfg.pchsource and not cfg.flags.NoPCH then\nconfig_mappings[cfginfo] = path.translate(cfg.pchsource, \"\\\\\")\nend\nend\n_p(1,'<ItemGroup>')\nfor _, file in ipairs(files) do\nlocal prjexcluded = table.icontains(prj.excludes, file.name)\nlocal excludedcfgs = {}\nif not prjexcluded then\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nlocal fileincfg = table.icontains(cfg.files, file.name)\nlocal cfgexcluded = table.icontains(cfg.excludes, file.name)\nif not fileincfg or cfgexcluded then\ntable.insert(excludedcfgs, vsconfig.name)\nend\nend\nend\nif subtype or prjexcluded or #excludedcfgs > 0 then\n_p(2, '<%s Include=\\\"%s\\\">', section, path.translate(file.name, \"\\\\\"))\nif prjexcluded then\n_p(3, '<ExcludedFromBuild>true</ExcludedFromBuild>')\nelse\nfor _, cfgname in ipairs(excludedcfgs) do\n_p(3, '<ExcludedFromBuild '\n.. if_config_and_platform()\n.. '>true</ExcludedFromBuild>'\n, premake.esc(cfgname)\n)\nend\nend\nif subtype t"
+ "hen\n_p(3, '<SubType>%s</SubType>', subtype)\nend\n_p(2,'</%s>', section)\nelse\n_p(2, '<%s Include=\\\"%s\\\" />', section, path.translate(file.name, \"\\\\\"))\nend\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.deploymentcontentgroup(prj, section, filetype)\nif filetype == nil then\nfiletype = section\nend\nlocal files = vc2010.getfilegroup(prj, section)\nif #files > 0 then\n_p(1,'<ItemGroup>')\nfor _, file in ipairs(files) do\n_p(2,'<%s Include=\\\"%s\\\">', filetype, path.translate(file.name, \"\\\\\"))\n_p(3,'<DeploymentContent>true</DeploymentContent>')\n_p(3,'<Link>%s</Link>', path.translate(file.vpath, \"\\\\\"))\n_p(2,'</%s>', filetype)\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.compilerfilesgroup(prj)\nlocal configs = prj.solution.vstudio_configs\nlocal files = vc2010.getfilegroup(prj, \"ClCompile\")\nif #files > 0 then\nlocal config_mappings = {}\nfor _, cfginfo in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nif cfg.pchheade"
+ "r and cfg.pchsource and not cfg.flags.NoPCH then\nconfig_mappings[cfginfo] = path.translate(cfg.pchsource, \"\\\\\")\nend\nend\n_p(1,'<ItemGroup>')\nlocal existingBasenames = {};\nfor _, file in ipairs(files) do\nlocal filename = string.lower(path.getbasename(file.name))\nlocal disambiguation = existingBasenames[filename] or 0;\nexistingBasenames[filename] = disambiguation + 1\nlocal translatedpath = path.translate(file.name, \"\\\\\")\n_p(2, '<ClCompile Include=\\\"%s\\\">', translatedpath)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nlocal namestyle = premake.getnamestyle(cfg)\nif namestyle == \"TegraAndroid\" or namestyle == \"NX\" then\n_p(3, '<ObjectFileName '.. if_config_and_platform() .. '>$(IntDir)%s.o</ObjectFileName>', premake.esc(vsconfig.name), premake.esc(path.translate(path.trimdots(path.removeext(file.name)))) )\nelse\nif disambiguation > 0 then\n_p(3, '<ObjectFileName '.. if_config_and_platform() .. '>$(IntDir)%s\\\\</"
+ "ObjectFileName>', premake.esc(vsconfig.name), tostring(disambiguation))\nend\nend\nend\nif path.iscxfile(file.name) then\n_p(3, '<CompileAsWinRT>true</CompileAsWinRT>')\n_p(3, '<RuntimeTypeInfo>true</RuntimeTypeInfo>')\n_p(3, '<PrecompiledHeader>NotUsing</PrecompiledHeader>')\nend\nif vstudio.iswinrt() and string.len(file.name) > 2 and string.sub(file.name, -2) == \".c\" then\n_p(3,'<CompileAsWinRT>FALSE</CompileAsWinRT>')\nend\nfor _, cfginfo in ipairs(configs) do\nif config_mappings[cfginfo] and translatedpath == config_mappings[cfginfo] then\n_p(3,'<PrecompiledHeader '.. if_config_and_platform() .. '>Create</PrecompiledHeader>', premake.esc(cfginfo.name))\nconfig_mappings[cfginfo] = nil --only one source file per pch\nend\nend\nlocal nopch = table.icontains(prj.nopch, file.name)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nif nopch or table.icontains(cfg.nopch, file.name) then\n_p(3,'<PrecompiledHeader '.. if_config_and_platform()"
+ " .. '>NotUsing</PrecompiledHeader>', premake.esc(vsconfig.name))\nend\nend\nlocal excluded = table.icontains(prj.excludes, file.name)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nlocal fileincfg = table.icontains(cfg.files, file.name)\nlocal cfgexcluded = table.icontains(cfg.excludes, file.name)\nif excluded or not fileincfg or cfgexcluded then\n_p(3, '<ExcludedFromBuild '\n.. if_config_and_platform()\n.. '>true</ExcludedFromBuild>'\n, premake.esc(vsconfig.name)\n)\nend\nend\nif prj.flags and prj.flags.Managed then\nlocal prjforcenative = table.icontains(prj.forcenative, file.name)\nfor _,vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nif prjforcenative or table.icontains(cfg.forcenative, file.name) then\n_p(3, '<CompileAsManaged ' .. if_config_and_platform() .. '>false</CompileAsManaged>', premake.esc(vsconfig.name))\nend\nend\nend\n_p(2,'</ClCompile>')\nend\n_p(1,'</I"
+ "temGroup>')\nend\nend\nfunction vc2010.masmfiles(prj)\nlocal configs = prj.solution.vstudio_configs\nlocal files = vc2010.getfilegroup(prj, \"MASM\")\nif #files > 0 then\n_p(1, '<ItemGroup>')\nfor _, file in ipairs(files) do\nlocal translatedpath = path.translate(file.name, \"\\\\\")\n_p(2, '<MASM Include=\"%s\">', translatedpath)\nlocal excluded = table.icontains(prj.excludes, file.name)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nlocal fileincfg = table.icontains(cfg.files, file.name)\nlocal cfgexcluded = table.icontains(cfg.excludes, file.name)\nif excluded or not fileincfg or cfgexcluded then\n_p(3, '<ExcludedFromBuild '\n.. if_config_and_platform()\n.. '>true</ExcludedFromBuild>'\n, premake.esc(vsconfig.name)\n)\nend\nend\n_p(2, '</MASM>')\nend\n_p(1, '</ItemGroup>')\nend\nend\nfunction vc2010.header(targets)\nio.eol = \"\\r\\n\"\n_p('<?xml version=\"1.0\" encoding=\"utf-8\"?>')\nlocal t = \"\"\nif targets then\nt = ' DefaultTar"
+ "gets=\"' .. targets .. '\"'\nend\n_p('<Project%s ToolsVersion=\"%s\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">', t, action.vstudio.toolsVersion)\nend\nfunction premake.vs2010_vcxproj(prj)\nlocal usemasm = hasmasmfiles(prj)\nio.indent = \" \"\nvc2010.header(\"Build\")\nvs2010_config(prj)\nvs2010_globals(prj)\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.Default.props\" />')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nvc2010.configurationPropertyGroup(cfg, cfginfo)\nend\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.props\" />')\n_p(1,'<ImportGroup Label=\"ExtensionSettings\">')\nif usemasm then\n_p(2, '<Import Project=\"$(VCTargetsPath)\\\\BuildCustomizations\\\\masm.props\" />')\nend\n_p(1,'</ImportGroup>')\nimport_props(prj)\n_p(1,'<PropertyGroup Label=\"UserMacros\" />')\nvc2010.outputProperties(prj)\nitem_definitions(prj)\nvc2010.files(prj)\nvc2010.clrReferences(prj)"
+ "\nvc2010.projectReferences(prj)\nvc2010.sdkReferences(prj)\nvc2010.masmfiles(prj)\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.targets\" />')\n_p(1,'<ImportGroup Label=\"ExtensionTargets\">')\nif usemasm then\n_p(2, '<Import Project=\"$(VCTargetsPath)\\\\BuildCustomizations\\\\masm.targets\" />')\nend\n_p(1,'</ImportGroup>')\n_p('</Project>')\nend\nfunction vc2010.clrReferences(prj)\nif #prj.clrreferences == 0 then\nreturn\nend\n_p(1,'<ItemGroup>')\nfor _, ref in ipairs(prj.clrreferences) do\nif os.isfile(ref) then\nlocal assembly = path.getbasename(ref)\n_p(2,'<Reference Include=\"%s\">', assembly)\n_p(3,'<HintPath>%s</HintPath>', path.getrelative(prj.location, ref))\n_p(2,'</Reference>')\nelse\n_p(2,'<Reference Include=\"%s\" />', ref)\nend\nend\n_p(1,'</ItemGroup>')\nend\nfunction vc2010.projectReferences(prj)\nlocal deps = premake.getdependencies(prj)\nif #deps == 0 and #prj.vsimportreferences == 0 then\nreturn\nend\nlocal function compareuuid(a, b) return a.uuid < b.uuid end\ntable.sort(deps"
+ ", compareuuid)\ntable.sort(table.join(prj.vsimportreferences), compareuuid)\n_p(1,'<ItemGroup>')\nfor _, dep in ipairs(deps) do\nlocal deppath = path.getrelative(prj.location, vstudio.projectfile(dep))\n_p(2,'<ProjectReference Include=\\\"%s\\\">', path.translate(deppath, \"\\\\\"))\n_p(3,'<Project>{%s}</Project>', dep.uuid)\nif vstudio.iswinrt() then\n_p(3,'<ReferenceOutputAssembly>false</ReferenceOutputAssembly>')\nend\n_p(2,'</ProjectReference>')\nend\nfor _, ref in ipairs(prj.vsimportreferences) do\nlocal slnrelpath = path.rebase(ref, prj.location, sln.location)\nlocal iprj = premake.vstudio.getimportprj(slnrelpath, prj.solution)\n_p(2,'<ProjectReference Include=\\\"%s\\\">', ref)\n_p(3,'<Project>{%s}</Project>', iprj.uuid)\n_p(2,'</ProjectReference>')\nend\n_p(1,'</ItemGroup>')\nend\nfunction vc2010.sdkReferences(prj)\nlocal refs = prj.sdkreferences\nif #refs > 0 then\n_p(1,'<ItemGroup>')\nfor _, ref in ipairs(refs) do\n_p(2,'<SDKReference Include=\\\"%s\\\" />', ref)\nend\n_p(1,'</ItemGroup>')\nend\nend"
+ "\nfunction vc2010.debugdir(cfg)\nlocal isnx = (cfg.platform == \"NX32\" or cfg.platform == \"NX64\")\nlocal debuggerFlavor =\n iif(isnx, 'OasisNXDebugger'\n, iif(cfg.platform == \"Orbis\", 'ORBISDebugger'\n, iif(cfg.platform == \"Durango\", 'XboxOneVCppDebugger'\n, iif(cfg.platform == \"TegraAndroid\", 'AndroidDebugger'\n, iif(vstudio.iswinrt(), 'AppHostLocalDebugger'\n, 'WindowsLocalDebugger'\n)))))\n_p(2, '<DebuggerFlavor>%s</DebuggerFlavor>', debuggerFlavor)\nif cfg.debugdir and not vstudio.iswinrt() then\n_p(2, '<LocalDebuggerWorkingDirectory>%s</LocalDebuggerWorkingDirectory>'\n, path.translate(cfg.debugdir, '\\\\')\n)\nend\nif cfg.debugcmd then\n_p(2, '<LocalDebuggerCommand>%s</LocalDebuggerCommand>', cfg.debugcmd)\nend\nif cfg.debugargs then\n_p(2, '<LocalDebuggerCommandArguments>%s</LocalDebuggerCommandArguments>'\n, table.concat(cfg.debugargs, \" \")\n)\nend\nif cfg.debugenvs and #cfg.debugenvs > 0 then\n_p(2, '<Lo"
+ "calDebuggerEnvironment>%s%s</LocalDebuggerEnvironment>'\n, table.concat(cfg.debugenvs, \"\\n\")\n, iif(cfg.flags.DebugEnvsInherit,'\\n$(LocalDebuggerEnvironment)', '')\n)\nif cfg.flags.DebugEnvsDontMerge then\n_p(2, '<LocalDebuggerMergeEnvironment>false</LocalDebuggerMergeEnvironment>')\nend\nend\nif cfg.deploymode then\n_p(2, '<DeployMode>%s</DeployMode>', cfg.deploymode)\nend\nif cfg.platform == \"TegraAndroid\" then\nif cfg.androiddebugintentparams then\n_p(2, '<IntentParams>%s</IntentParams>'\n, table.concat(cfg.androiddebugintentparams, \" \")\n)\nend\nend\nend\nfunction premake.vs2010_vcxproj_user(prj)\nio.indent = \" \"\nvc2010.header()\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(' <PropertyGroup '.. if_config_and_platform() ..'>', premake.esc(cfginfo.name))\nvc2010.debugdir(cfg)\n_p(' </PropertyGroup>')\nend\n_p('</Project>')\nend\nlocal png1x1data = {\n0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0"
+ "x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, -- .PNG........IHDR\n0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x00, 0x00, 0x00, 0x25, 0xdb, 0x56, -- .............%.V\n0xca, 0x00, 0x00, 0x00, 0x03, 0x50, 0x4c, 0x54, 0x45, 0x00, 0x00, 0x00, 0xa7, 0x7a, 0x3d, 0xda, -- .....PLTE....z=.\n0x00, 0x00, 0x00, 0x01, 0x74, 0x52, 0x4e, 0x53, 0x00, 0x40, 0xe6, 0xd8, 0x66, 0x00, 0x00, 0x00, -- ....tRNS.@..f...\n0x0a, 0x49, 0x44, 0x41, 0x54, 0x08, 0xd7, 0x63, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0xe2, -- .IDAT..c`.......\n0x21, 0xbc, 0x33, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, -- !.3....IEND.B`.\n}\nfunction png1x1(obj, filename)\nfilename = premake.project.getfilename(obj, filename)\nlocal f, err = io.open(filename, \"wb\")\nif f then\nfor _, byte in ipairs(png1x1data) do\nf:write(string.char(byte))\nend\nf:close()\nend\nend\nfunction premake.vs2010_appxmanifest(prj)\nio.indent = \" \"\nio.eol = \"\\r\\n\"\n_p('<?xml version=\"1.0\" encoding=\"utf-8\"?>')\nif v"
+ "studio.storeapp == \"10.0\" then\n_p('<Package')\n_p(1, 'xmlns=\"http://schemas.microsoft.com/appx/manifest/foundation/windows10\"')\n_p(1, 'xmlns:mp=\"http://schemas.microsoft.com/appx/2014/phone/manifest\"')\n_p(1, 'xmlns:uap=\"http://schemas.microsoft.com/appx/manifest/uap/windows10\"')\n_p(1, 'IgnorableNamespaces=\"uap mp\">')\nelseif vstudio.storeapp == \"durango\" then\n_p('<Package xmlns=\"http://schemas.microsoft.com/appx/2010/manifest\" xmlns:mx=\"http://schemas.microsoft.com/appx/2013/xbox/manifest\" IgnorableNamespaces=\"mx\">')\nend\n_p(1, '<Identity')\n_p(2, 'Name=\"' .. prj.uuid .. '\"')\n_p(2, 'Publisher=\"CN=Publisher\"')\n_p(2, 'Version=\"1.0.0.0\" />')\nif vstudio.storeapp == \"10.0\" then\n_p(1, '<mp:PhoneIdentity')\n_p(2, 'PhoneProductId=\"' .. prj.uuid .. '\"')\n_p(2, 'PhonePublisherId=\"00000000-0000-0000-0000-000000000000\"/>')\nend\n_p(1, '<Properties>')\n_p(2, '<DisplayName>' .. prj.name .. '</DisplayName>')\n_p(2, '<PublisherDisplayName>PublisherDisplayName</PublisherDisplayName>')\n_"
+ "p(2, '<Logo>' .. prj.name .. '\\\\StoreLogo.png</Logo>')\npng1x1(prj, \"%%/StoreLogo.png\")\n_p(2, '<Description>' .. prj.name .. '</Description>')\n_p(1,'</Properties>')\nif vstudio.storeapp == \"10.0\" then\n_p(1, '<Dependencies>')\n_p(2, '<TargetDeviceFamily Name=\"Windows.Universal\" MinVersion=\"10.0.10069.0\" MaxVersionTested=\"10.0.10069.0\" />')\n_p(1, '</Dependencies>')\nelseif vstudio.storeapp == \"durango\" then\n_p(1, '<Prerequisites>')\n_p(2, '<OSMinVersion>6.2</OSMinVersion>')\n_p(2, '<OSMaxVersionTested>6.2</OSMaxVersionTested>')\n_p(1, '</Prerequisites>')\nend\n_p(1, '<Resources>')\n_p(2, '<Resource Language=\"en-us\"/>')\n_p(1, '</Resources>')\n_p(1, '<Applications>')\n_p(2, '<Application Id=\"App\"')\n_p(3, 'Executable=\"$targetnametoken$.exe\"')\n_p(3, 'EntryPoint=\"' .. prj.name .. '.App\">')\nif vstudio.storeapp == \"10.0\" then\n_p(3, '<uap:VisualElements')\n_p(4, 'DisplayName=\"' .. prj.name .. '\"')\n_p(4, 'Square150x150Logo=\"' .. prj.name .. '\\\\Logo.png\"')\npng1x1(prj, \"%%/Logo.pn"
+ "g\")\nif vstudio.storeapp == \"10.0\" then\n_p(4, 'Square44x44Logo=\"' .. prj.name .. '\\\\SmallLogo.png\"')\npng1x1(prj, \"%%/SmallLogo.png\")\nelse\n_p(4, 'Square30x30Logo=\"' .. prj.name .. '\\\\SmallLogo.png\"')\npng1x1(prj, \"%%/SmallLogo.png\")\nend\n_p(4, 'Description=\"' .. prj.name .. '\"')\n_p(4, 'BackgroundColor=\"transparent\">')\n_p(4, '<uap:SplashScreen Image=\"' .. prj.name .. '\\\\SplashScreen.png\" />')\npng1x1(prj, \"%%/SplashScreen.png\")\n_p(3, '</uap:VisualElements>')\nelseif vstudio.storeapp == \"durango\" then\n_p(3, '<VisualElements')\n_p(4, 'DisplayName=\"' .. prj.name .. '\"')\n_p(4, 'Logo=\"' .. prj.name .. '\\\\Logo.png\"')\npng1x1(prj, \"%%/Logo.png\")\n_p(4, 'SmallLogo=\"' .. prj.name .. '\\\\SmallLogo.png\"')\npng1x1(prj, \"%%/SmallLogo.png\")\n_p(4, 'Description=\"' .. prj.name .. '\"')\n_p(4, 'ForegroundText=\"light\"')\n_p(4, 'BackgroundColor=\"transparent\">')\n_p(5, '<SplashScreen Image=\"' .. prj.name .. '\\\\SplashScreen.png\" />')\npng1x1(prj, \"%%/SplashScreen.png\")\n_p"
+ "(3, '</VisualElements>')\n_p(3, '<Extensions>')\n_p(4, '<mx:Extension Category=\"xbox.system.resources\">')\n_p(4, '<mx:XboxSystemResources />')\n_p(4, '</mx:Extension>')\n_p(3, '</Extensions>')\nend\n_p(2, '</Application>')\n_p(1, '</Applications>')\n_p('</Package>')\nend\n",
/* actions/vstudio/vstudio_vcxproj_filters.lua */
"local vc2010 = premake.vstudio.vc2010\nlocal project = premake.project\nfunction vc2010.filteridgroup(prj)\nlocal filters = { }\nlocal filterfound = false\nfor file in premake.project.eachfile(prj, true) do\nlocal folders = string.explode(file.vpath, \"/\", true)\nlocal path = \"\"\nfor i = 1, #folders - 1 do\nif not filterfound then\nfilterfound = true\n_p(1,'<ItemGroup>')\nend\npath = path .. folders[i]\nif not filters[path] then\nfilters[path] = true\n_p(2, '<Filter Include=\"%s\">', path)\n_p(3, '<UniqueIdentifier>{%s}</UniqueIdentifier>', os.uuid(path))\n_p(2, '</Filter>')\nend\npath = path .. \"\\\\\"\nend\nend\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nlocal folders = string.explode(path.trimdots(path.getrelative(prj.location,buildtask[1])), \"/\", true)\nlocal path = \"\"\nfor i = 1, #folders - 1 do\nif not filterfound then\nfilterfound = true\n_p(1,'<ItemGroup>')\nend\npath = path .. folders[i]\nif not filters[path] then\nfilt"
"ers[path] = true\n_p(2, '<Filter Include=\"%s\">', path)\n_p(3, '<UniqueIdentifier>{%s}</UniqueIdentifier>', os.uuid(path))\n_p(2, '</Filter>')\nend\npath = path .. \"\\\\\"\nend\nend\nend\nif filterfound then\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.filefiltergroup(prj, section, kind)\nlocal files = vc2010.getfilegroup(prj, section) or {}\nif kind == nill then\nkind = section\nend\nif (section == \"CustomBuild\") then\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nlocal fcfg = { }\nfcfg.name = path.getrelative(prj.location,buildtask[1])\nfcfg.vpath = path.trimdots(fcfg.name)\ntable.insert(files, fcfg)\nend\nend\nend\nif #files > 0 then\n_p(1,'<ItemGroup>')\nfor _, file in ipairs(files) do\nlocal filter\nif file.name ~= file.vpath then\nfilter = path.getdirectory(file.vpath)\nelse\nfilter = path.getdirectory(file.name)\nend\nif filter ~= \".\" then\n_p(2,'<%s Include=\\\"%s\\\">', kind, path.translate(file.name, \"\\\\\"))\n_p(3,'<"
- "Filter>%s</Filter>', path.translate(filter, \"\\\\\"))\n_p(2,'</%s>', kind)\nelse\n_p(2,'<%s Include=\\\"%s\\\" />', kind, path.translate(file.name, \"\\\\\"))\nend\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.generate_filters(prj)\nio.indent = \" \"\nvc2010.header()\nvc2010.filteridgroup(prj)\nvc2010.filefiltergroup(prj, \"None\")\nvc2010.filefiltergroup(prj, \"ClInclude\")\nvc2010.filefiltergroup(prj, \"ClCompile\")\nvc2010.filefiltergroup(prj, \"ResourceCompile\")\nvc2010.filefiltergroup(prj, \"CustomBuild\")\nvc2010.filefiltergroup(prj, \"AppxManifest\")\nvc2010.filefiltergroup(prj, \"Natvis\")\nvc2010.filefiltergroup(prj, \"Image\")\nvc2010.filefiltergroup(prj, \"DeploymentContent\", \"None\")\nvc2010.filefiltergroup(prj, \"MASM\")\n_p('</Project>')\nend\n",
+ "Filter>%s</Filter>', path.translate(filter, \"\\\\\"))\n_p(2,'</%s>', kind)\nelse\n_p(2,'<%s Include=\\\"%s\\\" />', kind, path.translate(file.name, \"\\\\\"))\nend\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.generate_filters(prj)\nio.indent = \" \"\nvc2010.header()\nvc2010.filteridgroup(prj)\nvc2010.filefiltergroup(prj, \"None\")\nvc2010.filefiltergroup(prj, \"ClInclude\")\nvc2010.filefiltergroup(prj, \"ClCompile\")\nvc2010.filefiltergroup(prj, \"Object\")\nvc2010.filefiltergroup(prj, \"ResourceCompile\")\nvc2010.filefiltergroup(prj, \"CustomBuild\")\nvc2010.filefiltergroup(prj, \"AppxManifest\")\nvc2010.filefiltergroup(prj, \"Natvis\")\nvc2010.filefiltergroup(prj, \"Image\")\nvc2010.filefiltergroup(prj, \"DeploymentContent\", \"None\")\nvc2010.filefiltergroup(prj, \"MASM\")\n_p('</Project>')\nend\n",
/* actions/vstudio/vs2010.lua */
"local vc2010 = premake.vstudio.vc2010\nlocal vstudio = premake.vstudio\nnewaction\n{\ntrigger = \"vs2010\",\nshortname = \"Visual Studio 2010\",\ndescription = \"Generate Microsoft Visual Studio 2010 project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\", \"C#\"},\nvalid_tools = {\ncc = { \"msc\" },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", vstudio.sln2005.generate)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", vstudio.cs2005.generate)\npremake.generate(prj, \"%%.csproj.user\", vstudio.cs2005.generate_user)\nelse\npremake.generate(prj, \"%%.vcxproj\", premake.vs2010_vcxproj)\npremake.generate(prj, \"%%.vcxproj.user\", premake.vs2010_vcxproj_user)\npremake.generate(prj, \"%%.vcxproj.filters\", vstudio.vc2010.generate_filters)\nend\nend,\noncleanso"
@@ -336,79 +361,106 @@ const char* builtin_scripts[] = {
/* actions/vstudio/vs2017.lua */
"premake.vstudio.vc2017 = {}\nlocal vc2017 = premake.vstudio.vc2017\nlocal vstudio = premake.vstudio\nnewaction\n{\ntrigger = \"vs2017\",\nshortname = \"Visual Studio 2017\",\ndescription = \"Generate Microsoft Visual Studio 2017 project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools = {\ncc = { \"msc\" },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", vstudio.sln2005.generate)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", vstudio.cs2005.generate)\npremake.generate(prj, \"%%.csproj.user\", vstudio.cs2005.generate_user)\nelse\npremake.vstudio.needAppxManifest = false\npremake.generate(prj, \"%%.vcxproj\", premake.vs2010_vcxproj)\npremake.generate(prj, \"%%.vcxproj.user\", premake.vs2010_vcxproj_user)\npremake.generate(prj, \"%%.v"
- "cxproj.filters\", vstudio.vc2010.generate_filters)\nif premake.vstudio.needAppxManifest then\npremake.generate(prj, \"%%/Package.appxmanifest\", premake.vs2010_appxmanifest)\nend\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject = premake.vstudio.cleanproject,\noncleantarget = premake.vstudio.cleantarget,\nvstudio = {\nsolutionVersion = \"12\",\ntargetFramework = \"4.5.2\",\ntoolsVersion = \"15.0\",\nwindowsTargetPlatformVersion = \"8.1\",\nsupports64bitEditContinue = true,\nintDirAbsolute = true,\n}\n}\n",
+ "cxproj.filters\", vstudio.vc2010.generate_filters)\nif premake.vstudio.needAppxManifest then\npremake.generate(prj, \"%%/Package.appxmanifest\", premake.vs2010_appxmanifest)\nend\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject = premake.vstudio.cleanproject,\noncleantarget = premake.vstudio.cleantarget,\nvstudio = {\nsolutionVersion = \"12\",\ntargetFramework = \"4.5.2\",\ntoolsVersion = \"15.0\",\nwindowsTargetPlatformVersion = \"8.1\",\nsupports64bitEditContinue = true,\nintDirAbsolute = false,\n}\n}\n",
+
+ /* actions/vstudio/vs2019.lua */
+ "premake.vstudio.vc2019 = {}\nlocal vc2019 = premake.vstudio.vc2019\nlocal vstudio = premake.vstudio\nnewaction\n{\ntrigger = \"vs2019\",\nshortname = \"Visual Studio 2019\",\ndescription = \"Generate Microsoft Visual Studio 2019 project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools = {\ncc = { \"msc\" },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", vstudio.sln2005.generate)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", vstudio.cs2005.generate)\npremake.generate(prj, \"%%.csproj.user\", vstudio.cs2005.generate_user)\nelse\npremake.vstudio.needAppxManifest = false\npremake.generate(prj, \"%%.vcxproj\", premake.vs2010_vcxproj)\npremake.generate(prj, \"%%.vcxproj.user\", premake.vs2010_vcxproj_user)\npremake.generate(prj, \"%%.v"
+ "cxproj.filters\", vstudio.vc2010.generate_filters)\nif premake.vstudio.needAppxManifest then\npremake.generate(prj, \"%%/Package.appxmanifest\", premake.vs2010_appxmanifest)\nend\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject = premake.vstudio.cleanproject,\noncleantarget = premake.vstudio.cleantarget,\nvstudio = {\nsolutionVersion = \"12\",\ntargetFramework = \"4.7.2\",\ntoolsVersion = \"16.0\",\nwindowsTargetPlatformVersion = \"10.0\",\nsupports64bitEditContinue = true,\nintDirAbsolute = false,\n}\n}\n",
/* actions/vstudio/vsllvm.lua */
"premake.vstudio.vcllvm = {}\nlocal vcllvm = premake.vstudio.vcllvm\nlocal vstudio = premake.vstudio\nnewaction\n{\ntrigger = \"vsllvm\",\nshortname = \"Visual Studio LLVM\",\ndescription = \"Generate Microsoft Visual Studio LLVM project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools = {\ncc = { \"msc\" },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", vstudio.sln2005.generate)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", vstudio.cs2005.generate)\npremake.generate(prj, \"%%.csproj.user\", vstudio.cs2005.generate_user)\nelse\npremake.vstudio.needAppxManifest = false\npremake.generate(prj, \"%%.vcxproj\", premake.vs2010_vcxproj)\npremake.generate(prj, \"%%.vcxproj.user\", premake.vs2010_vcxproj_user)\npremake.generate(prj, \"%%.v"
"cxproj.filters\", vstudio.vc2010.generate_filters)\nif premake.vstudio.needAppxManifest then\npremake.generate(prj, \"%%/Package.appxmanifest\", premake.vs2010_appxmanifest)\nend\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject = premake.vstudio.cleanproject,\noncleantarget = premake.vstudio.cleantarget,\nvstudio = {\nsolutionVersion = \"12\",\ntargetFramework = \"4.5.2\",\ntoolsVersion = \"15.0\",\nwindowsTargetPlatformVersion = \"8.1\",\nsupports64bitEditContinue = true,\nintDirAbsolute = true,\n}\n}\n",
/* actions/xcode/_xcode.lua */
- "premake.xcode = { }\npremake.xcode.xcode6 = { }\nlocal function checkproject(prj)\nlocal last\nfor cfg in premake.eachconfig(prj) do\nif last and last ~= cfg.kind then\nerror(\"Project '\" .. prj.name .. \"' uses more than one target kind; not supported by Xcode\", 0)\nend\nlast = cfg.kind\nend\nend\npremake.xcode.toolset = \"macosx\"\nnewaction\n{\ntrigger = \"xcode3\",\nshortname = \"Xcode 3\",\ndescription = \"Generate Apple Xcode 3 project files (experimental)\",\nos = \"macosx\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\" },\nvalid_tools = {\ncc = { \"gcc\" },\n},\nvalid_platforms = {\nNative = \"Native\",\nx32 = \"Native 32-bit\",\nx64 = \"Native 64-bit\",\nUniversal32 = \"32-bit Universal\",\nUniversal64 = \"64-bit Universal\",\nUniversal = \"Universal\",\n},\ndefault_platform = \"Universal\",\nonsolution = function(sln)\npremake.xcode.preparesolution(sln)\nend,\nonproject = "
- "function(prj)\npremake.generate(prj, \"%%.xcodeproj/project.pbxproj\", premake.xcode.project)\nend,\noncleanproject = function(prj)\npremake.clean.directory(prj, \"%%.xcodeproj\")\nend,\noncheckproject = checkproject,\n}\nnewaction\n{\ntrigger = \"xcode4\",\nshortname = \"Xcode 4\",\ndescription = \"Generate Apple Xcode 4 project files (experimental)\",\nos = \"macosx\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\" },\nvalid_tools = {\ncc = { \"gcc\" },\n},\nvalid_platforms = {\nNative = \"Native\",\nx32 = \"Native 32-bit\",\nx64 = \"Native 64-bit\",\nUniversal32 = \"32-bit Universal\",\nUniversal64 = \"64-bit Universal\",\nUniversal = \"Universal\",\n},\ndefault_platform = \"Universal\",\nonsolution = function(sln)\npremake.generate(sln, \"%%.xcworkspace/contents.xcworkspacedata\", premake.xcode4.workspace_generate)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%.xcodepr"
- "oj/project.pbxproj\", premake.xcode.project)\nend,\noncleanproject = function(prj)\npremake.clean.directory(prj, \"%%.xcodeproj\")\npremake.clean.directory(prj, \"%%.xcworkspace\")\nend,\noncheckproject = checkproject,\n}\n",
+ "premake.xcode = { }\nfunction premake.xcode.checkproject(prj)\nlocal last\nfor cfg in premake.eachconfig(prj) do\nif last and last ~= cfg.kind then\nerror(\"Project '\" .. prj.name .. \"' uses more than one target kind; not supported by Xcode\", 0)\nend\nlast = cfg.kind\nend\nend\npremake.xcode.toolset = \"macosx\"\n",
/* actions/xcode/xcode_common.lua */
- "premake.xcode.parameters = { }\nlocal xcode = premake.xcode\nlocal tree = premake.tree\nfunction xcode.getbuildcategory(node)\nlocal categories = {\n[\".a\"] = \"Frameworks\",\n[\".c\"] = \"Sources\",\n[\".cc\"] = \"Sources\",\n[\".cpp\"] = \"Sources\",\n[\".cxx\"] = \"Sources\",\n[\".dylib\"] = \"Frameworks\",\n[\".bundle\"] = \"Frameworks\",\n[\".framework\"] = \"Frameworks\",\n[\".tbd\"] = \"Frameworks\",\n[\".m\"] = \"Sources\",\n[\".mm\"] = \"Sources\",\n[\".S\"] = \"Sources\",\n[\".strings\"] = \"Resources\",\n[\".nib\"] = \"Resources\",\n[\".xib\"] = \"Resources\",\n[\".icns\"] = \"Resources\",\n[\".bmp\"] = \"Resources\",\n[\".wav\"] = \"Resources\",\n[\".xcassets\"] = \"Resources\",\n[\".xcdatamodeld\"] = \"Sources\",\n[\".swift\"] = \"Sources\",\n}\nreturn categories[path.getextension(node.name)]\nend\nfunction xcode.getconfigname(cfg)\nlocal name = cfg.name\nif #cfg.project.solution.xcode.platforms > 1 then\nname = name .. \" \" .. premake.action.current().valid_platforms[cfg.platform]\nend\nretur"
- "n name\nend\nfunction xcode.getfiletype(node)\nlocal types = {\n[\".c\"] = \"sourcecode.c.c\",\n[\".cc\"] = \"sourcecode.cpp.cpp\",\n[\".cpp\"] = \"sourcecode.cpp.cpp\",\n[\".css\"] = \"text.css\",\n[\".cxx\"] = \"sourcecode.cpp.cpp\",\n[\".entitlements\"] = \"text.xml\",\n[\".bundle\"] = \"wrapper.cfbundle\",\n[\".framework\"] = \"wrapper.framework\",\n[\".tbd\"] = \"sourcecode.text-based-dylib-definition\",\n[\".gif\"] = \"image.gif\",\n[\".h\"] = \"sourcecode.c.h\",\n[\".html\"] = \"text.html\",\n[\".lua\"] = \"sourcecode.lua\",\n[\".m\"] = \"sourcecode.c.objc\",\n[\".mm\"] = \"sourcecode.cpp.objcpp\",\n[\".S\"] = \"sourcecode.asm\",\n[\".nib\"] = \"wrapper.nib\",\n[\".pch\"] = \"sourcecode.c.h\",\n[\".plist\"] = \"text.plist.xml\",\n[\".strings\"] = \"text.plist.strings\",\n[\".xib\"] = \"file.xib\",\n[\".icns\"] = \"image.icns\",\n[\".bmp\"] = \"image.bmp\",\n[\".wav\"] = \"au"
- "dio.wav\",\n[\".xcassets\"] = \"folder.assetcatalog\",\n[\".xcdatamodeld\"] = \"wrapper.xcdatamodeld\",\n[\".swift\"] = \"sourcecode.swift\",\n}\nreturn types[path.getextension(node.path)] or \"text\"\nend\nfunction xcode.getfiletypeForced(node)\nlocal types = {\n[\".c\"] = \"sourcecode.cpp.cpp\",\n[\".cc\"] = \"sourcecode.cpp.cpp\",\n[\".cpp\"] = \"sourcecode.cpp.cpp\",\n[\".css\"] = \"text.css\",\n[\".cxx\"] = \"sourcecode.cpp.cpp\",\n[\".entitlements\"] = \"text.xml\",\n[\".bundle\"] = \"wrapper.cfbundle\",\n[\".framework\"] = \"wrapper.framework\",\n[\".tbd\"] = \"wrapper.framework\",\n[\".gif\"] = \"image.gif\",\n[\".h\"] = \"sourcecode.cpp.h\",\n[\".html\"] = \"text.html\",\n[\".lua\"] = \"sourcecode.lua\",\n[\".m\"] = \"sourcecode.cpp.objcpp\",\n[\".mm\"] = \"sourcecode.cpp.objcpp\",\n[\".nib\"] = \"wrapper.nib\",\n[\".pch\"] = \"sourcecode.cpp.h\",\n[\".plist\"] = \"text.plist.xml\",\n[\".strings\"] "
- " = \"text.plist.strings\",\n[\".xib\"] = \"file.xib\",\n[\".icns\"] = \"image.icns\",\n[\".bmp\"] = \"image.bmp\",\n[\".wav\"] = \"audio.wav\",\n[\".xcassets\"] = \"folder.assetcatalog\",\n[\".xcdatamodeld\"] = \"wrapper.xcdatamodeld\",\n[\".swift\"] = \"sourcecode.swift\",\n}\nreturn types[path.getextension(node.path)] or \"text\"\nend\nfunction xcode.getproducttype(node)\nlocal types = {\nConsoleApp = \"com.apple.product-type.tool\",\nWindowedApp = \"com.apple.product-type.application\",\nStaticLib = \"com.apple.product-type.library.static\",\nSharedLib = \"com.apple.product-type.library.dynamic\",\nBundle = \"com.apple.product-type.bundle\",\n}\nreturn types[node.cfg.kind]\nend\nfunction xcode.gettargettype(node)\nlocal types = {\nConsoleApp = \"\\\"compiled.mach-o.executable\\\"\",\nWindowedApp = \"wrapper.application\",\nStaticLib = \"archive.ar\",\nSharedLib = \"\\\"compiled.mach-o.dylib\\\"\",\nBundle = \"wrapper.cfbundle\",\n}\nreturn types[node.cfg.kind]"
- "\nend\nfunction xcode.getxcodeprojname(prj)\nlocal fname = premake.project.getfilename(prj, \"%%.xcodeproj\")\nreturn fname\nend\nfunction xcode.isframework(fname)\nreturn (path.getextension(fname) == \".framework\" or path.getextension(fname) == \".tbd\")\nend\nfunction xcode.newid()\nreturn string.format(\"%04X%04X%04X%04X%04X%04X\",\nmath.random(0, 32767),\nmath.random(0, 32767),\nmath.random(0, 32767),\nmath.random(0, 32767),\nmath.random(0, 32767),\nmath.random(0, 32767))\nend\nfunction xcode.preparesolution(sln)\nsln.xcode = { }\nsln.xcode.platforms = premake.filterplatforms(sln, premake.action.current().valid_platforms, \"Universal\")\nfor prj in premake.solution.eachproject(sln) do\nlocal cfg = premake.getconfig(prj, prj.configurations[1], sln.xcode.platforms[1])\nlocal node = premake.tree.new(path.getname(cfg.buildtarget.bundlepath))\nnode.cfg = cfg\nnode.id = premake.xcode.newid(node, \"product\")\nnode.targetid = premake.xcode.newid(node, \"target\")\nprj.xcode = {}\nprj.xcode.projectnode = node\nen"
- "d\nend\nfunction xcode.printlist(list, tag)\nif #list > 0 then\n_p(4,'%s = (', tag)\nfor _, item in ipairs(list) do\nlocal escaped_item = item:gsub(\"\\\"\", \"\\\\\\\"\")\n_p(5, '\"%s\",', escaped_item)\nend\n_p(4,');')\nend\nend\nfunction xcode.Header()\n_p('// !$*UTF8*$!')\n_p('{')\n_p(1,'archiveVersion = 1;')\n_p(1,'classes = {')\n_p(1,'};')\n_p(1,'objectVersion = 45;')\n_p(1,'objects = {')\n_p('')\nend\nfunction xcode.PBXBuildFile(tr)\n_p('/* Begin PBXBuildFile section */')\ntree.traverse(tr, {\nonnode = function(node)\nif node.buildid then\n_p(2,'%s /* %s in %s */ = {isa = PBXBuildFile; fileRef = %s /* %s */; };',\nnode.buildid, node.name, xcode.getbuildcategory(node), node.id, node.name)\nend\nend\n})\n_p('/* End PBXBuildFile section */')\n_p('')\nend\nfunction xcode.PBXContainerItemProxy(tr)\nif #tr.projects.children > 0 then\n_p('/* Begin PBXContainerItemProxy section */')\nfor _, node in ipairs(tr.projects.children) do\n_p(2,'%s /* PBXContainerItemProxy */ = {', node.productproxyid)\n_p(3,'isa = PBXC"
- "ontainerItemProxy;')\n_p(3,'containerPortal = %s /* %s */;', node.id, path.getname(node.path))\n_p(3,'proxyType = 2;')\n_p(3,'remoteGlobalIDString = %s;', node.project.xcode.projectnode.id)\n_p(3,'remoteInfo = \"%s\";', node.project.xcode.projectnode.name)\n_p(2,'};')\n_p(2,'%s /* PBXContainerItemProxy */ = {', node.targetproxyid)\n_p(3,'isa = PBXContainerItemProxy;')\n_p(3,'containerPortal = %s /* %s */;', node.id, path.getname(node.path))\n_p(3,'proxyType = 1;')\n_p(3,'remoteGlobalIDString = %s;', node.project.xcode.projectnode.targetid)\n_p(3,'remoteInfo = \"%s\";', node.project.xcode.projectnode.name)\n_p(2,'};')\nend\n_p('/* End PBXContainerItemProxy section */')\n_p('')\nend\nend\nfunction xcode.PBXFileReference(tr,prj)\n_p('/* Begin PBXFileReference section */')\ntree.traverse(tr, {\nonleaf = function(node)\nif not node.path then\nreturn\nend\nif node.kind == \"product\" then\n_p(2,'%s /* %s */ = {isa = PBXFileReference; explicitFileType = %s; includeInIndex = 0; name = \"%s\"; path = \"%s\"; sourceTree"
- " = BUILT_PRODUCTS_DIR; };',\nnode.id, node.name, xcode.gettargettype(node), node.name, path.getname(node.cfg.buildtarget.bundlepath))\nelseif node.parent.parent == tr.projects then\nlocal relpath = path.getrelative(tr.project.location, node.parent.project.location)\n_p(2,'%s /* %s */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = \"%s\"; path = \"%s\"; sourceTree = SOURCE_ROOT; };',\nnode.parent.id, node.parent.name, node.parent.name, path.join(relpath, node.parent.name))\nelse\nlocal pth, src\nif xcode.isframework(node.path) then\nlocal nodePath = node.path\nlocal _, matchEnd, variable = string.find(nodePath, \"^%$%((.+)%)/\")\nif variable then\nnodePath = string.sub(nodePath, matchEnd + 1)\nend\nif string.find(nodePath,'/') then\nif string.find(nodePath,'^%.')then\nerror('relative paths are not currently supported for frameworks')\nend\npth = nodePath\nelseif path.getextension(nodePath)=='.tbd' then\npth = \"/usr/lib/\" .. nodePath\nelse\npth = \"/System/Library/Frameworks/\" "
- ".. nodePath\nend\nif variable then\nsrc = variable\nif string.find(pth, '^/') then\npth = string.sub(pth, 2)\nend\nelse\nsrc = \"<absolute>\"\nend\nelse\nsrc = \"<group>\"\nif node.parent.isvpath then\npth = node.cfg.name\nelse\npth = tree.getlocalpath(node)\nend\nend\nif (not prj.options.ForceCPP) then\n_p(2,'%s /* %s */ = {isa = PBXFileReference; lastKnownFileType = %s; name = \"%s\"; path = \"%s\"; sourceTree = \"%s\"; };',\nnode.id, node.name, xcode.getfiletype(node), node.name, pth, src)\nelse\n_p(2,'%s /* %s */ = {isa = PBXFileReference; explicitFileType = %s; name = \"%s\"; path = \"%s\"; sourceTree = \"%s\"; };',\nnode.id, node.name, xcode.getfiletypeForced(node), node.name, pth, src)\nend\nend\nend\n})\n_p('/* End PBXFileReference section */')\n_p('')\nend\nfunction xcode.PBXFrameworksBuildPhase(tr)\n_p('/* Begin PBXFrameworksBuildPhase section */')\n_p(2,'%s /* Frameworks */ = {', tr.products.children[1].fxstageid)\n_p(3,'isa = PBXFrameworksBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'"
- "files = (')\ntree.traverse(tr.frameworks, {\nonleaf = function(node)\n_p(4,'%s /* %s in Frameworks */,', node.buildid, node.name)\nend\n})\ntree.traverse(tr.projects, {\nonleaf = function(node)\n_p(4,'%s /* %s in Frameworks */,', node.buildid, node.name)\nend\n})\n_p(3,');')\n_p(3,'runOnlyForDeploymentPostprocessing = 0;')\n_p(2,'};')\n_p('/* End PBXFrameworksBuildPhase section */')\n_p('')\nend\nfunction xcode.PBXGroup(tr)\n_p('/* Begin PBXGroup section */')\ntree.traverse(tr, {\nonnode = function(node)\nif (node.path and #node.children == 0) or node.kind == \"vgroup\" then\nreturn\nend\nif node.parent == tr.projects then\n_p(2,'%s /* Products */ = {', node.productgroupid)\nelse\n_p(2,'%s /* %s */ = {', node.id, node.name)\nend\n_p(3,'isa = PBXGroup;')\n_p(3,'children = (')\nfor _, childnode in ipairs(node.children) do\n_p(4,'%s /* %s */,', childnode.id, childnode.name)\nend\n_p(3,');')\nif node.parent == tr.projects then\n_p(3,'name = Products;')\nelse\n_p(3,'name = \"%s\";', node.name)\nif node.path and not"
- " node.isvpath then\nlocal p = node.path\nif node.parent.path then\np = path.getrelative(node.parent.path, node.path)\nend\n_p(3,'path = \"%s\";', p)\nend\nend\n_p(3,'sourceTree = \"<group>\";')\n_p(2,'};')\nend\n}, true)\n_p('/* End PBXGroup section */')\n_p('')\nend\nfunction xcode.PBXNativeTarget(tr)\n_p('/* Begin PBXNativeTarget section */')\nfor _, node in ipairs(tr.products.children) do\nlocal name = tr.project.name\nlocal function hasBuildCommands(which)\nif #tr.project[which] > 0 then\nreturn true\nend\nfor _, cfg in ipairs(tr.configs) do\nif #cfg[which] > 0 then\nreturn true\nend\nend\nend\n_p(2,'%s /* %s */ = {', node.targetid, name)\n_p(3,'isa = PBXNativeTarget;')\n_p(3,'buildConfigurationList = %s /* Build configuration list for PBXNativeTarget \"%s\" */;', node.cfgsection, name)\n_p(3,'buildPhases = (')\nif hasBuildCommands('prebuildcommands') then\n_p(4,'9607AE1010C857E500CD1376 /* Prebuild */,')\nend\n_p(4,'%s /* Resources */,', node.resstageid)\n_p(4,'%s /* Sources */,', node.sourcesid)\nif hasB"
- "uildCommands('prelinkcommands') then\n_p(4,'9607AE3510C85E7E00CD1376 /* Prelink */,')\nend\n_p(4,'%s /* Frameworks */,', node.fxstageid)\nif hasBuildCommands('postbuildcommands') then\n_p(4,'9607AE3710C85E8F00CD1376 /* Postbuild */,')\nend\n_p(3,');')\n_p(3,'buildRules = (')\n_p(3,');')\n_p(3,'dependencies = (')\nfor _, node in ipairs(tr.projects.children) do\n_p(4,'%s /* PBXTargetDependency */,', node.targetdependid)\nend\n_p(3,');')\n_p(3,'name = \"%s\";', name)\nlocal p\nif node.cfg.kind == \"ConsoleApp\" then\np = \"$(HOME)/bin\"\nelseif node.cfg.kind == \"WindowedApp\" then\np = \"$(HOME)/Applications\"\nend\nif p then\n_p(3,'productInstallPath = \"%s\";', p)\nend\n_p(3,'productName = \"%s\";', name)\n_p(3,'productReference = %s /* %s */;', node.id, node.name)\n_p(3,'productType = \"%s\";', xcode.getproducttype(node))\n_p(2,'};')\nend\n_p('/* End PBXNativeTarget section */')\n_p('')\nend\nfunction xcode.PBXProject(tr)\n_p('/* Begin PBXProject section */')\n_p(2,'__RootObject_ /* Project object */ = {')\n_"
- "p(3,'isa = PBXProject;')\n_p(3,'buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject \"%s\" */;', tr.name)\n_p(3,'compatibilityVersion = \"Xcode 3.2\";')\n_p(3,'hasScannedForEncodings = 1;')\n_p(3,'mainGroup = %s /* %s */;', tr.id, tr.name)\n_p(3,'projectDirPath = \"\";')\nif #tr.projects.children > 0 then\n_p(3,'projectReferences = (')\nfor _, node in ipairs(tr.projects.children) do\n_p(4,'{')\n_p(5,'ProductGroup = %s /* Products */;', node.productgroupid)\n_p(5,'ProjectRef = %s /* %s */;', node.id, path.getname(node.path))\n_p(4,'},')\nend\n_p(3,');')\nend\n_p(3,'projectRoot = \"\";')\n_p(3,'targets = (')\nfor _, node in ipairs(tr.products.children) do\n_p(4,'%s /* %s */,', node.targetid, node.name)\nend\n_p(3,');')\n_p(2,'};')\n_p('/* End PBXProject section */')\n_p('')\nend\nfunction xcode.PBXReferenceProxy(tr)\nif #tr.projects.children > 0 then\n_p('/* Begin PBXReferenceProxy section */')\ntree.traverse(tr.projects, {\nonleaf = function(node)\n_p(2,'%s /* %s */ = {'"
- ", node.id, node.name)\n_p(3,'isa = PBXReferenceProxy;')\n_p(3,'fileType = %s;', xcode.gettargettype(node))\n_p(3,'path = \"%s\";', node.path)\n_p(3,'remoteRef = %s /* PBXContainerItemProxy */;', node.parent.productproxyid)\n_p(3,'sourceTree = BUILT_PRODUCTS_DIR;')\n_p(2,'};')\nend\n})\n_p('/* End PBXReferenceProxy section */')\n_p('')\nend\nend\nfunction xcode.PBXResourcesBuildPhase(tr)\n_p('/* Begin PBXResourcesBuildPhase section */')\nfor _, target in ipairs(tr.products.children) do\n_p(2,'%s /* Resources */ = {', target.resstageid)\n_p(3,'isa = PBXResourcesBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'files = (')\ntree.traverse(tr, {\nonnode = function(node)\nif xcode.getbuildcategory(node) == \"Resources\" then\n_p(4,'%s /* %s in Resources */,', node.buildid, node.name)\nend\nend\n})\n_p(3,');')\n_p(3,'runOnlyForDeploymentPostprocessing = 0;')\n_p(2,'};')\nend\n_p('/* End PBXResourcesBuildPhase section */')\n_p('')\nend\nfunction xcode.PBXShellScriptBuildPhase(tr)\nlocal wrapperWritten = fals"
- "e\nlocal function doblock(id, name, which)\nlocal commands = {}\nfor _, cfg in ipairs(tr.configs) do\nlocal cfgcmds = cfg[which]\nif #cfgcmds > 0 then\ntable.insert(commands, 'if [ \"${CONFIGURATION}\" = \"' .. xcode.getconfigname(cfg) .. '\" ]; then')\nfor i = 1, #cfgcmds do\nlocal cmd = cfgcmds[i]\ncmd = cmd:gsub('\\\\','\\\\\\\\')\ntable.insert(commands, cmd)\nend\ntable.insert(commands, 'fi')\nend\nend\nif #commands > 0 then\nif not wrapperWritten then\n_p('/* Begin PBXShellScriptBuildPhase section */')\nwrapperWritten = true\nend\n_p(2,'%s /* %s */ = {', id, name)\n_p(3,'isa = PBXShellScriptBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'files = (')\n_p(3,');')\n_p(3,'inputPaths = (');\n_p(3,');');\n_p(3,'name = %s;', name);\n_p(3,'outputPaths = (');\n_p(3,');');\n_p(3,'runOnlyForDeploymentPostprocessing = 0;');\n_p(3,'shellPath = /bin/sh;');\n_p(3,'shellScript = \"%s\";', table.concat(commands, \"\\\\n\"):gsub('\"', '\\\\\"'))\n_p(2,'};')\nend\nend\ndoblock(\"9607AE1010C857E500CD1376\", \"Pre"
- "build\", \"prebuildcommands\")\ndoblock(\"9607AE3510C85E7E00CD1376\", \"Prelink\", \"prelinkcommands\")\ndoblock(\"9607AE3710C85E8F00CD1376\", \"Postbuild\", \"postbuildcommands\")\nif wrapperWritten then\n_p('/* End PBXShellScriptBuildPhase section */')\nend\nend\nfunction xcode.PBXSourcesBuildPhase(tr,prj)\n_p('/* Begin PBXSourcesBuildPhase section */')\nfor _, target in ipairs(tr.products.children) do\n_p(2,'%s /* Sources */ = {', target.sourcesid)\n_p(3,'isa = PBXSourcesBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'files = (')\ntree.traverse(tr, {\nonleaf = function(node)\nif xcode.getbuildcategory(node) == \"Sources\" then\nif not table.icontains(prj.excludes, node.cfg.name) then -- if not excluded\n_p(4,'%s /* %s in Sources */,', node.buildid, node.name)\nend\nend\nend\n})\n_p(3,');')\n_p(3,'runOnlyForDeploymentPostprocessing = 0;')\n_p(2,'};')\nend\n_p('/* End PBXSourcesBuildPhase section */')\n_p('')\nend\nfunction xcode.PBXVariantGroup(tr)\n_p('/* Begin PBXVariantGroup section */')\ntree"
- ".traverse(tr, {\nonbranch = function(node)\nif node.kind == \"vgroup\" then\n_p(2,'%s /* %s */ = {', node.id, node.name)\n_p(3,'isa = PBXVariantGroup;')\n_p(3,'children = (')\nfor _, lang in ipairs(node.children) do\n_p(4,'%s /* %s */,', lang.id, lang.name)\nend\n_p(3,');')\n_p(3,'name = %s;', node.name)\n_p(3,'sourceTree = \"<group>\";')\n_p(2,'};')\nend\nend\n})\n_p('/* End PBXVariantGroup section */')\n_p('')\nend\nfunction xcode.PBXTargetDependency(tr)\nif #tr.projects.children > 0 then\n_p('/* Begin PBXTargetDependency section */')\ntree.traverse(tr.projects, {\nonleaf = function(node)\n_p(2,'%s /* PBXTargetDependency */ = {', node.parent.targetdependid)\n_p(3,'isa = PBXTargetDependency;')\n_p(3,'name = \"%s\";', node.name)\n_p(3,'targetProxy = %s /* PBXContainerItemProxy */;', node.parent.targetproxyid)\n_p(2,'};')\nend\n})\n_p('/* End PBXTargetDependency section */')\n_p('')\nend\nend\nfunction xcode.XCBuildConfiguration_Target(tr, target, cfg)\nlocal cfgname = xcode.getconfigname(cfg)\n_p(2,'%s /* %s *"
- "/ = {', cfg.xcode.targetid, cfgname)\n_p(3,'isa = XCBuildConfiguration;')\n_p(3,'buildSettings = {')\n_p(4,'ALWAYS_SEARCH_USER_PATHS = NO;')\nif not cfg.flags.Symbols then\n_p(4,'DEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";')\nend\nif cfg.kind ~= \"StaticLib\" and cfg.buildtarget.prefix ~= \"\" then\n_p(4,'EXECUTABLE_PREFIX = %s;', cfg.buildtarget.prefix)\nend\nif cfg.targetextension then\nlocal ext = cfg.targetextension\next = iif(ext:startswith(\".\"), ext:sub(2), ext)\n_p(4,'EXECUTABLE_EXTENSION = %s;', ext)\nend\nif cfg.flags.ObjcARC then\n_p(4,'CLANG_ENABLE_OBJC_ARC = YES;')\nend\nlocal outdir = path.getdirectory(cfg.buildtarget.bundlepath)\nif outdir ~= \".\" then\n_p(4,'CONFIGURATION_BUILD_DIR = %s;', outdir)\nend\n_p(4,'GCC_DYNAMIC_NO_PIC = NO;')\n_p(4,'GCC_MODEL_TUNING = G5;')\nif tr.infoplist then\n_p(4,'INFOPLIST_FILE = \"%s\";', tr.infoplist.cfg.name)\nend\ninstallpaths = {\nConsoleApp = '/usr/local/bin',\nWindowedApp = '\"$(HOME)/Applications\"',\nSharedLib = '/usr/local/lib',\nStaticLib = '/us"
- "r/local/lib',\nBundle = '\"$(LOCAL_LIBRARY_DIR)/Bundles\"',\n}\n_p(4,'INSTALL_PATH = %s;', installpaths[cfg.kind])\nlocal infoplist_file = nil\nfor _, v in ipairs(cfg.files) do\nif (string.find (string.lower (v), 'info.plist') ~= nil) then\ninfoplist_file = string.format('$(SRCROOT)/%s', v)\nend\nend\nif infoplist_file ~= nil then\n_p(4,'INFOPLIST_FILE = \"%s\";', infoplist_file)\nend\nif cfg.kind == \"Bundle\" then\n_p(4, 'PRODUCT_BUNDLE_IDENTIFIER = \"genie.%s\";', cfg.buildtarget.basename:gsub(\"%s+\", '.')) --replace spaces with .\nend\n_p(4,'PRODUCT_NAME = \"%s\";', cfg.buildtarget.basename)\nif cfg.kind == \"Bundle\" then\n_p(4, 'WRAPPER_EXTENSION = bundle;')\nend\n_p(3,'};')\n_p(3,'name = \"%s\";', cfgname)\n_p(2,'};')\nend\nlocal function cfg_excluded_files(prj, cfg)\nlocal excluded = {}\nlocal function exclude_pattern(file)\nif path.isabsolute(file) then\nreturn file\nend\nlocal start, term = file:findlast(\"/%.%./\")\nif term then\nreturn path.join(\"*\", file:sub(term + 1))\nend\nstart, term = fi"
- "le:find(\"%.%./\")\nif start == 1 then\nreturn path.join(\"*\", file:sub(term + 1))\nend\nreturn path.join(\"*\", file)\nend\nlocal function add_file(file)\nlocal name = exclude_pattern(file)\nif not table.icontains(excluded, name) then\ntable.insert(excluded, name)\nend\nend\nlocal function verify_file(file)\nlocal name = exclude_pattern(file)\nif table.icontains(excluded, name) then\nerror(\"'\" .. file .. \"' would be excluded by the rule to exclude '\" .. name .. \"'\")\nend\nend\nfor _, file in ipairs(cfg.excludes) do\nadd_file(file)\nend\nfor _, file in ipairs(prj.allfiles) do\nif not table.icontains(prj.excludes, file) and not table.icontains(cfg.excludes, file) then\nif not table.icontains(cfg.files, file) then\nadd_file(file)\nelse\nverify_file(file)\nend\nend\nend\ntable.sort(excluded)\nreturn excluded\nend\nfunction xcode.XCBuildConfiguration_Project(tr, prj, cfg)\nlocal cfgname = xcode.getconfigname(cfg)\n_p(2,'%s /* %s */ = {', cfg.xcode.projectid, cfgname)\n_p(3,'isa = XCBuildConfiguration;')\n_p"
- "(3,'buildSettings = {')\nlocal archs = {\nNative = \"$(NATIVE_ARCH_ACTUAL)\",\nx32 = \"i386\",\nx64 = \"x86_64\",\nUniversal32 = \"$(ARCHS_STANDARD_32_BIT)\",\nUniversal64 = \"$(ARCHS_STANDARD_64_BIT)\",\nUniversal = \"$(ARCHS_STANDARD_32_64_BIT)\",\n}\n_p(4,'ARCHS = \"%s\";', archs[cfg.platform])\n_p(4,'SDKROOT = \"%s\";', xcode.toolset)\nif tr.entitlements then\n_p(4,'CODE_SIGN_ENTITLEMENTS = \"%s\";', tr.entitlements.cfg.name)\nend\nlocal targetdir = path.getdirectory(cfg.buildtarget.bundlepath)\nif targetdir ~= \".\" then\n_p(4,'CONFIGURATION_BUILD_DIR = \"$(SYMROOT)\";');\nend\n_p(4,'CONFIGURATION_TEMP_DIR = \"$(OBJROOT)\";')\nif cfg.flags.Symbols then\n_p(4,'COPY_PHASE_STRIP = NO;')\nend\nlocal excluded = cfg_excluded_files(prj, cfg)\nif #excluded > 0 then\n_p(4, 'EXCLUDED_SOURCE_FILE_NAMES = (')\nfor _, file in ipairs(excluded) do\n_p(5, '\"' .. file .. '\",')\nend\n_p(4, ');')\nend\n_p(4,'GCC_C_LANGUAGE_STANDARD = gnu99;')\nif cfg.flags.NoExceptions then\n_p(4,'GCC_ENABLE_CPP_EXCEPTIONS = NO;')\n"
- "end\nif cfg.flags.NoRTTI then\n_p(4,'GCC_ENABLE_CPP_RTTI = NO;')\nend\nif _ACTION ~= \"xcode4\" and cfg.flags.Symbols and not cfg.flags.NoEditAndContinue then\n_p(4,'GCC_ENABLE_FIX_AND_CONTINUE = YES;')\nend\nif cfg.flags.NoExceptions then\n_p(4,'GCC_ENABLE_OBJC_EXCEPTIONS = NO;')\nend\nif cfg.flags.Optimize or cfg.flags.OptimizeSize then\n_p(4,'GCC_OPTIMIZATION_LEVEL = s;')\nelseif cfg.flags.OptimizeSpeed then\n_p(4,'GCC_OPTIMIZATION_LEVEL = 3;')\nelse\n_p(4,'GCC_OPTIMIZATION_LEVEL = 0;')\nend\nif cfg.pchheader and not cfg.flags.NoPCH then\n_p(4,'GCC_PRECOMPILE_PREFIX_HEADER = YES;')\n_p(4,'GCC_PREFIX_HEADER = \"%s\";', cfg.pchheader)\nend\nxcode.printlist(cfg.defines, 'GCC_PREPROCESSOR_DEFINITIONS')\n_p(4,'GCC_SYMBOLS_PRIVATE_EXTERN = NO;')\nif cfg.flags.FatalWarnings then\n_p(4,'GCC_TREAT_WARNINGS_AS_ERRORS = YES;')\nend\n_p(4,'GCC_WARN_ABOUT_RETURN_TYPE = YES;')\n_p(4,'GCC_WARN_UNUSED_VARIABLE = YES;')\nxcode.printlist(cfg.includedirs, 'HEADER_SEARCH_PATHS')\nxcode.printlist(cfg.userincludedirs, 'USER_HEAD"
- "ER_SEARCH_PATHS')\nxcode.printlist(cfg.libdirs, 'LIBRARY_SEARCH_PATHS')\n_p(4,'OBJROOT = \"%s\";', cfg.objectsdir)\n_p(4,'ONLY_ACTIVE_ARCH = %s;',iif(premake.config.isdebugbuild(cfg),'YES','NO'))\nlocal checks = {\n[\"-ffast-math\"] = cfg.flags.FloatFast,\n[\"-ffloat-store\"] = cfg.flags.FloatStrict,\n[\"-fomit-frame-pointer\"] = cfg.flags.NoFramePointer,\n}\nlocal flags = { }\nfor flag, check in pairs(checks) do\nif check then\ntable.insert(flags, flag)\nend\nend\nfor _, val in ipairs(premake.xcode.parameters) do\n_p(4, val ..';')\nend\nxcode.printlist(table.join(flags, cfg.buildoptions, cfg.buildoptions_c), 'OTHER_CFLAGS')\nxcode.printlist(table.join(flags, cfg.buildoptions, cfg.buildoptions_cpp), 'OTHER_CPLUSPLUSFLAGS')\nflags = { }\nfor _, lib in ipairs(premake.getlinks(cfg, \"system\")) do\nif not xcode.isframework(lib) then\ntable.insert(flags, \"-l\" .. lib)\nend\nend\nflags = table.join(flags, cfg.linkoptions)\nxcode.printlist(flags, 'OTHER_LDFLAGS')\nif cfg.flags.StaticRuntime then\n_p"
- "(4,'STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static;')\nend\nif targetdir ~= \".\" then\n_p(4,'SYMROOT = \"%s\";', targetdir)\nend\nif cfg.flags.PedanticWarnings\nor cfg.flags.ExtraWarnings\nthen\n_p(4,'WARNING_CFLAGS = \"-Wall\";')\nend\n_p(3,'};')\n_p(3,'name = \"%s\";', cfgname)\n_p(2,'};')\nend\nfunction xcode.XCBuildConfiguration(tr, prj)\n_p('/* Begin XCBuildConfiguration section */')\nfor _, target in ipairs(tr.products.children) do\nfor _, cfg in ipairs(tr.configs) do\nxcode.XCBuildConfiguration_Target(tr, target, cfg)\nend\nend\nfor _, cfg in ipairs(tr.configs) do\nxcode.XCBuildConfiguration_Project(tr, prj, cfg)\nend\n_p('/* End XCBuildConfiguration section */')\n_p('')\nend\nfunction xcode.XCBuildConfigurationList(tr)\nlocal sln = tr.project.solution\n_p('/* Begin XCConfigurationList section */')\nfor _, target in ipairs(tr.products.children) do\n_p(2,'%s /* Build configuration list for PBXNativeTarget \"%s\" */ = {', target.cfgsection, target.name)\n_p(3,'isa = XCConfigurationList;')\n_p(3,'buildConfigu"
- "rations = (')\nfor _, cfg in ipairs(tr.configs) do\n_p(4,'%s /* %s */,', cfg.xcode.targetid, xcode.getconfigname(cfg))\nend\n_p(3,');')\n_p(3,'defaultConfigurationIsVisible = 0;')\n_p(3,'defaultConfigurationName = \"%s\";', xcode.getconfigname(tr.configs[1]))\n_p(2,'};')\nend\n_p(2,'1DEB928908733DD80010E9CD /* Build configuration list for PBXProject \"%s\" */ = {', tr.name)\n_p(3,'isa = XCConfigurationList;')\n_p(3,'buildConfigurations = (')\nfor _, cfg in ipairs(tr.configs) do\n_p(4,'%s /* %s */,', cfg.xcode.projectid, xcode.getconfigname(cfg))\nend\n_p(3,');')\n_p(3,'defaultConfigurationIsVisible = 0;')\n_p(3,'defaultConfigurationName = \"%s\";', xcode.getconfigname(tr.configs[1]))\n_p(2,'};')\n_p('/* End XCConfigurationList section */')\n_p('')\nend\nfunction xcode.Footer()\n_p(1,'};')\n_p('\\trootObject = __RootObject_ /* Project object */;')\n_p('}')\nend\n",
+ "premake.xcode.parameters = { }\nlocal xcode = premake.xcode\nlocal tree = premake.tree\nfunction xcode.getbuildcategory(node)\nlocal categories = {\n[\".a\"] = \"Frameworks\",\n[\".h\"] = \"Headers\",\n[\".hh\"] = \"Headers\",\n[\".hpp\"] = \"Headers\",\n[\".hxx\"] = \"Headers\",\n[\".inl\"] = \"Headers\",\n[\".c\"] = \"Sources\",\n[\".cc\"] = \"Sources\",\n[\".cpp\"] = \"Sources\",\n[\".cxx\"] = \"Sources\",\n[\".c++\"] = \"Sources\",\n[\".dylib\"] = \"Frameworks\",\n[\".bundle\"] = \"Frameworks\",\n[\".framework\"] = \"Frameworks\",\n[\".tbd\"] = \"Frameworks\",\n[\".m\"] = \"Sources\",\n[\".mm\"] = \"Sources\",\n[\".S\"] = \"Sources\",\n[\".strings\"] = \"Resources\",\n[\".nib\"] = \"Resources\",\n[\".xib\"] = \"Resources\",\n[\".icns\"] = \"Resources\",\n[\".bmp\"] = \"Resources\",\n[\".wav\"] = \"Resources\",\n[\".xcassets\"] = \"Resources\",\n[\".xcdatamodeld\"] = \"Sources\",\n[\".swift\"] = \"Sources\",\n}\nreturn categories[path.getextension(node.name)] or\ncategories[string.lower(path.getextension("
+ "node.name))]\nend\nfunction xcode.getconfigname(cfg)\nlocal name = cfg.name\nif #cfg.project.solution.xcode.platforms > 1 then\nname = name .. \" \" .. premake.action.current().valid_platforms[cfg.platform]\nend\nreturn name\nend\nfunction xcode.getfiletype(node)\nlocal types = {\n[\".c\"] = \"sourcecode.c.c\",\n[\".cc\"] = \"sourcecode.cpp.cpp\",\n[\".cpp\"] = \"sourcecode.cpp.cpp\",\n[\".css\"] = \"text.css\",\n[\".cxx\"] = \"sourcecode.cpp.cpp\",\n[\".c++\"] = \"sourcecode.cpp.cpp\",\n[\".entitlements\"] = \"text.xml\",\n[\".bundle\"] = \"wrapper.cfbundle\",\n[\".framework\"] = \"wrapper.framework\",\n[\".tbd\"] = \"sourcecode.text-based-dylib-definition\",\n[\".gif\"] = \"image.gif\",\n[\".h\"] = \"sourcecode.c.h\",\n[\".hh\"] = \"sourcecode.cpp.h\",\n[\".hpp\"] = \"sourcecode.cpp.h\",\n[\".hxx\"] = \"sourcecode.cpp.h\",\n[\".inl\"] = \"sourcecode.cpp.h\",\n[\".html\"] = \"text.html\",\n[\".lua\"] = \"sourceco"
+ "de.lua\",\n[\".m\"] = \"sourcecode.c.objc\",\n[\".mm\"] = \"sourcecode.cpp.objcpp\",\n[\".S\"] = \"sourcecode.asm\",\n[\".nib\"] = \"wrapper.nib\",\n[\".pch\"] = \"sourcecode.c.h\",\n[\".plist\"] = \"text.plist.xml\",\n[\".strings\"] = \"text.plist.strings\",\n[\".xib\"] = \"file.xib\",\n[\".icns\"] = \"image.icns\",\n[\".bmp\"] = \"image.bmp\",\n[\".wav\"] = \"audio.wav\",\n[\".xcassets\"] = \"folder.assetcatalog\",\n[\".xcdatamodeld\"] = \"wrapper.xcdatamodeld\",\n[\".swift\"] = \"sourcecode.swift\",\n}\nreturn types[path.getextension(node.path)] or\n(types[string.lower(path.getextension(node.path))] or \"text\")\nend\nfunction xcode.getfiletypeForced(node)\nlocal types = {\n[\".c\"] = \"sourcecode.cpp.cpp\",\n[\".cc\"] = \"sourcecode.cpp.cpp\",\n[\".cpp\"] = \"sourcecode.cpp.cpp\",\n[\".css\"] = \"text.css\",\n[\".cxx\"] = \"sourcecode.cpp.cpp\",\n[\".c++\"] = \"sourcecode.cpp.cpp\",\n[\".entitlements"
+ "\"] = \"text.xml\",\n[\".bundle\"] = \"wrapper.cfbundle\",\n[\".framework\"] = \"wrapper.framework\",\n[\".tbd\"] = \"wrapper.framework\",\n[\".gif\"] = \"image.gif\",\n[\".h\"] = \"sourcecode.cpp.h\",\n[\".hh\"] = \"sourcecode.cpp.h\",\n[\".hpp\"] = \"sourcecode.cpp.h\",\n[\".hxx\"] = \"sourcecode.cpp.h\",\n[\".inl\"] = \"sourcecode.cpp.h\",\n[\".html\"] = \"text.html\",\n[\".lua\"] = \"sourcecode.lua\",\n[\".m\"] = \"sourcecode.cpp.objcpp\",\n[\".mm\"] = \"sourcecode.cpp.objcpp\",\n[\".nib\"] = \"wrapper.nib\",\n[\".pch\"] = \"sourcecode.cpp.h\",\n[\".plist\"] = \"text.plist.xml\",\n[\".strings\"] = \"text.plist.strings\",\n[\".xib\"] = \"file.xib\",\n[\".icns\"] = \"image.icns\",\n[\".bmp\"] = \"image.bmp\",\n[\".wav\"] = \"audio.wav\",\n[\".xcassets\"] = \"folder.assetcatalog\",\n[\".xcdatamodeld\"] = \"wrapper.xcdatamodeld\",\n[\".swift\"] = \"sourcecode.swift\",\n}\nreturn types[path.ge"
+ "textension(node.path)] or\n(types[string.lower(path.getextension(node.path))] or \"text\")\nend\nfunction xcode.getproducttype(node)\nlocal types = {\nConsoleApp = \"com.apple.product-type.tool\",\nWindowedApp = node.cfg.options.SkipBundling and \"com.apple.product-type.tool\" or \"com.apple.product-type.application\",\nStaticLib = \"com.apple.product-type.library.static\",\nSharedLib = \"com.apple.product-type.library.dynamic\",\nBundle = node.cfg.options.SkipBundling and \"com.apple.product-type.tool\" or \"com.apple.product-type.bundle\",\n}\nreturn types[node.cfg.kind]\nend\nfunction xcode.gettargettype(node)\nlocal types = {\nConsoleApp = \"\\\"compiled.mach-o.executable\\\"\",\nWindowedApp = node.cfg.options.SkipBundling and \"\\\"compiled.mach-o.executable\\\"\" or \"wrapper.application\",\nStaticLib = \"archive.ar\",\nSharedLib = \"\\\"compiled.mach-o.dylib\\\"\",\nBundle = node.cfg.options.SkipBundling and \"\\\"compiled.mach-o.bundle\\\"\" or \"wrapper.cfbundle\",\n}\nreturn types"
+ "[node.cfg.kind]\nend\nfunction xcode.getxcodeprojname(prj)\nlocal fname = premake.project.getfilename(prj, \"%%.xcodeproj\")\nreturn fname\nend\nfunction xcode.isframework(fname)\nreturn (path.getextension(fname) == \".framework\" or path.getextension(fname) == \".tbd\")\nend\nfunction xcode.uuid(param)\nreturn os.uuid(param):upper():gsub('-',''):sub(0,24)\nend\nfunction xcode.newid(node, usage)\nlocal base = ''\nlocal prj = node.project\nif prj == nil then\nlocal parent = node.parent\nwhile parent ~= nil do\nif parent.project ~= nil then\nprj = parent.project\nbreak\nend\nparent = parent.parent\nend\nend\nif prj ~= nil then\nprj.uuidcounter = (prj.uuidcounter or 0) + 1\nbase = base .. prj.name .. \"$\" .. prj.uuidcounter .. \"$\"\nend\nbase = base .. \"$\" .. (node.path or node.name or \"\")\nbase = base .. \"$\" .. (usage or \"\")\nreturn xcode.uuid(base)\nend\nfunction xcode.getscriptphaselabel(cmd, count, cfg)\nreturn string.format(\"\\\"Script Phase %s [%s] (%s)\\\"\", count, cmd:match(\"(%w+)(.+)\"), iif"
+ "(cfg, xcode.getconfigname(cfg), \"all\"))\nend\nfunction xcode.getcopyphaselabel(type, count, target)\nreturn string.format(\"\\\"Copy %s %s [%s]\\\"\", type, count, target)\nend\nfunction xcode.preparesolution(sln)\nsln.xcode = { }\nsln.xcode.platforms = premake.filterplatforms(sln, premake.action.current().valid_platforms, \"Universal\")\nfor prj in premake.solution.eachproject(sln) do\nlocal cfg = premake.getconfig(prj, prj.configurations[1], sln.xcode.platforms[1])\nlocal node = premake.tree.new(path.getname(cfg.buildtarget.bundlepath))\nnode.cfg = cfg\nnode.id = premake.xcode.newid(node, \"product\")\nnode.targetid = premake.xcode.newid(node, \"target\")\nprj.xcode = {}\nprj.xcode.projectnode = node\nend\nend\nfunction xcode.printlist(list, tag, sort)\nif #list > 0 then\nif sort ~= nil and sort == true then\ntable.sort(list)\nend\n_p(4,'%s = (', tag)\nfor _, item in ipairs(list) do\nlocal escaped_item = item:gsub(\"\\\"\", \"\\\\\\\\\\\\\\\"\"):gsub(\"'\", \"\\\\\\\\'\")\n_p(5, '\"%s\",', escaped_item)\ne"
+ "nd\n_p(4,');')\nend\nend\nfunction xcode.quotestr(str)\nif str:match(\"[^a-zA-Z0-9$._/]\") == nil then\nreturn str\nend\nreturn \"\\\"\" .. str:gsub(\"[\\\"\\\\\\\"]\", \"\\\\%0\") .. \"\\\"\"\nend\nfunction xcode.Header(tr, objversion)\n_p('// !$*UTF8*$!')\n_p('{')\n_p(1,'archiveVersion = 1;')\n_p(1,'classes = {')\n_p(1,'};')\n_p(1,'objectVersion = %d;', objversion)\n_p(1,'objects = {')\n_p('')\nend\nfunction xcode.PBXBuildFile(tr)\nlocal function gatherCopyFiles(which)\nlocal copyfiles = {}\nlocal targets = tr.project[which]\nif #targets > 0 then\nfor _, t in ipairs(targets) do\nfor __, tt in ipairs(t) do\ntable.insertflat(copyfiles, tt[2])\nend\nend\nend\nreturn table.translate(copyfiles, path.getname)\nend\nlocal function gatherCopyFrameworks(which)\nlocal copyfiles = {}\nlocal targets = tr.project[which]\nif #targets > 0 then\ntable.insertflat(copyfiles, targets)\nend\nreturn table.translate(copyfiles, path.getname)\nend\nlocal copyfiles = table.flatten({\ngatherCopyFiles('xcodecopyresources'),\ngatherCop"
+ "yFrameworks('xcodecopyframeworks')\n})\n_p('/* Begin PBXBuildFile section */')\ntree.traverse(tr, {\nonnode = function(node)\nif node.buildid then\n_p(2,'%s /* %s in %s */ = {isa = PBXBuildFile; fileRef = %s /* %s */; };',\nnode.buildid, node.name, xcode.getbuildcategory(node), node.id, node.name)\nend\nif table.icontains(copyfiles, node.name) then\n_p(2,'%s /* %s in %s */ = {isa = PBXBuildFile; fileRef = %s /* %s */; %s };',\nxcode.uuid(node.name .. 'in CopyFiles'), node.name, 'CopyFiles', node.id, node.name,\niif(xcode.isframework(node.name), \"settings = {ATTRIBUTES = (CodeSignOnCopy, ); };\", \"\")\n)\nend\nend\n})\n_p('/* End PBXBuildFile section */')\n_p('')\nend\nfunction xcode.PBXContainerItemProxy(tr)\nif #tr.projects.children > 0 then\n_p('/* Begin PBXContainerItemProxy section */')\nfor _, node in ipairs(tr.projects.children) do\n_p(2,'%s /* PBXContainerItemProxy */ = {', node.productproxyid)\n_p(3,'isa = PBXContainerItemProxy;')\n_p(3,'containerPortal = %s /* %s */;', node.id, path.getname(node.pat"
+ "h))\n_p(3,'proxyType = 2;')\n_p(3,'remoteGlobalIDString = %s;', node.project.xcode.projectnode.id)\n_p(3,'remoteInfo = \"%s\";', node.project.xcode.projectnode.name)\n_p(2,'};')\n_p(2,'%s /* PBXContainerItemProxy */ = {', node.targetproxyid)\n_p(3,'isa = PBXContainerItemProxy;')\n_p(3,'containerPortal = %s /* %s */;', node.id, path.getname(node.path))\n_p(3,'proxyType = 1;')\n_p(3,'remoteGlobalIDString = %s;', node.project.xcode.projectnode.targetid)\n_p(3,'remoteInfo = \"%s\";', node.project.xcode.projectnode.name)\n_p(2,'};')\nend\n_p('/* End PBXContainerItemProxy section */')\n_p('')\nend\nend\nfunction xcode.PBXFileReference(tr,prj)\n_p('/* Begin PBXFileReference section */')\ntree.traverse(tr, {\nonleaf = function(node)\nif not node.path then\nreturn\nend\nif node.kind == \"product\" then\n_p(2,'%s /* %s */ = {isa = PBXFileReference; explicitFileType = %s; includeInIndex = 0; name = \"%s\"; path = \"%s\"; sourceTree = BUILT_PRODUCTS_DIR; };',\nnode.id, node.name, xcode.gettargettype(node), node.name, path"
+ ".getname(node.cfg.buildtarget.bundlepath))\nelseif node.parent.parent == tr.projects then\nlocal relpath = path.getrelative(tr.project.location, node.parent.project.location)\n_p(2,'%s /* %s */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = \"%s\"; path = \"%s\"; sourceTree = SOURCE_ROOT; };',\nnode.parent.id, node.parent.name, node.parent.name, path.join(relpath, node.parent.name))\nelse\nlocal pth, src\nif xcode.isframework(node.path) then\nlocal nodePath = node.path\nlocal _, matchEnd, variable = string.find(nodePath, \"^%$%((.+)%)/\")\nif variable then\nnodePath = string.sub(nodePath, matchEnd + 1)\nend\nif string.find(nodePath,'/') then\nif string.find(nodePath,'^%.')then\nnodePath = path.getabsolute(path.join(tr.project.location, nodePath))\nend\npth = nodePath\nelseif path.getextension(nodePath)=='.tbd' then\npth = \"/usr/lib/\" .. nodePath\nelse\npth = \"/System/Library/Frameworks/\" .. nodePath\nend\nif variable then\nsrc = variable\nif string.find(pth, '^/') then\npth "
+ "= string.sub(pth, 2)\nend\nelse\nsrc = \"<absolute>\"\nend\nelse\nsrc = \"<group>\"\nif node.location then\npth = node.location\nelseif node.parent.isvpath then\npth = node.cfg.name\nelse\npth = tree.getlocalpath(node)\nend\nend\nif (not prj.options.ForceCPP) then\n_p(2,'%s /* %s */ = {isa = PBXFileReference; lastKnownFileType = %s; name = \"%s\"; path = \"%s\"; sourceTree = \"%s\"; };',\nnode.id, node.name, xcode.getfiletype(node), node.name, pth, src)\nelse\n_p(2,'%s /* %s */ = {isa = PBXFileReference; explicitFileType = %s; name = \"%s\"; path = \"%s\"; sourceTree = \"%s\"; };',\nnode.id, node.name, xcode.getfiletypeForced(node), node.name, pth, src)\nend\nend\nend\n})\n_p('/* End PBXFileReference section */')\n_p('')\nend\nfunction xcode.PBXFrameworksBuildPhase(tr)\n_p('/* Begin PBXFrameworksBuildPhase section */')\n_p(2,'%s /* Frameworks */ = {', tr.products.children[1].fxstageid)\n_p(3,'isa = PBXFrameworksBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'files = (')\ntree.traverse(tr.frameworks"
+ ", {\nonleaf = function(node)\n_p(4,'%s /* %s in Frameworks */,', node.buildid, node.name)\nend\n})\ntree.traverse(tr.projects, {\nonleaf = function(node)\n_p(4,'%s /* %s in Frameworks */,', node.buildid, node.name)\nend\n})\n_p(3,');')\n_p(3,'runOnlyForDeploymentPostprocessing = 0;')\n_p(2,'};')\n_p('/* End PBXFrameworksBuildPhase section */')\n_p('')\nend\nfunction xcode.PBXGroup(tr)\n_p('/* Begin PBXGroup section */')\ntree.traverse(tr, {\nonnode = function(node)\nif (node.path and #node.children == 0) or node.kind == \"vgroup\" then\nreturn\nend\nif node.parent == tr.projects then\n_p(2,'%s /* Products */ = {', node.productgroupid)\nelse\n_p(2,'%s /* %s */ = {', node.id, node.name)\nend\n_p(3,'isa = PBXGroup;')\n_p(3,'children = (')\nfor _, childnode in ipairs(node.children) do\n_p(4,'%s /* %s */,', childnode.id, childnode.name)\nend\n_p(3,');')\nif node.parent == tr.projects then\n_p(3,'name = Products;')\nelse\n_p(3,'name = \"%s\";', node.name)\nif node.location then\n_p(3,'path = \"%s\";', node.location)"
+ "\nelseif node.path and not node.isvpath then\nlocal p = node.path\nif node.parent.path then\np = path.getrelative(node.parent.path, node.path)\nend\n_p(3,'path = \"%s\";', p)\nend\nend\n_p(3,'sourceTree = \"<group>\";')\n_p(2,'};')\nend\n}, true)\n_p('/* End PBXGroup section */')\n_p('')\nend\nfunction xcode.PBXNativeTarget(tr)\n_p('/* Begin PBXNativeTarget section */')\nfor _, node in ipairs(tr.products.children) do\nlocal name = tr.project.name\nlocal function hasBuildCommands(which)\nif #tr.project[which] > 0 then\nreturn true\nend\nfor _, cfg in ipairs(tr.configs) do\nif #cfg[which] > 0 then\nreturn true\nend\nend\nend\nlocal function dobuildblock(id, label, which, action)\nif hasBuildCommands(which) then\nlocal commandcount = 0\nfor _, cfg in ipairs(tr.configs) do\ncommandcount = commandcount + #cfg[which]\nend\nif commandcount > 0 then\naction(id, label)\nend\nend\nend\nlocal function doscriptphases(which, action)\nlocal i = 0\nfor _, cfg in ipairs(tr.configs) do\nlocal cfgcmds = cfg[which]\nif cfgcmds ~"
+ "= nil then\nfor __, scripts in ipairs(cfgcmds) do\nfor ___, script in ipairs(scripts) do\nlocal cmd = script[1]\nlocal label = xcode.getscriptphaselabel(cmd, i, cfg)\nlocal id = xcode.uuid(label)\naction(id, label)\ni = i + 1\nend\nend\nend\nend\nend\nlocal function docopyresources(which, action)\nif hasBuildCommands(which) then\nlocal targets = tr.project[which]\nif #targets > 0 then\nlocal i = 0\nfor _, t in ipairs(targets) do\nfor __, tt in ipairs(t) do\nlocal label = xcode.getcopyphaselabel('Resources', i, tt[1])\nlocal id = xcode.uuid(label)\naction(id, label)\ni = i + 1\nend\nend\nend\nend\nend\nlocal function docopyframeworks(which, action)\nif hasBuildCommands(which) then\nlocal targets = tr.project[which]\nif #targets > 0 then\nlocal label = \"Copy Frameworks\"\nlocal id = xcode.uuid(label)\naction(id, label)\nend\nend\nend\nlocal function _p_label(id, label)\n_p(4, '%s /* %s */,', id, label)\nend\n_p(2,'%s /* %s */ = {', node.targetid, name)\n_p(3,'isa = PBXNativeTarget;')\n_p(3,'buildConfigurationLi"
+ "st = %s /* Build configuration list for PBXNativeTarget \"%s\" */;', node.cfgsection, name)\n_p(3,'buildPhases = (')\ndobuildblock('9607AE1010C857E500CD1376', 'Prebuild', 'prebuildcommands', _p_label)\n_p(4,'%s /* Resources */,', node.resstageid)\n_p(4,'%s /* Sources */,', node.sourcesid)\ndobuildblock('9607AE3510C85E7E00CD1376', 'Prelink', 'prelinkcommands', _p_label)\n_p(4,'%s /* Frameworks */,', node.fxstageid)\ndobuildblock('9607AE3710C85E8F00CD1376', 'Postbuild', 'postbuildcommands', _p_label)\ndoscriptphases(\"xcodescriptphases\", _p_label)\ndocopyresources(\"xcodecopyresources\", _p_label)\nif tr.project.kind == \"WindowedApp\" then\ndocopyframeworks(\"xcodecopyframeworks\", _p_label)\nend\n_p(3,');')\n_p(3,'buildRules = (')\n_p(3,');')\n_p(3,'dependencies = (')\nfor _, node in ipairs(tr.projects.children) do\n_p(4,'%s /* PBXTargetDependency */,', node.targetdependid)\nend\n_p(3,');')\n_p(3,'name = \"%s\";', name)\nlocal p\nif node.cfg.kind == \"ConsoleApp\" then\np = \"$(HOME)/bin\"\nelseif node.cfg.ki"
+ "nd == \"WindowedApp\" then\np = \"$(HOME)/Applications\"\nend\nif p then\n_p(3,'productInstallPath = \"%s\";', p)\nend\n_p(3,'productName = \"%s\";', name)\n_p(3,'productReference = %s /* %s */;', node.id, node.name)\n_p(3,'productType = \"%s\";', xcode.getproducttype(node))\n_p(2,'};')\nend\n_p('/* End PBXNativeTarget section */')\n_p('')\nend\nfunction xcode.PBXProject(tr, compatVersion)\n_p('/* Begin PBXProject section */')\n_p(2,'__RootObject_ /* Project object */ = {')\n_p(3,'isa = PBXProject;')\n_p(3,'buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject \"%s\" */;', tr.name)\n_p(3,'compatibilityVersion = \"Xcode %s\";', compatVersion)\n_p(3,'hasScannedForEncodings = 1;')\n_p(3,'mainGroup = %s /* %s */;', tr.id, tr.name)\n_p(3,'projectDirPath = \"\";')\nif #tr.projects.children > 0 then\n_p(3,'projectReferences = (')\nfor _, node in ipairs(tr.projects.children) do\n_p(4,'{')\n_p(5,'ProductGroup = %s /* Products */;', node.productgroupid)\n_p(5,'ProjectRef = %s /* %s"
+ " */;', node.id, path.getname(node.path))\n_p(4,'},')\nend\n_p(3,');')\nend\n_p(3,'projectRoot = \"\";')\n_p(3,'targets = (')\nfor _, node in ipairs(tr.products.children) do\n_p(4,'%s /* %s */,', node.targetid, node.name)\nend\n_p(3,');')\n_p(2,'};')\n_p('/* End PBXProject section */')\n_p('')\nend\nfunction xcode.PBXReferenceProxy(tr)\nif #tr.projects.children > 0 then\n_p('/* Begin PBXReferenceProxy section */')\ntree.traverse(tr.projects, {\nonleaf = function(node)\n_p(2,'%s /* %s */ = {', node.id, node.name)\n_p(3,'isa = PBXReferenceProxy;')\n_p(3,'fileType = %s;', xcode.gettargettype(node))\n_p(3,'path = \"%s\";', node.path)\n_p(3,'remoteRef = %s /* PBXContainerItemProxy */;', node.parent.productproxyid)\n_p(3,'sourceTree = BUILT_PRODUCTS_DIR;')\n_p(2,'};')\nend\n})\n_p('/* End PBXReferenceProxy section */')\n_p('')\nend\nend\nfunction xcode.PBXResourcesBuildPhase(tr)\n_p('/* Begin PBXResourcesBuildPhase section */')\nfor _, target in ipairs(tr.products.children) do\n_p(2,'%s /* Resources */ = {', target.r"
+ "esstageid)\n_p(3,'isa = PBXResourcesBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'files = (')\ntree.traverse(tr, {\nonnode = function(node)\nif xcode.getbuildcategory(node) == \"Resources\" then\n_p(4,'%s /* %s in Resources */,', node.buildid, node.name)\nend\nend\n})\n_p(3,');')\n_p(3,'runOnlyForDeploymentPostprocessing = 0;')\n_p(2,'};')\nend\n_p('/* End PBXResourcesBuildPhase section */')\n_p('')\nend\nfunction xcode.PBXShellScriptBuildPhase(tr)\nlocal wrapperWritten = false\nlocal function doblock(id, name, commands, files)\nif commands ~= nil then\ncommands = table.flatten(commands)\nend\nif #commands > 0 then\nif not wrapperWritten then\n_p('/* Begin PBXShellScriptBuildPhase section */')\nwrapperWritten = true\nend\n_p(2,'%s /* %s */ = {', id, name)\n_p(3,'isa = PBXShellScriptBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'files = (')\n_p(3,');')\n_p(3,'inputPaths = (');\nif files ~= nil then\nfiles = table.flatten(files)\nif #files > 0 then\nfor _, file in ipairs(files) do\n_p("
+ "4, '\"%s\",', file)\nend\nend\nend\n_p(3,');');\n_p(3,'name = %s;', name);\n_p(3,'outputPaths = (');\n_p(3,');');\n_p(3,'runOnlyForDeploymentPostprocessing = 0;');\n_p(3,'shellPath = /bin/sh;');\n_p(3,'shellScript = \"%s\";', table.concat(commands, \"\\\\n\"):gsub('\"', '\\\\\"'))\n_p(2,'};')\nend\nend\nlocal function wrapcommands(cmds, cfg)\nlocal commands = {}\nif #cmds > 0 then\ntable.insert(commands, 'if [ \"${CONFIGURATION}\" = \"' .. xcode.getconfigname(cfg) .. '\" ]; then')\nfor i = 1, #cmds do\nlocal cmd = cmds[i]\ncmd = cmd:gsub('\\\\','\\\\\\\\')\ntable.insert(commands, cmd)\nend\ntable.insert(commands, 'fi')\nend\nreturn commands\nend\nlocal function dobuildblock(id, name, which)\nlocal commands = {}\nfor _, cfg in ipairs(tr.configs) do\nlocal cfgcmds = wrapcommands(cfg[which], cfg)\nif #cfgcmds > 0 then\nfor i, cmd in ipairs(cfgcmds) do\ntable.insert(commands, cmd)\nend\nend\nend\ndoblock(id, name, commands)\nend\nlocal function doscriptphases(which)\nlocal i = 0\nfor _, cfg in ipairs(tr.configs) d"
+ "o\nlocal cfgcmds = cfg[which]\nif cfgcmds ~= nil then\nfor __, scripts in ipairs(cfgcmds) do\nfor ___, script in ipairs(scripts) do\nlocal cmd = script[1]\nlocal files = script[2]\nlocal label = xcode.getscriptphaselabel(cmd, i, cfg)\nlocal id = xcode.uuid(label)\ndoblock(id, label, wrapcommands({cmd}, cfg), files)\ni = i + 1\nend\nend\nend\nend\nend\ndobuildblock(\"9607AE1010C857E500CD1376\", \"Prebuild\", \"prebuildcommands\")\ndobuildblock(\"9607AE3510C85E7E00CD1376\", \"Prelink\", \"prelinkcommands\")\ndobuildblock(\"9607AE3710C85E8F00CD1376\", \"Postbuild\", \"postbuildcommands\")\ndoscriptphases(\"xcodescriptphases\")\nif wrapperWritten then\n_p('/* End PBXShellScriptBuildPhase section */')\nend\nend\nfunction xcode.PBXSourcesBuildPhase(tr,prj)\n_p('/* Begin PBXSourcesBuildPhase section */')\nfor _, target in ipairs(tr.products.children) do\n_p(2,'%s /* Sources */ = {', target.sourcesid)\n_p(3,'isa = PBXSourcesBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'files = (')\ntree.traverse(tr, {\no"
+ "nleaf = function(node)\nif xcode.getbuildcategory(node) == \"Sources\" then\nif not table.icontains(prj.excludes, node.cfg.name) then -- if not excluded\n_p(4,'%s /* %s in Sources */,', node.buildid, node.name)\nend\nend\nend\n})\n_p(3,');')\n_p(3,'runOnlyForDeploymentPostprocessing = 0;')\n_p(2,'};')\nend\n_p('/* End PBXSourcesBuildPhase section */')\n_p('')\nend\nfunction xcode.PBXCopyFilesBuildPhase(tr)\nlocal wrapperWritten = false\nlocal function doblock(id, name, folderSpec, path, files)\nif #files > 0 then\nif not wrapperWritten then\n_p('/* Begin PBXCopyFilesBuildPhase section */')\nwrapperWritten = true\nend\n_p(2,'%s /* %s */ = {', id, name)\n_p(3,'isa = PBXCopyFilesBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'dstPath = \\\"%s\\\";', path)\n_p(3,'dstSubfolderSpec = \\\"%s\\\";', folderSpec)\n_p(3,'files = (')\ntree.traverse(tr, {\nonleaf = function(node)\nif table.icontains(files, node.name) then\n_p(4,'%s /* %s in %s */,',\nxcode.uuid(node.name .. 'in CopyFiles'), node.name, 'CopyFile"
+ "s')\nend\nend\n})\n_p(3,');')\n_p(3,'runOnlyForDeploymentPostprocessing = 0;');\n_p(2,'};')\nend\nend\nlocal function docopyresources(which)\nlocal targets = tr.project[which]\nif #targets > 0 then\nlocal i = 0\nfor _, t in ipairs(targets) do\nfor __, tt in ipairs(t) do\nlocal label = xcode.getcopyphaselabel('Resources', i, tt[1])\nlocal id = xcode.uuid(label)\nlocal files = table.translate(table.flatten(tt[2]), path.getname)\ndoblock(id, label, 7, tt[1], files)\ni = i + 1\nend\nend\nend\nend\nlocal function docopyframeworks(which)\nlocal targets = tr.project[which]\nif #targets > 0 then\nlocal label = \"Copy Frameworks\"\nlocal id = xcode.uuid(label)\nlocal files = table.translate(table.flatten(targets), path.getname)\ndoblock(id, label, 10, \"\", files)\nend\nend\ndocopyresources(\"xcodecopyresources\")\nif tr.project.kind == \"WindowedApp\" then\ndocopyframeworks(\"xcodecopyframeworks\")\nend\nif wrapperWritten then\n_p('/* End PBXCopyFilesBuildPhase section */')\nend\nend\nfunction xcode.PBXVariantGroup(tr"
+ ")\n_p('/* Begin PBXVariantGroup section */')\ntree.traverse(tr, {\nonbranch = function(node)\nif node.kind == \"vgroup\" then\n_p(2,'%s /* %s */ = {', node.id, node.name)\n_p(3,'isa = PBXVariantGroup;')\n_p(3,'children = (')\nfor _, lang in ipairs(node.children) do\n_p(4,'%s /* %s */,', lang.id, lang.name)\nend\n_p(3,');')\n_p(3,'name = %s;', node.name)\n_p(3,'sourceTree = \"<group>\";')\n_p(2,'};')\nend\nend\n})\n_p('/* End PBXVariantGroup section */')\n_p('')\nend\nfunction xcode.PBXTargetDependency(tr)\nif #tr.projects.children > 0 then\n_p('/* Begin PBXTargetDependency section */')\ntree.traverse(tr.projects, {\nonleaf = function(node)\n_p(2,'%s /* PBXTargetDependency */ = {', node.parent.targetdependid)\n_p(3,'isa = PBXTargetDependency;')\n_p(3,'name = \"%s\";', node.name)\n_p(3,'targetProxy = %s /* PBXContainerItemProxy */;', node.parent.targetproxyid)\n_p(2,'};')\nend\n})\n_p('/* End PBXTargetDependency section */')\n_p('')\nend\nend\nfunction xcode.cfg_excluded_files(prj, cfg)\nlocal excluded = {}\nloc"
+ "al function exclude_pattern(file)\nif path.isabsolute(file) then\nreturn file\nend\nlocal start, term = file:findlast(\"/%.%./\")\nif term then\nreturn path.join(\"*\", file:sub(term + 1))\nend\nstart, term = file:find(\"%.%./\")\nif start == 1 then\nreturn path.join(\"*\", file:sub(term + 1))\nend\nreturn path.join(\"*\", file)\nend\nlocal function add_file(file)\nlocal name = exclude_pattern(file)\nif not table.icontains(excluded, name) then\ntable.insert(excluded, name)\nend\nend\nlocal function verify_file(file)\nlocal name = exclude_pattern(file)\nif table.icontains(excluded, name) then\nerror(\"'\" .. file .. \"' would be excluded by the rule to exclude '\" .. name .. \"'\")\nend\nend\nfor _, file in ipairs(cfg.excludes) do\nadd_file(file)\nend\nfor _, file in ipairs(prj.allfiles) do\nif not table.icontains(prj.excludes, file) and not table.icontains(cfg.excludes, file) then\nif not table.icontains(cfg.files, file) then\nadd_file(file)\nelse\nverify_file(file)\nend\nend\nend\ntable.sort(excluded)\nreturn"
+ " excluded\nend\nfunction xcode.XCBuildConfiguration_Impl(tr, id, opts, cfg)\nlocal cfgname = xcode.getconfigname(cfg)\n_p(2,'%s /* %s */ = {', id, cfgname)\n_p(3,'isa = XCBuildConfiguration;')\n_p(3,'buildSettings = {')\nfor k, v in table.sortedpairs(opts) do\nif type(v) == \"table\" then\nif #v > 0 then\n_p(4,'%s = (', k)\nfor i, v2 in ipairs(v) do\n_p(5,'%s,', xcode.quotestr(tostring(v2)))\nend\n_p(4,');')\nend\nelse\n_p(4,'%s = %s;', k, xcode.quotestr(tostring(v)))\nend\nend\n_p(3,'};')\n_p(3,'name = %s;', xcode.quotestr(cfgname))\n_p(2,'};')\nend\nlocal function add_options(options, extras)\nfor _, tbl in ipairs(extras) do\nfor tkey, tval in pairs(tbl) do\noptions[tkey] = tval\nend\nend\nend\nlocal function add_wholearchive_links(opts, cfg)\nif #cfg.wholearchive > 0 then\nlocal linkopts = {}\nfor _, depcfg in ipairs(premake.getlinks(cfg, \"siblings\", \"object\")) do\nif table.icontains(cfg.wholearchive, depcfg.project.name) then\nlocal linkpath = path.rebase(depcfg.linktarget.fullpath, depcfg.location, cf"
+ "g.location)\ntable.insert(linkopts, \"-force_load\")\ntable.insert(linkopts, linkpath)\nend\nend\nif opts.OTHER_LDFLAGS then\nlinkopts = table.join(linkopts, opts.OTHER_LDFLAGS)\nend\nopts.OTHER_LDFLAGS = linkopts\nend\nend\nfunction xcode.XCBuildConfiguration(tr, prj, opts)\n_p('/* Begin XCBuildConfiguration section */')\nfor _, target in ipairs(tr.products.children) do\nfor _, cfg in ipairs(tr.configs) do\nlocal values = opts.ontarget(tr, target, cfg)\nadd_options(values, cfg.xcodetargetopts)\nxcode.XCBuildConfiguration_Impl(tr, cfg.xcode.targetid, values, cfg)\nend\nend\nfor _, cfg in ipairs(tr.configs) do\nlocal values = opts.onproject(tr, prj, cfg)\nadd_options(values, cfg.xcodeprojectopts)\nadd_wholearchive_links(values, cfg)\nxcode.XCBuildConfiguration_Impl(tr, cfg.xcode.projectid, values, cfg)\nend\n_p('/* End XCBuildConfiguration section */')\n_p('')\nend\nfunction xcode.XCBuildConfigurationList(tr)\nlocal sln = tr.project.solution\n_p('/* Begin XCConfigurationList section */')\nfor _, target in ipair"
+ "s(tr.products.children) do\n_p(2,'%s /* Build configuration list for PBXNativeTarget \"%s\" */ = {', target.cfgsection, target.name)\n_p(3,'isa = XCConfigurationList;')\n_p(3,'buildConfigurations = (')\nfor _, cfg in ipairs(tr.configs) do\n_p(4,'%s /* %s */,', cfg.xcode.targetid, xcode.getconfigname(cfg))\nend\n_p(3,');')\n_p(3,'defaultConfigurationIsVisible = 0;')\n_p(3,'defaultConfigurationName = \"%s\";', xcode.getconfigname(tr.configs[1]))\n_p(2,'};')\nend\n_p(2,'1DEB928908733DD80010E9CD /* Build configuration list for PBXProject \"%s\" */ = {', tr.name)\n_p(3,'isa = XCConfigurationList;')\n_p(3,'buildConfigurations = (')\nfor _, cfg in ipairs(tr.configs) do\n_p(4,'%s /* %s */,', cfg.xcode.projectid, xcode.getconfigname(cfg))\nend\n_p(3,');')\n_p(3,'defaultConfigurationIsVisible = 0;')\n_p(3,'defaultConfigurationName = \"%s\";', xcode.getconfigname(tr.configs[1]))\n_p(2,'};')\n_p('/* End XCConfigurationList section */')\n_p('')\nend\nfunction xcode.Footer()\n_p(1,'};')\n_p('\\trootObject = __RootObject_ /*"
+ " Project object */;')\n_p('}')\nend\n",
/* actions/xcode/xcode_project.lua */
- "local xcode = premake.xcode\nlocal tree = premake.tree\nfunction xcode.buildprjtree(prj)\nlocal tr = premake.project.buildsourcetree(prj, true)\ntr.configs = {}\nfor _, cfgname in ipairs(prj.solution.configurations) do\nfor _, platform in ipairs(prj.solution.xcode.platforms) do\nlocal cfg = premake.getconfig(prj, cfgname, platform)\ncfg.xcode = {}\ncfg.xcode.targetid = xcode.newid(prj.xcode.projectnode, cfgname)\ncfg.xcode.projectid = xcode.newid(tr, cfgname)\ntable.insert(tr.configs, cfg)\nend\nend\ntree.traverse(tr, {\nonbranch = function(node)\nif path.getextension(node.name) == \".lproj\" then\nlocal lang = path.getbasename(node.name) -- \"English\", \"French\", etc.\nfor _, filenode in ipairs(node.children) do\nlocal grpnode = node.parent.children[filenode.name]\nif not grpnode then\ngrpnode = tree.insert(node.parent, tree.new(filenode.name))\ngrpnode.kind = \"vgroup\"\nend\nfilenode.name = path.getbasename(lang)\ntree.insert(grpnode, filenode)\nend\ntree.remove(node)\nend\nend\n})\ntree.traverse(tr, {\n"
- "onbranch = function(node)\nif path.getextension(node.name) == \".xcassets\" then\nnode.children = {}\nend\nend\n})\ntr.frameworks = tree.new(\"Frameworks\")\nfor cfg in premake.eachconfig(prj) do\nfor _, link in ipairs(premake.getlinks(cfg, \"system\", \"fullpath\")) do\nlocal name = path.getname(link)\nif xcode.isframework(name) and not tr.frameworks.children[name] then\nnode = tree.insert(tr.frameworks, tree.new(name))\nnode.path = link\nend\nend\nend\nif #tr.frameworks.children > 0 then\ntree.insert(tr, tr.frameworks)\nend\ntr.products = tree.insert(tr, tree.new(\"Products\"))\ntr.projects = tree.new(\"Projects\")\nfor _, dep in ipairs(premake.getdependencies(prj, \"sibling\", \"object\")) do\nlocal xcpath = xcode.getxcodeprojname(dep)\nlocal xcnode = tree.insert(tr.projects, tree.new(path.getname(xcpath)))\nxcnode.path = xcpath\nxcnode.project = dep\nxcnode.productgroupid = xcode.newid(xcnode, \"prodgrp\")\nxcnode.productproxyid = xcode.newid(xcnode, \"prodprox\")\nxcnode.targetproxyid = xcode.newid(xcnod"
- "e, \"targprox\")\nxcnode.targetdependid = xcode.newid(xcnode, \"targdep\")\nlocal cfg = premake.getconfig(dep, prj.configurations[1])\nnode = tree.insert(xcnode, tree.new(cfg.linktarget.name))\nnode.path = cfg.linktarget.fullpath\nnode.cfg = cfg\nend\nif #tr.projects.children > 0 then\ntree.insert(tr, tr.projects)\nend\ntree.traverse(tr, {\nonnode = function(node)\nnode.id = xcode.newid(node)\nif xcode.getbuildcategory(node) then\nnode.buildid = xcode.newid(node, \"build\")\nend\nif string.endswith(node.name, \"Info.plist\") then\ntr.infoplist = node\nend\nif string.endswith(node.name, \".entitlements\") then\ntr.entitlements = node\nend\nend\n}, true)\nnode = tree.insert(tr.products, prj.xcode.projectnode)\nnode.kind = \"product\"\nnode.path = node.cfg.buildtarget.fullpath\nnode.cfgsection = xcode.newid(node, \"cfg\")\nnode.resstageid = xcode.newid(node, \"rez\")\nnode.sourcesid = xcode.newid(node, \"src\")\nnode.fxstageid = xcode.newid(node, \"fxs\")\nreturn tr\nend\nfunction premake.xcode.project(prj)\nlo"
- "cal tr = xcode.buildprjtree(prj)\nxcode.Header(tr)\nxcode.PBXBuildFile(tr)\nxcode.PBXContainerItemProxy(tr)\nxcode.PBXFileReference(tr,prj)\nxcode.PBXFrameworksBuildPhase(tr)\nxcode.PBXGroup(tr)\nxcode.PBXNativeTarget(tr)\nxcode.PBXProject(tr)\nxcode.PBXReferenceProxy(tr)\nxcode.PBXResourcesBuildPhase(tr)\nxcode.PBXShellScriptBuildPhase(tr)\nxcode.PBXSourcesBuildPhase(tr,prj)\nxcode.PBXVariantGroup(tr)\nxcode.PBXTargetDependency(tr)\nxcode.XCBuildConfiguration(tr, prj)\nxcode.XCBuildConfigurationList(tr)\nxcode.Footer(tr)\nend\n",
-
- /* actions/xcode/xcode4_workspace.lua */
- "premake.xcode4 = {}\nlocal xcode4 = premake.xcode4\nfunction xcode4.workspace_head()\n_p('<?xml version=\"1.0\" encoding=\"UTF-8\"?>')\n_p('<Workspace')\n_p(1,'version = \"1.0\">')\nend\nfunction xcode4.workspace_tail()\n_p('</Workspace>')\nend\nfunction xcode4.workspace_file_ref(prj, indent)\nlocal projpath = path.getrelative(prj.solution.location, prj.location)\nif projpath == '.' then projpath = ''\nelse projpath = projpath ..'/'\nend\n_p(indent, '<FileRef')\n_p(indent + 1, 'location = \"group:%s\">', projpath .. prj.name .. '.xcodeproj')\n_p(indent, '</FileRef>')\nend\nfunction xcode4.workspace_group(grp, indent)\n_p(indent, '<Group')\n_p(indent + 1, 'location = \"container:\"')\n_p(indent + 1, 'name = \"%s\">', grp.name)\nfor _, child in ipairs(grp.groups) do\nxcode4.workspace_group(child, indent + 1)\nend\nfor _, prj in ipairs(grp.projects) do\nxcode4.workspace_file_ref(prj, indent + 1)\nend\n_p(indent, '</Group>')\nend\nfunction xcode4.workspace_generate(sln)\npremake.xcode.preparesolution(sln)\nxcode4."
- "workspace_head()\nxcode4.reorderProjects(sln)\nfor grp in premake.solution.eachgroup(sln) do\nif grp.parent == nil then\nxcode4.workspace_group(grp, 1)\nend\nend\nfor prj in premake.solution.eachproject(sln) do\nif prj.group == nil then\nxcode4.workspace_file_ref(prj, 1)\nend\nend\nxcode4.workspace_tail()\nend\nfunction xcode4.reorderProjects(sln)\nif sln.startproject then\nfor i, prj in ipairs(sln.projects) do\nif sln.startproject == prj.name then\nlocal cur = prj.group\nwhile cur ~= nil do\nfor j, group in ipairs(sln.groups) do\nif group == cur then\ntable.remove(sln.groups, j)\nbreak\nend\nend\ntable.insert(sln.groups, 1, cur)\ncur = cur.parent\nend\ntable.remove(sln.projects, i)\ntable.insert(sln.projects, 1, prj)\nbreak\nend\nend\nend\nend\n",
-
- /* actions/xcode/xcode6_project.lua */
- "local xcode = premake.xcode\nlocal xcode6 = xcode.xcode6\nlocal tree = premake.tree\nfunction xcode6.buildprjtree(prj)\nlocal tr = premake.project.buildsourcetree(prj)\ntr.configs = {}\nfor _, cfgname in ipairs(prj.solution.configurations) do\nfor _, platform in ipairs(prj.solution.xcode.platforms) do\nlocal cfg = premake.getconfig(prj, cfgname, platform)\ncfg.xcode = {}\ncfg.xcode.targetid = xcode.newid(prj.xcode.projectnode, cfgname)\ncfg.xcode.projectid = xcode.newid(tr, cfgname)\ntable.insert(tr.configs, cfg)\nend\nend\ntree.traverse(tr, {\nonbranch = function(node)\nif path.getextension(node.name) == \".lproj\" then\nlocal lang = path.getbasename(node.name) -- \"English\", \"French\", etc.\nfor _, filenode in ipairs(node.children) do\nlocal grpnode = node.parent.children[filenode.name]\nif not grpnode then\ngrpnode = tree.insert(node.parent, tree.new(filenode.name))\ngrpnode.kind = \"vgroup\"\nend\nfilenode.name = path.getbasename(lang)\ntree.insert(grpnode, filenode)\nend\ntree.remove(node)\nend\nend"
- "\n})\ntree.traverse(tr, {\nonbranch = function(node)\nif path.getextension(node.name) == \".xcassets\" then\nnode.children = {}\nend\nend\n})\ntr.frameworks = tree.new(\"Frameworks\")\nfor cfg in premake.eachconfig(prj) do\nfor _, link in ipairs(premake.getlinks(cfg, \"system\", \"fullpath\")) do\nlocal name = path.getname(link)\nif xcode.isframework(name) and not tr.frameworks.children[name] then\nnode = tree.insert(tr.frameworks, tree.new(name))\nnode.path = link\nend\nend\nend\nif #tr.frameworks.children > 0 then \ntree.insert(tr, tr.frameworks)\nend\ntr.products = tree.insert(tr, tree.new(\"Products\"))\ntr.projects = tree.new(\"Projects\")\nfor _, dep in ipairs(premake.getdependencies(prj, \"sibling\", \"object\")) do\nlocal xcpath = xcode.getxcodeprojname(dep)\nlocal xcnode = tree.insert(tr.projects, tree.new(path.getname(xcpath)))\nxcnode.path = xcpath\nxcnode.project = dep\nxcnode.productgroupid = xcode.newid(xcnode, \"prodgrp\")\nxcnode.productproxyid = xcode.newid(xcnode, \"prodprox\")\nxcnode.target"
- "proxyid = xcode.newid(xcnode, \"targprox\")\nxcnode.targetdependid = xcode.newid(xcnode, \"targdep\")\nlocal cfg = premake.getconfig(dep, prj.configurations[1])\nnode = tree.insert(xcnode, tree.new(cfg.linktarget.name))\nnode.path = cfg.linktarget.fullpath\nnode.cfg = cfg\nend\nif #tr.projects.children > 0 then\ntree.insert(tr, tr.projects)\nend\ntree.traverse(tr, {\nonnode = function(node)\nnode.id = xcode.newid(node)\nif xcode.getbuildcategory(node) then\nnode.buildid = xcode.newid(node, \"build\")\nend\nif string.endswith(node.name, \"Info.plist\") then\ntr.infoplist = node\nend\nif string.endswith(node.name, \".entitlements\") then\ntr.entitlements = node\nend\nend\n}, true)\nnode = tree.insert(tr.products, prj.xcode.projectnode)\nnode.kind = \"product\"\nnode.path = node.cfg.buildtarget.fullpath\nnode.cfgsection = xcode.newid(node, \"cfg\")\nnode.resstageid = xcode.newid(node, \"rez\")\nnode.sourcesid = xcode.newid(node, \"src\")\nnode.fxstageid = xcode.newid(node, \"fxs\")\nreturn tr\nend\nfunction xc"
- "ode6.project(prj)\nlocal tr = xcode6.buildprjtree(prj)\nxcode6.Header(tr)\nxcode6.PBXProject(tr)\nxcode.PBXBuildFile(tr)\nxcode.PBXContainerItemProxy(tr)\nxcode.PBXFileReference(tr,prj)\nxcode.PBXFrameworksBuildPhase(tr)\nxcode.PBXGroup(tr)\nxcode.PBXNativeTarget(tr)\nxcode.PBXReferenceProxy(tr)\nxcode.PBXResourcesBuildPhase(tr)\nxcode.PBXShellScriptBuildPhase(tr)\nxcode.PBXSourcesBuildPhase(tr,prj)\nxcode.PBXVariantGroup(tr)\nxcode.PBXTargetDependency(tr)\nxcode.XCBuildConfiguration(tr)\nxcode.XCBuildConfigurationList(tr)\nxcode6.PBXConfigsGroup()\nxcode6.Footer(tr)\nend\nfunction xcode6.Header()\n_p('// !$*UTF8*$!')\n_p('{')\n_p(1,'archiveVersion = 1;')\n_p(1,'classes = {}')\n_p(1,'objectVersion = 46;')\n_p(1,'rootObject = __RootObject_;')\n_p(1,'objects = {')\nend\nfunction xcode6.PBXProject(tr)\n_p(2,'__RootObject_ = {')\n_p(3,'isa = PBXProject;')\n_p(3,'attributes = {LastUpgradeCheck = 9999;};')\n_p(3,'buildConfigurationList = ___RootConfs_;', tr.name)\n_p(3,'compatibilityVersion = \"Xcode 3.2\";')\n_p(3,"
- "'developmentRegion = English;')\n_p(3,'hasScannedForEncodings = 0;')\n_p(3,'knownRegions = (en);')\n_p(3,'mainGroup = ___RootGroup_;')\n_p(3,'projectDirPath = \"\";')\n_p(3,'projectRoot = \"\";')\n_p(3,'targets = (')\nfor _, node in ipairs(tr.products.children) do\n_p(4,'%s /* %s */,', node.targetid, node.name)\nend\n_p(3,');')\nif #tr.projects.children > 0 then\n_p(3,'projectReferences = (')\nfor _, node in ipairs(tr.projects.children) do\n_p(4,'{')\n_p(5,'ProductGroup = %s /* Products */;', node.productgroupid)\n_p(5,'ProjectRef = %s /* %s */;', node.id, path.getname(node.path))\n_p(4,'},')\nend\n_p(3,');')\nend\n_p(2,'};')\n_p('')\nend\nfunction xcode6.PBXConfigsGroup()\n_p(2, \"_____Configs_ = {\")\n_p(3, \"isa = PBXGroup;\")\n_p(3, \"children = (\")\n_p(3, \");\")\n_p(3, \"name = Configs;\")\n_p(3, \"sourceTree = '<group>';\")\n_p(2, \"};\")\nend\nfunction xcode6.Footer()\n_p(1,'};')\n_p('}')\nend\n",
-
- /* actions/xcode/xcode6_config.lua */
- "local xcode6 = premake.xcode.xcode6\nfunction xcode6.generate_project_config(prj)\n_p(\"PRODUCT_NAME = $(TARGET_NAME)\")\nif premake.isswiftproject(prj) then\n_p(\"OTHER_SWIFT_FLAGS = -DXcode\")\n_p(\"USE_HEADERMAP = NO\")\nend\nend",
+ "local xcode = premake.xcode\nlocal tree = premake.tree\nfunction xcode.buildprjtree(prj)\nlocal tr = premake.project.buildsourcetree(prj, true)\ntr.configs = {}\nfor _, cfgname in ipairs(prj.solution.configurations) do\nfor _, platform in ipairs(prj.solution.xcode.platforms) do\nlocal cfg = premake.getconfig(prj, cfgname, platform)\ncfg.xcode = {}\ncfg.xcode.targetid = xcode.newid(prj.xcode.projectnode, \"tgt:\"..platform..cfgname)\ncfg.xcode.projectid = xcode.newid(tr, \"prj:\"..platform..cfgname)\ntable.insert(tr.configs, cfg)\nend\nend\ntree.traverse(tr, {\nonbranch = function(node)\nif path.getextension(node.name) == \".lproj\" then\nlocal lang = path.getbasename(node.name) -- \"English\", \"French\", etc.\nfor _, filenode in ipairs(node.children) do\nlocal grpnode = node.parent.children[filenode.name]\nif not grpnode then\ngrpnode = tree.insert(node.parent, tree.new(filenode.name))\ngrpnode.kind = \"vgroup\"\nend\nfilenode.name = path.getbasename(lang)\ntree.insert(grpnode, filenode)\nend\ntree.remove(no"
+ "de)\nend\nend\n})\ntree.traverse(tr, {\nonbranch = function(node)\nif path.getextension(node.name) == \".xcassets\" then\nnode.children = {}\nend\nend\n})\ntr.frameworks = tree.new(\"Frameworks\")\nfor cfg in premake.eachconfig(prj) do\nfor _, link in ipairs(premake.getlinks(cfg, \"system\", \"fullpath\")) do\nlocal name = path.getname(link)\nif xcode.isframework(name) and not tr.frameworks.children[name] then\nnode = tree.insert(tr.frameworks, tree.new(name))\nnode.path = link\nend\nend\nend\nif #tr.frameworks.children > 0 then\ntree.insert(tr, tr.frameworks)\nend\ntr.products = tree.insert(tr, tree.new(\"Products\"))\ntr.projects = tree.new(\"Projects\")\nfor _, dep in ipairs(premake.getdependencies(prj, \"sibling\", \"object\")) do\nlocal xcpath = xcode.getxcodeprojname(dep)\nlocal xcnode = tree.insert(tr.projects, tree.new(path.getname(xcpath)))\nxcnode.path = xcpath\nxcnode.project = dep\nxcnode.productgroupid = xcode.newid(xcnode, \"prodgrp\")\nxcnode.productproxyid = xcode.newid(xcnode, \"prodprox\")\nx"
+ "cnode.targetproxyid = xcode.newid(xcnode, \"targprox\")\nxcnode.targetdependid = xcode.newid(xcnode, \"targdep\")\nlocal cfg = premake.getconfig(dep, prj.configurations[1])\nnode = tree.insert(xcnode, tree.new(cfg.linktarget.name))\nnode.path = cfg.linktarget.fullpath\nnode.cfg = cfg\nend\nif #tr.projects.children > 0 then\ntree.insert(tr, tr.projects)\nend\ntree.traverse(tr, {\nonbranchexit = function(node)\nfor _, child in ipairs(node.children) do\nif (child.location) then\nif (node.location) then\nwhile (not string.startswith(child.location, node.location)) do\nnode.location = path.getdirectory(node.location)\nend\nelse\nnode.location = path.getdirectory(child.location)\nend\nend\nend\nend,\nonleaf = function(node)\nif (node.cfg) then\nnode.location = node.cfg.name\nend\nend\n}, true)\ntree.traverse(tr, {\nonbranchexit = function(node, depth)\nif (node.location and node.parent and node.parent.location) then\nnode.location = path.getrelative(node.parent.location, node.location)\nend\nend,\nonleaf = function"
+ "(node, depth)\nif (node.location and node.parent and node.parent.location) then\nnode.location = path.getrelative(node.parent.location, node.location)\nend\nend\n}, true)\ntree.traverse(tr, {\nonnode = function(node)\nnode.id = xcode.newid(node)\nif xcode.getbuildcategory(node) then\nnode.buildid = xcode.newid(node, \"build\")\nend\nif string.endswith(node.name, \"Info.plist\") then\ntr.infoplist = node\nend\nif string.endswith(node.name, \".entitlements\") then\ntr.entitlements = node\nend\nend\n}, true)\nnode = tree.insert(tr.products, prj.xcode.projectnode)\nnode.kind = \"product\"\nnode.path = node.cfg.buildtarget.fullpath\nnode.cfgsection = xcode.newid(node, \"cfg\")\nnode.resstageid = xcode.newid(node, \"rez\")\nnode.sourcesid = xcode.newid(node, \"src\")\nnode.fxstageid = xcode.newid(node, \"fxs\")\nreturn tr\nend\n",
+
+ /* actions/xcode/xcode_scheme.lua */
+ "local premake = premake\nlocal xcode = premake.xcode\nlocal function buildableref(indent, prj, cfg)\ncfg = cfg or premake.eachconfig(prj)()\n_p(indent + 0, '<BuildableReference')\n_p(indent + 1, 'BuildableIdentifier = \"primary\"')\n_p(indent + 1, 'BlueprintIdentifier = \"%s\"', prj.xcode.projectnode.targetid)\n_p(indent + 1, 'BuildableName = \"%s\"', cfg.buildtarget.name)\n_p(indent + 1, 'BlueprintName = \"%s\"', prj.name)\n_p(indent + 1, 'Re