forked from HeliumProject/Engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WxWidgets.lua
191 lines (155 loc) · 10.2 KB
/
WxWidgets.lua
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
require "Helium"
Helium.BuildWxWidgets = function()
local cwd = os.getcwd()
if os.get() == "windows" then
-- This is not yet ready for prime time (as of jom 1.0.5)
-- local make = "jom.exe -j " .. os.getenv("NUMBER_OF_PROCESSORS") .. " /f makefile.vc SHARED=1 MONOLITHIC=1 DEBUG_INFO=1"
local make = "nmake.exe /f makefile.vc SHARED=1 MONOLITHIC=1 DEBUG_INFO=1"
if not os.getenv("VCINSTALLDIR") then
print("VCINSTALLDIR is not detected in your environment")
os.exit(1)
end
os.chdir( "Dependencies/wxWidgets/build/msw" );
local result
if Helium.Build32Bit() then
result = os.execute( "cmd.exe /c \"call \"%VCINSTALLDIR%\"\\vcvarsall.bat x86 && " .. make .. " BUILD=debug\"" )
if result ~= 0 then os.exit( 1 ) end
result = os.execute( "cmd.exe /c \"call \"%VCINSTALLDIR%\"\\vcvarsall.bat x86 && " .. make .. " BUILD=release\"" )
if result ~= 0 then os.exit( 1 ) end
end
if Helium.Build64Bit() then
result = os.execute( "cmd.exe /c \"call \"%VCINSTALLDIR%\"\\vcvarsall.bat x86_amd64 && " .. make .. " TARGET_CPU=AMD64 BUILD=debug\"" )
if result ~= 0 then os.exit( 1 ) end
result = os.execute( "cmd.exe /c \"call \"%VCINSTALLDIR%\"\\vcvarsall.bat x86_amd64 && " .. make .. " TARGET_CPU=AMD64 BUILD=release\"" )
if result ~= 0 then os.exit( 1 ) end
end
elseif os.get() == "macosx" then
os.chdir( "Dependencies/wxWidgets" );
local flags = " --enable-monolithic --with-osx_cocoa --with-macosx-version-min=10.6 --with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk --with-opengl --with-libjpeg=builtin --with-libpng=builtin --with-regex=builtin --with-libtiff=builtin --with-zlib=builtin --with-expat=builtin"
local arch32 = "-arch i386"
local archFlags32 = " CFLAGS=\"" .. arch32 .. "\" CXXFLAGS=\"" .. arch32 .. "\" CPPFLAGS=\"" .. arch32 .. "\" LDFLAGS=\"" .. arch32 .. "\" OBJCFLAGS=\"" .. arch32 .. "\" OBJCXXFLAGS=\"" .. arch32 .. "\""
local arch64 = "-arch x86_64"
local archFlags64 = " CFLAGS=\"" .. arch64 .. "\" CXXFLAGS=\"" .. arch64 .. "\" CPPFLAGS=\"" .. arch64 .. "\" LDFLAGS=\"" .. arch64 .. "\" OBJCFLAGS=\"" .. arch64 .. "\" OBJCXXFLAGS=\"" .. arch64 .. "\""
function Build( dirName, flags )
os.mkdir( dirName )
os.chdir( dirName )
if not os.isfile( "Makefile" ) then
local result
result = os.execute( "../configure " .. flags )
if result ~= 0 then
os.exit( 1 )
end
end
result = os.execute( "make" )
if result ~= 0 then
os.exit( 1 )
end
os.chdir( ".." )
end
local result
if Helium.Build32Bit() then
Build( "macbuild-debug-unicode-32", "--enable-debug --enable-unicode" .. flags .. archFlags32 )
Build( "macbuild-release-unicode-32", "--enable-unicode" .. flags .. archFlags32 )
end
if Helium.Build64Bit() then
Build( "macbuild-debug-unicode-64", "--enable-debug --enable-unicode" .. flags .. archFlags64 )
Build( "macbuild-release-unicode-64", "--enable-unicode" .. flags .. archFlags64 )
end
else
print("Implement support for " .. os.get() .. " to BuildWxWidgets()")
os.exit(1)
end
os.chdir( cwd )
end
Helium.CleanWxWidgets = function()
local cwd = os.getcwd()
local files = {}
if os.get() == "windows" then
local make = "nmake.exe -f makefile.vc clean SHARED=1 MONOLITHIC=1 DEBUG_INFO=1"
if not os.getenv("VCINSTALLDIR") then
print("VCINSTALLDIR is not detected in your environment")
os.exit(1)
end
os.chdir( "Dependencies/wxWidgets/build/msw" );
local result
if Helium.Build32Bit() then
result = os.execute( "cmd.exe /c \"call \"%VCINSTALLDIR%\"\\vcvarsall.bat x86 && " .. make .. " BUILD=debug UNICODE=1\"" )
if result ~= 0 then os.exit( 1 ) end
result = os.execute( "cmd.exe /c \"call \"%VCINSTALLDIR%\"\\vcvarsall.bat x86 && " .. make .. " BUILD=release UNICODE=1\"" )
if result ~= 0 then os.exit( 1 ) end
end
if Helium.Build64Bit() then
result = os.execute( "cmd.exe /c \"call \"%VCINSTALLDIR%\"\\vcvarsall.bat x86_amd64 && " .. make .. " TARGET_CPU=AMD64 BUILD=debug UNICODE=1\"" )
if result ~= 0 then os.exit( 1 ) end
result = os.execute( "cmd.exe /c \"call \"%VCINSTALLDIR%\"\\vcvarsall.bat x86_amd64 && " .. make .. " TARGET_CPU=AMD64 BUILD=release UNICODE=1\"" )
if result ~= 0 then os.exit( 1 ) end
end
elseif os.get() == "macosx" then
if Helium.Build32Bit() then
os.rmdir( "Dependencies/wxWidgets/macbuild-debug-32" )
os.rmdir( "Dependencies/wxWidgets/macbuild-release-32" )
os.rmdir( "Dependencies/wxWidgets/macbuild-debug-unicode-32" )
os.rmdir( "Dependencies/wxWidgets/macbuild-release-unicode-32" )
end
if Helium.Build64Bit() then
os.rmdir( "Dependencies/wxWidgets/macbuild-debug-64" )
os.rmdir( "Dependencies/wxWidgets/macbuild-release-64" )
os.rmdir( "Dependencies/wxWidgets/macbuild-debug-unicode-64" )
os.rmdir( "Dependencies/wxWidgets/macbuild-release-unicode-64" )
end
else
print("Implement support for " .. os.get() .. " to CleanWxWidgets()")
os.exit(1)
end
os.chdir( cwd )
end
Helium.PublishWxWidgets = function( bin )
local files = {}
if os.get() == "windows" then
if Helium.Build32Bit() then
table.insert( files, { file="wxmsw291ud_vc_custom.dll", source="Dependencies/wxWidgets/lib/vc_dll", target=bin .. "/x32/Debug" } )
table.insert( files, { file="wxmsw291ud_vc_custom.pdb", source="Dependencies/wxWidgets/lib/vc_dll", target=bin .. "/x32/Debug" } )
table.insert( files, { file="wxmsw291u_vc_custom.dll", source="Dependencies/wxWidgets/lib/vc_dll", target=bin .. "/x32/Intermediate" } )
table.insert( files, { file="wxmsw291u_vc_custom.pdb", source="Dependencies/wxWidgets/lib/vc_dll", target=bin .. "/x32/Intermediate" } )
table.insert( files, { file="wxmsw291u_vc_custom.dll", source="Dependencies/wxWidgets/lib/vc_dll", target=bin .. "/x32/Profile" } )
table.insert( files, { file="wxmsw291u_vc_custom.pdb", source="Dependencies/wxWidgets/lib/vc_dll", target=bin .. "/x32/Profile" } )
table.insert( files, { file="wxmsw291u_vc_custom.dll", source="Dependencies/wxWidgets/lib/vc_dll", target=bin .. "/x32/Release" } )
table.insert( files, { file="wxmsw291u_vc_custom.pdb", source="Dependencies/wxWidgets/lib/vc_dll", target=bin .. "/x32/Release" } )
end
if Helium.Build64Bit() then
table.insert( files, { file="wxmsw291ud_vc_custom.dll", source="Dependencies/wxWidgets/lib/vc_amd64_dll", target=bin .. "/x64/Debug" } )
table.insert( files, { file="wxmsw291ud_vc_custom.pdb", source="Dependencies/wxWidgets/lib/vc_amd64_dll", target=bin .. "/x64/Debug" } )
table.insert( files, { file="wxmsw291u_vc_custom.dll", source="Dependencies/wxWidgets/lib/vc_amd64_dll", target=bin .. "/x64/Intermediate" } )
table.insert( files, { file="wxmsw291u_vc_custom.pdb", source="Dependencies/wxWidgets/lib/vc_amd64_dll", target=bin .. "/x64/Intermediate" } )
table.insert( files, { file="wxmsw291u_vc_custom.dll", source="Dependencies/wxWidgets/lib/vc_amd64_dll", target=bin .. "/x64/Profile" } )
table.insert( files, { file="wxmsw291u_vc_custom.pdb", source="Dependencies/wxWidgets/lib/vc_amd64_dll", target=bin .. "/x64/Profile" } )
table.insert( files, { file="wxmsw291u_vc_custom.dll", source="Dependencies/wxWidgets/lib/vc_amd64_dll", target=bin .. "/x64/Release" } )
table.insert( files, { file="wxmsw291u_vc_custom.pdb", source="Dependencies/wxWidgets/lib/vc_amd64_dll", target=bin .. "/x64/Release" } )
end
elseif os.get() == "macosx" then
if Helium.Build32Bit() then
table.insert( files, { file="libwx_osx_cocoau-2.9.1.0.0.dylib", source="Dependencies/wxWidgets/macbuild-debug-unicode-32/lib", target=bin .. "/x32/Debug" } )
table.insert( files, { file="libwx_osx_cocoau_gl-2.9.1.0.0.dylib", source="Dependencies/wxWidgets/macbuild-debug-unicode-32/lib", target=bin .. "/x32/Debug" } )
table.insert( files, { file="libwx_osx_cocoau-2.9.1.0.0.dylib", source="Dependencies/wxWidgets/macbuild-release-unicode-32/lib", target=bin .. "/x32/Intermediate" } )
table.insert( files, { file="libwx_osx_cocoau_gl-2.9.1.0.0.dylib", source="Dependencies/wxWidgets/macbuild-release-unicode-32/lib", target=bin .. "/x32/Intermediate" } )
table.insert( files, { file="libwx_osx_cocoau-2.9.1.0.0.dylib", source="Dependencies/wxWidgets/macbuild-release-unicode-32/lib", target=bin .. "/x32/Profile" } )
table.insert( files, { file="libwx_osx_cocoau_gl-2.9.1.0.0.dylib", source="Dependencies/wxWidgets/macbuild-release-unicode-32/lib", target=bin .. "/x32/Profile" } )
table.insert( files, { file="libwx_osx_cocoau-2.9.1.0.0.dylib", source="Dependencies/wxWidgets/macbuild-release-unicode-32/lib", target=bin .. "/x32/Release" } )
table.insert( files, { file="libwx_osx_cocoau_gl-2.9.1.0.0.dylib", source="Dependencies/wxWidgets/macbuild-release-unicode-32/lib", target=bin .. "/x32/Release" } )
end
if Helium.Build64Bit() then
table.insert( files, { file="libwx_osx_cocoau-2.9.1.0.0.dylib", source="Dependencies/wxWidgets/macbuild-debug-unicode-64/lib", target=bin .. "/x64/Debug" } )
table.insert( files, { file="libwx_osx_cocoau_gl-2.9.1.0.0.dylib", source="Dependencies/wxWidgets/macbuild-debug-unicode-64/lib", target=bin .. "/x64/Debug" } )
table.insert( files, { file="libwx_osx_cocoau-2.9.1.0.0.dylib", source="Dependencies/wxWidgets/macbuild-release-unicode-64/lib", target=bin .. "/x64/Intermediate" } )
table.insert( files, { file="libwx_osx_cocoau_gl-2.9.1.0.0.dylib", source="Dependencies/wxWidgets/macbuild-release-unicode-64/lib", target=bin .. "/x64/Intermediate" } )
table.insert( files, { file="libwx_osx_cocoau-2.9.1.0.0.dylib", source="Dependencies/wxWidgets/macbuild-release-unicode-64/lib", target=bin .. "/x64/Profile" } )
table.insert( files, { file="libwx_osx_cocoau_gl-2.9.1.0.0.dylib", source="Dependencies/wxWidgets/macbuild-release-unicode-64/lib", target=bin .. "/x64/Profile" } )
table.insert( files, { file="libwx_osx_cocoau-2.9.1.0.0.dylib", source="Dependencies/wxWidgets/macbuild-release-unicode-64/lib", target=bin .. "/x64/Release" } )
table.insert( files, { file="libwx_osx_cocoau_gl-2.9.1.0.0.dylib", source="Dependencies/wxWidgets/macbuild-release-unicode-64/lib", target=bin .. "/x64/Release" } )
end
else
print("Implement support for " .. os.get() .. " to PublishWxWidgets()")
os.exit(1)
end
Helium.Publish( files )
end