@@ -2,6 +2,7 @@ require "Build"
2
2
require " Utils"
3
3
require " ../Helpers"
4
4
5
+ local basedir = path .getdirectory (_PREMAKE_COMMAND )
5
6
local llvm = path .getabsolute (basedir .. " /../deps/llvm" )
6
7
7
8
-- Prevent premake from inserting /usr/lib64 search path on linux. GCC does not need this path specified
@@ -112,15 +113,19 @@ function get_llvm_package_name(rev, conf, arch)
112
113
local toolset = get_toolset_configuration_name (arch )
113
114
table.insert (components , toolset )
114
115
115
- if os .istarget (" linux" ) then
116
- local version = GccVersion ()
117
- if version < " 5.0.0" then
118
- -- Minor version matters only with gcc 4.8/4.9
119
- version = string.match (version , " %d+.%d+" )
120
- else
121
- version = string.match (version , " %d+" )
122
- end
123
- table.insert (components , " gcc-" .. version )
116
+ if os .istarget (" linux" ) then
117
+ if UseClang () then
118
+ table.insert (components , " clang" )
119
+ else
120
+ local version = GccVersion ()
121
+ if version < " 5.0.0" then
122
+ -- Minor version matters only with gcc 4.8/4.9
123
+ version = string.match (version , " %d+.%d+" )
124
+ else
125
+ version = string.match (version , " %d+" )
126
+ end
127
+ table.insert (components , " gcc-" .. version )
128
+ end
124
129
end
125
130
126
131
if not conf then
@@ -129,12 +134,6 @@ function get_llvm_package_name(rev, conf, arch)
129
134
130
135
table.insert (components , conf )
131
136
132
- if os .istarget (" linux" ) then
133
- if GccVersion () >= " 4.9.0" and not UseCxx11ABI () then
134
- table.insert (components , " no-cxx11" )
135
- end
136
- end
137
-
138
137
return table.concat (components , " -" )
139
138
end
140
139
@@ -216,24 +215,24 @@ function cmake(gen, conf, builddir, options)
216
215
if options == nil then
217
216
options = " "
218
217
end
219
- if not UseCxx11ABI () then
220
- options = options .. " -DCMAKE_CXX_FLAGS='-D_GLIBCXX_USE_CXX11_ABI=0'"
218
+
219
+ if UseClang () then
220
+ local cmake = path .join (basedir , " scripts" , " ClangToolset.cmake" )
221
+ options = options .. " -DLLVM_USE_LINKER=/usr/bin/ld.lld"
221
222
end
222
223
223
224
local cmd = cmake .. " -G " .. ' "' .. gen .. ' "'
224
225
.. ' -DCLANG_BUILD_TOOLS=false'
225
- .. ' -DCLANG_INSTALL_SCANBUILD=false'
226
- .. ' -DCLANG_INSTALL_SCANVIEW=false'
227
226
.. ' -DCLANG_TOOL_CLANG_DIFF_BUILD=false'
228
227
.. ' -DCLANG_TOOL_CLANG_FUNC_MAPPING_BUILD=false'
229
228
.. ' -DCLANG_TOOL_CLANG_IMPORT_TEST_BUILD=false'
230
229
.. ' -DCLANG_TOOL_CLANG_OFFLOAD_BUNDLER_BUILD=false'
231
230
.. ' -DCLANG_TOOL_CLANG_REFACTOR_BUILD=false'
232
231
.. ' -DCLANG_TOOL_CLANG_RENAME_BUILD=false'
233
232
.. ' -DCLANG_TOOL_DRIVER_BUILD=false'
234
- .. ' -DCLANG_TOOL_HANDLE_CXX_BUILD =false'
235
- .. ' -DCLANG_TOOL_HANDLE_LLVM_BUILD=false '
236
- .. ' -DLLVM_BUILD_TOOLS=false '
233
+ .. ' -DLLVM_BUILD_TOOLS =false'
234
+ .. ' -DLLVM_ENABLE_DUMP=true '
235
+ .. ' -DLLVM_ENABLE_DUMP=true '
237
236
.. ' -DLLVM_ENABLE_LIBEDIT=false'
238
237
.. ' -DLLVM_ENABLE_ZLIB=false'
239
238
.. ' -DLLVM_ENABLE_TERMINFO=false'
@@ -278,20 +277,17 @@ function cmake(gen, conf, builddir, options)
278
277
.. ' -DLLVM_TOOL_LLVM_LINK_BUILD=false'
279
278
.. ' -DLLVM_TOOL_LLVM_LTO_BUILD=false'
280
279
.. ' -DLLVM_TOOL_LLVM_LTO2_BUILD=false'
281
- .. ' -DLLVM_TOOL_LLVM_MCMARKUP_BUILD=false'
282
280
.. ' -DLLVM_TOOL_LLVM_MC_ASSEMBLE_FUZZER_BUILD=false'
283
281
.. ' -DLLVM_TOOL_LLVM_MC_BUILD=false'
284
282
.. ' -DLLVM_TOOL_LLVM_MC_DISASSEMBLE_FUZZER_BUILD=false'
285
283
.. ' -DLLVM_TOOL_LLVM_MCA_BUILD=false'
286
- .. ' -DLLVM_TOOL_LLVM_MC_FUZZER_BUILD=false'
287
284
.. ' -DLLVM_TOOL_LLVM_MODEXTRACT_BUILD=false'
288
285
.. ' -DLLVM_TOOL_LLVM_MT_BUILD=false'
289
286
.. ' -DLLVM_TOOL_LLVM_NM_BUILD=false'
290
287
.. ' -DLLVM_TOOL_LLVM_OBJCOPY_BUILD=false'
291
288
.. ' -DLLVM_TOOL_LLVM_OBJDUMP_BUILD=false'
292
289
.. ' -DLLVM_TOOL_LLVM_OPT_FUZZER_BUILD=false'
293
290
.. ' -DLLVM_TOOL_LLVM_OPT_REPORT_BUILD=false'
294
- .. ' -DLLVM_TOOL_LLVM_PDBDUMP_BUILD=false'
295
291
.. ' -DLLVM_TOOL_LLVM_PDBUTIL_BUILD=false'
296
292
.. ' -DLLVM_TOOL_LLVM_PROFDATA_BUILD=false'
297
293
.. ' -DLLVM_TOOL_LLVM_PDBUTIL_BUILD=false'
@@ -308,7 +304,6 @@ function cmake(gen, conf, builddir, options)
308
304
.. ' -DLLVM_TOOL_LLVM_UNDNAME_BUILD=false'
309
305
.. ' -DLLVM_TOOL_LLVM_XRAY_BUILD=false'
310
306
.. ' -DLLVM_TOOL_LTO_BUILD=false'
311
- .. ' -DLLVM_TOOL_MSBUILD_BUILD=false'
312
307
.. ' -DLLVM_TOOL_OBJ2YAML_BUILD=false'
313
308
.. ' -DLLVM_TOOL_OPT_BUILD=false'
314
309
.. ' -DLLVM_TOOL_OPT_VIEWER_BUILD=false'
0 commit comments