Last change
on this file since 30 was
17,
checked in by melon, 12 years ago
|
Modified the premake script. Before the modification, compiler flags were missing
that enabled compilation on Linux (this flag is C++11).
Also added error handling if user didn't provide the target information.
|
File size:
1.1 KB
|
Line | |
---|
1 | -- Error handling if user didn't provide any action/target
|
---|
2 | -- for the build
|
---|
3 | if _ACTION == nil then
|
---|
4 | print "Error! You must specify target build"
|
---|
5 | print "Example: ./premake4 gmake"
|
---|
6 | print " This will create makefiles for Linux"
|
---|
7 | print ""
|
---|
8 | print "Aborting!"
|
---|
9 | print ""
|
---|
10 | return
|
---|
11 | end
|
---|
12 |
|
---|
13 | solution "nv"
|
---|
14 | configurations { "debug", "release" }
|
---|
15 |
|
---|
16 | -- For starters, check the target build.
|
---|
17 | -- If this is a gmake build we must add these
|
---|
18 | -- flags to enable C++11 support.
|
---|
19 | if _ACTION == "gmake" then
|
---|
20 | buildoptions "-std=c++11"
|
---|
21 | end
|
---|
22 |
|
---|
23 | targetdir "bin"
|
---|
24 | flags { "ExtraWarnings", "NoPCH" }
|
---|
25 | language "C++"
|
---|
26 |
|
---|
27 | configuration "debug"
|
---|
28 | defines { "DEBUG" }
|
---|
29 | flags { "Symbols" }
|
---|
30 | targetdir "bin"
|
---|
31 | objdir (_ACTION.."/debug")
|
---|
32 |
|
---|
33 | configuration "release"
|
---|
34 | defines { "NDEBUG" }
|
---|
35 | flags { "Optimize" }
|
---|
36 | targetdir "bin"
|
---|
37 | objdir (_ACTION.."/release")
|
---|
38 |
|
---|
39 | dofile("nv.lua")
|
---|
40 |
|
---|
41 | newaction {
|
---|
42 | trigger = "doc",
|
---|
43 | description = "Run doxygen",
|
---|
44 | execute = function ()
|
---|
45 | os.execute("doxygen")
|
---|
46 | end
|
---|
47 | }
|
---|
48 |
|
---|
49 | if _ACTION == "clean" then
|
---|
50 | for action in premake.action.each() do
|
---|
51 | os.rmdir(action.trigger)
|
---|
52 | end
|
---|
53 | end
|
---|
54 |
|
---|
Note: See
TracBrowser
for help on using the repository browser.