2
2
-- known working version
3
3
-- https://github.com/bkaradzic/bx/blob/51f25ba638b9cb35eb2ac078f842a4bed0746d56/tools/bin/windows/genie.exe
4
4
5
+ MINGW_ACTION = ' gmake'
6
+
5
7
if _ACTION == ' clean' then
6
8
os .rmdir (' ./build' )
7
9
os .rmdir (' ./bin' )
8
10
os .rmdir (' ./obj_vs' )
9
- os .rmdir (' ./obj_ninja ' )
11
+ os .rmdir (' ./obj_ ' .. MINGW_ACTION )
10
12
end
11
13
12
- if _ACTION == ' ninja ' then
14
+ if _ACTION == MINGW_ACTION then
13
15
-- need a msys2 with clang
14
- premake .gcc .cc = ' C:/msys64/mingw64/bin/ clang'
15
- premake .gcc .cxx = ' C:/msys64/mingw64/bin/ clang++'
16
- premake .gcc .ar = ' C:/msys64/mingw64/bin/ llvm-ar'
16
+ premake .gcc .cc = ' clang'
17
+ premake .gcc .cxx = ' clang++'
18
+ premake .gcc .ar = ' llvm-ar'
17
19
premake .llvm = true
18
20
end
19
21
@@ -38,7 +40,7 @@ solution('clumsy')
38
40
links ({' WinDivert' , ' iup' , ' comctl32' , ' Winmm' , ' ws2_32' })
39
41
if string.match (_ACTION , ' ^vs' ) then -- only vs can include rc file in solution
40
42
files ({' ./etc/clumsy.rc' })
41
- elseif _ACTION == ' ninja ' then
43
+ elseif _ACTION == MINGW_ACTION then
42
44
files ({' ./etc/clumsy.rc' })
43
45
end
44
46
@@ -53,11 +55,13 @@ solution('clumsy')
53
55
defines ({' NDEBUG' })
54
56
kind (" WindowedApp" )
55
57
56
- configuration (" ninja " )
58
+ configuration (MINGW_ACTION )
57
59
links ({' kernel32' , ' gdi32' , ' comdlg32' , ' uuid' , ' ole32' }) -- additional libs
58
- buildoptions ({' -Wno-missing-braces' , ' --std=c99' }) -- suppress a bug in gcc warns about {0} initialization
59
- -- linkoptions({'--std=c90'})
60
- -- notice that tdm-gcc use static runtime by default
60
+ buildoptions ({
61
+ ' -Wno-missing-braces' ,
62
+ ' -Wno-missing-field-initializers' ,
63
+ ' --std=c99'
64
+ })
61
65
objdir (' obj_ninja' )
62
66
63
67
configuration (" vs*" )
@@ -88,7 +92,7 @@ solution('clumsy')
88
92
LIB_IUP_WIN64_VC11 .. ' '
89
93
})
90
94
91
- configuration ({' x32' , ' ninja ' })
95
+ configuration ({' x32' , MINGW_ACTION })
92
96
defines ({' X32' }) -- defines would be passed to resource compiler for whatever reason
93
97
includedirs ({LIB_DIVERT_MINGW .. ' /include' ,
94
98
LIB_IUP_WIN32_MINGW .. ' /include' })
@@ -98,7 +102,7 @@ solution('clumsy')
98
102
})
99
103
resoptions ({' -O coff' , ' -F pe-i386' }) -- mingw64 defaults to x64
100
104
101
- configuration ({' x64' , ' ninja ' })
105
+ configuration ({' x64' , MINGW_ACTION })
102
106
defines ({' X64' })
103
107
includedirs ({LIB_DIVERT_MINGW .. ' /include' ,
104
108
LIB_IUP_WIN64_MINGW .. ' /include' })
@@ -124,7 +128,7 @@ solution('clumsy')
124
128
divert_lib = ROOT .. ' /' .. LIB_DIVERT_VC11 .. ' /x86/'
125
129
iup_lib = ROOT .. ' /' .. LIB_IUP_WIN32_VC11 .. ' '
126
130
end
127
- elseif platform == ' ninja ' then
131
+ elseif platform == MINGW_ACTION then
128
132
if arch == ' x64' then
129
133
divert_lib = ROOT .. ' /' .. LIB_DIVERT_MINGW .. ' /x64/'
130
134
iup_lib = ROOT .. ' /' .. LIB_IUP_WIN64_MINGW .. ' '
@@ -143,7 +147,7 @@ solution('clumsy')
143
147
" robocopy " .. ROOT .. " /etc/ " .. subdir .. ' config.txt >> robolog.txt' ,
144
148
" exit /B 0"
145
149
})
146
- elseif platform == ' ninja ' then
150
+ elseif platform == MINGW_ACTION then
147
151
postbuildcommands ({
148
152
-- robocopy returns non 0 will fail make
149
153
' cp ' .. divert_lib .. " WinDivert* " .. subdir ,
@@ -156,8 +160,8 @@ solution('clumsy')
156
160
set_bin (' vs*' , ' Debug' , " x64" )
157
161
set_bin (' vs*' , ' Release' , " x32" )
158
162
set_bin (' vs*' , ' Release' , " x64" )
159
- set_bin (' ninja ' , ' Debug' , " x32" )
160
- set_bin (' ninja ' , ' Debug' , " x64" )
161
- set_bin (' ninja ' , ' Release' , " x32" )
162
- set_bin (' ninja ' , ' Release' , " x64" )
163
+ set_bin (MINGW_ACTION , ' Debug' , " x32" )
164
+ set_bin (MINGW_ACTION , ' Debug' , " x64" )
165
+ set_bin (MINGW_ACTION , ' Release' , " x32" )
166
+ set_bin (MINGW_ACTION , ' Release' , " x64" )
163
167
0 commit comments