@@ -11,19 +11,14 @@ newoption {
11
11
}
12
12
13
13
workspace " wrenpp"
14
+ local project_location = " "
14
15
if _ACTION then
15
- -- guard this in case the user is calling `premake5 --help`
16
- -- in which case there will be no action
17
- location ( " build/" .. _ACTION )
16
+ project_location = " build/" .. _ACTION
18
17
end
19
- configurations { " Debug" , " Release" }
20
- platforms { " Win32" , " x64" }
21
18
22
- filter " platforms:Win32"
23
- architecture " x86"
19
+ configurations { " Debug" , " Release" , " Test" }
24
20
25
- filter " platforms:x64"
26
- architecture " x86_64"
21
+ architecture " x86_64"
27
22
28
23
-- global configuration
29
24
filter " configurations:Debug"
@@ -41,9 +36,10 @@ workspace "wrenpp"
41
36
buildoptions { " -std=c++14" }
42
37
43
38
project " lib"
39
+ location (project_location )
44
40
kind " StaticLib"
45
41
language " C++"
46
- targetdir " lib/"
42
+ targetdir " lib/%{cfg.buildcfg} "
47
43
targetname " wrenpp"
48
44
if _OPTIONS [" include" ] then
49
45
includedirs { _OPTIONS [" include" ] }
@@ -52,28 +48,31 @@ workspace "wrenpp"
52
48
includedirs { " src" }
53
49
54
50
project " test"
51
+ location (project_location )
55
52
kind " ConsoleApp"
56
53
language " C++"
57
- targetdir " bin"
54
+ targetdir " bin/%{cfg.buildcfg} "
58
55
targetname " test"
59
56
files { " Wren++.cpp" , " test/**.cpp" , " test/***.h" , " test/**.wren" }
60
57
includedirs { " ./" , " test" }
61
58
if _OPTIONS [" include" ] then
62
59
includedirs { _OPTIONS [" include" ] }
63
60
end
64
61
if _OPTIONS [" link" ] then
65
- libdirs {
66
- _OPTIONS [" link" ]
67
- }
68
- end
62
+ libdirs {
63
+ _OPTIONS [" link" ]
64
+ }
65
+ end
66
+
67
+ prebuildcommands { " {MKDIR} %{cfg.targetdir}" }
69
68
70
69
filter " files:**.wren"
71
- buildcommands { " {COPY} ../../test/ %{file.name} ../../bin " }
72
- buildoutputs { " ../../bin /%{file.name}" }
73
- filter {}
70
+ buildcommands { " {COPY} %{file.abspath} %{cfg.targetdir} " }
71
+ buildoutputs { " %{cfg.targetdir} /%{file.name}" }
72
+ filter {}
74
73
75
74
filter " configurations:Debug"
76
- debugdir " bin"
75
+ debugdir " bin/%{cfg.buildcfg} "
77
76
78
77
filter { " action:vs*" , " Debug" }
79
78
links { " lib" , " wren_static_d" }
0 commit comments