blob: e8327f784195db29f1d9a4a9b91eccc93942edd2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
--
-- tests/actions/vstudio/test_vs200x_vcproj_linker.lua
-- Automated tests for Visual Studio 2002-2008 C/C++ linker block.
-- Copyright (c) 2009-2011 Jason Perkins and the Premake project
--
T.vs200x_vcproj_linker = { }
local suite = T.vs200x_vcproj_linker
local vc200x = premake.vstudio.vc200x
--
-- Setup/Teardown
--
local sln, prj
function suite.setup()
_ACTION = "vs2005"
sln, prj = test.createsolution()
end
local function prepare()
premake.bake.buildconfigs()
end
--
-- Test default linker blocks for each target kind
-- (ConsoleApp, StaticLib, etc.)
--
function suite.DefaultLinkerBlock_OnConsoleApp()
kind "ConsoleApp"
prepare()
vc200x.VCLinkerTool(premake.getconfig(prj, "Debug"))
test.capture [[
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)\MyProject.exe"
LinkIncremental="2"
AdditionalLibraryDirectories=""
GenerateDebugInformation="false"
SubSystem="1"
EntryPointSymbol="mainCRTStartup"
TargetMachine="1"
/>
]]
end
function suite.DefaultLinkerBlock_OnWindowedApp()
kind "WindowedApp"
prepare()
vc200x.VCLinkerTool(premake.getconfig(prj, "Debug"))
test.capture [[
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)\MyProject.exe"
LinkIncremental="2"
AdditionalLibraryDirectories=""
GenerateDebugInformation="false"
SubSystem="2"
EntryPointSymbol="mainCRTStartup"
TargetMachine="1"
/>
]]
end
function suite.DefaultLinkerBlock_OnSharedLib()
kind "SharedLib"
prepare()
vc200x.VCLinkerTool(premake.getconfig(prj, "Debug"))
test.capture [[
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)\MyProject.dll"
LinkIncremental="2"
AdditionalLibraryDirectories=""
GenerateDebugInformation="false"
SubSystem="2"
ImportLibrary="MyProject.lib"
TargetMachine="1"
/>
]]
end
function suite.DefaultLinkerBlock_OnStaticLib()
kind "StaticLib"
prepare()
vc200x.VCLinkerTool(premake.getconfig(prj, "Debug"))
test.capture [[
<Tool
Name="VCLibrarianTool"
OutputFile="$(OutDir)\MyProject.lib"
/>
]]
end
--
-- linkoptions tests
--
function suite.AdditionalOptions_OnStaticLib()
kind "StaticLib"
linkoptions { "/ltcg", "/lZ" }
prepare()
vc200x.VCLinkerTool(premake.getconfig(prj, "Debug"))
test.capture [[
<Tool
Name="VCLibrarianTool"
OutputFile="$(OutDir)\MyProject.lib"
AdditionalOptions="/ltcg /lZ"
/>
]]
end
|