| [20366] | 1 | --
|
|---|
| 2 | -- Premake 5.x build configuration script
|
|---|
| 3 | -- Use this script to configure the project with Premake4.
|
|---|
| 4 | --
|
|---|
| 5 |
|
|---|
| 6 | --
|
|---|
| 7 | -- Define the project. Put the release configuration first so it will be the
|
|---|
| 8 | -- default when folks build using the makefile. That way they don't have to
|
|---|
| 9 | -- worry about the /scripts argument and all that.
|
|---|
| 10 | --
|
|---|
| 11 |
|
|---|
| 12 | solution "Premake5"
|
|---|
| 13 | configurations { "Release", "Debug" }
|
|---|
| 14 | location ( _OPTIONS["to"] )
|
|---|
| 15 |
|
|---|
| 16 | project "Premake5"
|
|---|
| 17 | targetname "premake5"
|
|---|
| 18 | language "C"
|
|---|
| 19 | kind "ConsoleApp"
|
|---|
| 20 | defines { "PREMAKE_NO_BUILTIN_SCRIPTS" }
|
|---|
| 21 | flags { "No64BitChecks", "ExtraWarnings", "StaticRuntime" }
|
|---|
| [24387] | 22 | includedirs { "contrib/lua/src", "contrib/luashim" }
|
|---|
| [20366] | 23 |
|
|---|
| 24 | files
|
|---|
| 25 | {
|
|---|
| 26 | "*.txt", "**.lua",
|
|---|
| 27 | "contrib/lua/src/*.c", "contrib/lua/src/*.h",
|
|---|
| 28 | "src/host/*.c"
|
|---|
| 29 | }
|
|---|
| 30 |
|
|---|
| 31 | excludes
|
|---|
| 32 | {
|
|---|
| 33 | "contrib/lua/src/lauxlib.c",
|
|---|
| 34 | "contrib/lua/src/lua.c",
|
|---|
| 35 | "contrib/lua/src/luac.c",
|
|---|
| 36 | "contrib/lua/src/print.c",
|
|---|
| 37 | "contrib/lua/**.lua",
|
|---|
| 38 | "contrib/lua/etc/*.c"
|
|---|
| 39 | }
|
|---|
| 40 |
|
|---|
| 41 | configuration "Debug"
|
|---|
| 42 | targetdir "bin/debug"
|
|---|
| 43 | defines "_DEBUG"
|
|---|
| 44 | flags { "Symbols" }
|
|---|
| 45 |
|
|---|
| 46 | configuration "Release"
|
|---|
| 47 | targetdir "bin/release"
|
|---|
| 48 | defines "NDEBUG"
|
|---|
| 49 | flags { "OptimizeSize" }
|
|---|
| 50 |
|
|---|
| 51 | configuration "vs*"
|
|---|
| 52 | defines { "_CRT_SECURE_NO_WARNINGS" }
|
|---|
| 53 |
|
|---|
| 54 | configuration "vs2005"
|
|---|
| 55 | defines {"_CRT_SECURE_NO_DEPRECATE" }
|
|---|
| 56 |
|
|---|
| 57 | configuration "windows"
|
|---|
| 58 | links { "ole32", "advapi32" }
|
|---|
| 59 |
|
|---|
| 60 | configuration "linux or bsd or hurd"
|
|---|
| 61 | defines { "LUA_USE_POSIX", "LUA_USE_DLOPEN" }
|
|---|
| 62 | links { "m" }
|
|---|
| 63 | linkoptions { "-rdynamic" }
|
|---|
| 64 |
|
|---|
| 65 | configuration "linux or hurd"
|
|---|
| 66 | links { "dl", "rt" }
|
|---|
| 67 |
|
|---|
| 68 | configuration "macosx"
|
|---|
| 69 | defines { "LUA_USE_MACOSX" }
|
|---|
| 70 | links { "CoreServices.framework" }
|
|---|
| 71 |
|
|---|
| 72 | configuration { "macosx", "gmake" }
|
|---|
| 73 | -- toolset "clang" (not until a 5.0 binary is available)
|
|---|
| 74 | buildoptions { "-mmacosx-version-min=10.4" }
|
|---|
| 75 | linkoptions { "-mmacosx-version-min=10.4" }
|
|---|
| 76 |
|
|---|
| 77 | configuration { "solaris" }
|
|---|
| [22021] | 78 | links { "m", "socket", "nsl" }
|
|---|
| [20366] | 79 |
|
|---|
| 80 | configuration "aix"
|
|---|
| 81 | defines { "LUA_USE_POSIX", "LUA_USE_DLOPEN" }
|
|---|
| 82 | links { "m" }
|
|---|
| 83 |
|
|---|
| 84 |
|
|---|
| 85 | --
|
|---|
| 86 | -- A more thorough cleanup.
|
|---|
| 87 | --
|
|---|
| 88 |
|
|---|
| 89 | if _ACTION == "clean" then
|
|---|
| 90 | os.rmdir("bin")
|
|---|
| 91 | os.rmdir("build")
|
|---|
| 92 | end
|
|---|
| 93 |
|
|---|
| 94 |
|
|---|
| 95 |
|
|---|
| 96 | --
|
|---|
| 97 | -- Use the --to=path option to control where the project files get generated. I use
|
|---|
| 98 | -- this to create project files for each supported toolset, each in their own folder,
|
|---|
| 99 | -- in preparation for deployment.
|
|---|
| 100 | --
|
|---|
| 101 |
|
|---|
| 102 | newoption {
|
|---|
| 103 | trigger = "to",
|
|---|
| 104 | value = "path",
|
|---|
| 105 | description = "Set the output location for the generated files"
|
|---|
| 106 | }
|
|---|
| 107 |
|
|---|
| 108 |
|
|---|
| 109 |
|
|---|
| 110 | --
|
|---|
| 111 | -- This new embed action is slightly hardcoded for the 4.x executable, and is
|
|---|
| 112 | -- really only intended to get folks bootstrapped on to 5.x
|
|---|
| 113 | --
|
|---|
| 114 |
|
|---|
| 115 | newaction {
|
|---|
| 116 | trigger = "embed",
|
|---|
| 117 | description = "Embed scripts in scripts.c; required before release builds",
|
|---|
| 118 | execute = function ()
|
|---|
| 119 | _MAIN_SCRIPT_DIR = os.getcwd()
|
|---|
| 120 | _SCRIPT_DIR = path.join(_MAIN_SCRIPT_DIR, "scripts")
|
|---|
| 121 | dofile("scripts/embed.lua")
|
|---|
| 122 | end
|
|---|
| 123 | }
|
|---|