File tree 3 files changed +25
-3
lines changed
3 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -612,6 +612,7 @@ opt rustbuild 0 "use the rust and cargo based build system"
612
612
opt orbit 0 " get MIR where it belongs - everywhere; most importantly, in orbit"
613
613
opt codegen-tests 1 " run the src/test/codegen tests"
614
614
opt option-checking 1 " complain about unrecognized options in this configure script"
615
+ opt ninja 0 " build LLVM using the Ninja generator (for MSVC, requires building in the correct environment)"
615
616
616
617
# Optimization and debugging options. These may be overridden by the release channel, etc.
617
618
opt_nosave optimize 1 " build optimized rust code"
@@ -775,6 +776,17 @@ probe CFG_BISON bison
775
776
probe CFG_GDB gdb
776
777
probe CFG_LLDB lldb
777
778
779
+ if [ -n " $CFG_ENABLE_NINJA " ]
780
+ then
781
+ probe CFG_NINJA ninja
782
+ if [ -z " $CFG_NINJA " ]
783
+ then
784
+ # On Debian and Fedora, the `ninja` binary is an IRC bot, so the build tool was
785
+ # renamed. Handle this case.
786
+ probe CFG_NINJA ninja-build
787
+ fi
788
+ fi
789
+
778
790
# For building LLVM
779
791
probe_need CFG_CMAKE cmake
780
792
@@ -1524,7 +1536,10 @@ do
1524
1536
fi
1525
1537
1526
1538
# We need the generator later on for compiler-rt even if LLVM's not built
1527
- if [ ${is_msvc} -ne 0 ]
1539
+ if [ -n " $CFG_NINJA " ]
1540
+ then
1541
+ generator=" Ninja"
1542
+ elif [ ${is_msvc} -ne 0 ]
1528
1543
then
1529
1544
case " $CFG_MSVC_ROOT " in
1530
1545
* 14.0* )
Original file line number Diff line number Diff line change @@ -43,15 +43,21 @@ $$(LLVM_CONFIG_$(1)): $$(LLVM_DONE_$(1))
43
43
44
44
$$(LLVM_DONE_$(1 ) ) : $$(LLVM_DEPS_TARGET_$(1 ) ) $$(LLVM_STAMP_$(1 ) )
45
45
@$$(call E, cmake: llvm)
46
- ifeq ($$(findstring msvc,$(1 ) ) ,msvc)
46
+ ifneq ($$(CFG_NINJA ) ,)
47
+ $$(Q)$$(CFG_NINJA) -C $$(CFG_LLVM_BUILD_DIR_$(1))
48
+ else ifeq ($$(findstring msvc,$(1)),msvc)
47
49
$$(Q)$$(CFG_CMAKE) --build $$(CFG_LLVM_BUILD_DIR_$(1)) \
48
50
--config $$(LLVM_BUILD_CONFIG_MODE)
49
51
else
50
52
$$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1))
51
53
endif
52
54
$$(Q)touch $$@
53
55
54
- ifeq ($$(findstring msvc,$(1 ) ) ,msvc)
56
+ ifneq ($$(CFG_NINJA ) ,)
57
+ clean-llvm$(1 ) :
58
+ @$$(call E, clean: llvm)
59
+ $$(Q )$$(CFG_NINJA ) -C $$(CFG_LLVM_BUILD_DIR_$(1 ) ) -t clean
60
+ else ifeq ($$(findstring msvc,$(1)),msvc)
55
61
clean-llvm$(1 ) :
56
62
else
57
63
clean-llvm$(1 ) :
Original file line number Diff line number Diff line change @@ -317,6 +317,7 @@ impl Config {
317
317
( "OPTIMIZE_TESTS" , self . rust_optimize_tests) ,
318
318
( "DEBUGINFO_TESTS" , self . rust_debuginfo_tests) ,
319
319
( "LOCAL_REBUILD" , self . local_rebuild) ,
320
+ ( "NINJA" , self . ninja) ,
320
321
}
321
322
322
323
match key {
You can’t perform that action at this time.
0 commit comments