Fossil SCM

Replace --no-compile-commands configure flag with --compile-commands. i.e. make the feature explicitly opt-in, as the automatic guess is breaking builds on some platforms.

stephan 2023-07-08 18:08 trunk
Commit fb116a206e04e64f75b0e3501db052a7983800ab2a1502086171d323fb1e9164
3 files changed +1 +25 -27 +1
--- Makefile.in
+++ Makefile.in
@@ -169,5 +169,6 @@
169169
container-stop:
170170
$(CENGINE) stop $(CNTVER)
171171
172172
container-version:
173173
@echo $(CNTVER)
174
+#
174175
--- Makefile.in
+++ Makefile.in
@@ -169,5 +169,6 @@
169 container-stop:
170 $(CENGINE) stop $(CNTVER)
171
172 container-version:
173 @echo $(CNTVER)
 
174
--- Makefile.in
+++ Makefile.in
@@ -169,5 +169,6 @@
169 container-stop:
170 $(CENGINE) stop $(CNTVER)
171
172 container-version:
173 @echo $(CNTVER)
174 #
175
+25 -27
--- auto.def
+++ auto.def
@@ -29,12 +29,12 @@
2929
fusefs=1 => {Disable the Fuse Filesystem}
3030
fossil-debug=0 => {Build with fossil debugging enabled}
3131
no-opt=0 => {Build without optimization}
3232
json=0 => {Build with fossil JSON API enabled}
3333
with-emsdk:path => {Directory containing the Emscripten SDK}
34
- no-compile-commands=0 =>
35
- "Disable compile_commands.json support even if detected (possibly incorrectly)."
34
+ compile-commands=0 =>
35
+ "Check for compile_commands.json support."
3636
}
3737
3838
# Update the minimum required SQLite version number here, and also
3939
# in src/main.c near the sqlite3_libversion_number() call. Take care
4040
# that both places agree!
@@ -745,35 +745,33 @@
745745
# argument it is assumed to be the name of an autosetup boolean config
746746
# option to explicitly DISABLE the compile_commands.json support.
747747
#
748748
# Returns 1 if supported, else 0. Defines MAKE_COMPILATION_DB to "yes"
749749
# if supported, "no" if not.
750
-proc check-compile-commands {{configOpt no-compile-commands}} {
751
- msg-checking "compile_commands.json support... "
752
- if {"" ne $configOpt && [opt-bool $configOpt]} {
753
- msg-result "explicitly disabled"
754
- define MAKE_COMPILATION_DB no
755
- return 0
756
- } else {
757
- if {[cctest -lang c -cflags {/dev/null -MJ} -source {}]} {
758
- # This test reportedly incorrectly succeeds on one of
759
- # Martin G.'s older systems.
760
- msg-result "compiler supports compile_commands.json"
761
- define MAKE_COMPILATION_DB yes
762
- return 1
763
- } else {
764
- msg-result "compiler does not support compile_commands.json"
765
- define MAKE_COMPILATION_DB no
766
- return 0
767
- }
768
- }
769
-}
770
-
771
-if {!$outOfTreeBuild} {
772
- check-compile-commands
773
-} else {
774
- define MAKE_COMPILATION_DB no
750
+proc check-compile-commands {} {
751
+ msg-checking "compile_commands.json support... "
752
+ if {[cctest -lang c -cflags {/dev/null -MJ} -source {}]} {
753
+ # This test reportedly incorrectly succeeds on one of
754
+ # Martin G.'s older systems.
755
+ msg-result "compiler supports compile_commands.json"
756
+ define MAKE_COMPILATION_DB yes
757
+ return 1
758
+ } else {
759
+ msg-result "compiler does not support compile_commands.json"
760
+ define MAKE_COMPILATION_DB no
761
+ return 0
762
+ }
763
+}
764
+
765
+define MAKE_COMPILATION_DB no
766
+if {!$outOfTreeBuild} {
767
+ if {[opt-bool compile-commands]} {
768
+ check-compile-commands
769
+ } else {
770
+ puts "Skipping check for compile-commands-capable compiler."
771
+ }
772
+} else {
775773
puts "Disabling compile_commands.json check for out-of-tree build."
776774
# This is an attempt to resolve the problem reported at
777775
# https://fossil-scm.org/forum/forumpost/d19061d09a8179d0
778776
}
779777
780778
--- auto.def
+++ auto.def
@@ -29,12 +29,12 @@
29 fusefs=1 => {Disable the Fuse Filesystem}
30 fossil-debug=0 => {Build with fossil debugging enabled}
31 no-opt=0 => {Build without optimization}
32 json=0 => {Build with fossil JSON API enabled}
33 with-emsdk:path => {Directory containing the Emscripten SDK}
34 no-compile-commands=0 =>
35 "Disable compile_commands.json support even if detected (possibly incorrectly)."
36 }
37
38 # Update the minimum required SQLite version number here, and also
39 # in src/main.c near the sqlite3_libversion_number() call. Take care
40 # that both places agree!
@@ -745,35 +745,33 @@
745 # argument it is assumed to be the name of an autosetup boolean config
746 # option to explicitly DISABLE the compile_commands.json support.
747 #
748 # Returns 1 if supported, else 0. Defines MAKE_COMPILATION_DB to "yes"
749 # if supported, "no" if not.
750 proc check-compile-commands {{configOpt no-compile-commands}} {
751 msg-checking "compile_commands.json support... "
752 if {"" ne $configOpt && [opt-bool $configOpt]} {
753 msg-result "explicitly disabled"
754 define MAKE_COMPILATION_DB no
755 return 0
756 } else {
757 if {[cctest -lang c -cflags {/dev/null -MJ} -source {}]} {
758 # This test reportedly incorrectly succeeds on one of
759 # Martin G.'s older systems.
760 msg-result "compiler supports compile_commands.json"
761 define MAKE_COMPILATION_DB yes
762 return 1
763 } else {
764 msg-result "compiler does not support compile_commands.json"
765 define MAKE_COMPILATION_DB no
766 return 0
767 }
768 }
769 }
770
771 if {!$outOfTreeBuild} {
772 check-compile-commands
773 } else {
774 define MAKE_COMPILATION_DB no
775 puts "Disabling compile_commands.json check for out-of-tree build."
776 # This is an attempt to resolve the problem reported at
777 # https://fossil-scm.org/forum/forumpost/d19061d09a8179d0
778 }
779
780
--- auto.def
+++ auto.def
@@ -29,12 +29,12 @@
29 fusefs=1 => {Disable the Fuse Filesystem}
30 fossil-debug=0 => {Build with fossil debugging enabled}
31 no-opt=0 => {Build without optimization}
32 json=0 => {Build with fossil JSON API enabled}
33 with-emsdk:path => {Directory containing the Emscripten SDK}
34 compile-commands=0 =>
35 "Check for compile_commands.json support."
36 }
37
38 # Update the minimum required SQLite version number here, and also
39 # in src/main.c near the sqlite3_libversion_number() call. Take care
40 # that both places agree!
@@ -745,35 +745,33 @@
745 # argument it is assumed to be the name of an autosetup boolean config
746 # option to explicitly DISABLE the compile_commands.json support.
747 #
748 # Returns 1 if supported, else 0. Defines MAKE_COMPILATION_DB to "yes"
749 # if supported, "no" if not.
750 proc check-compile-commands {} {
751 msg-checking "compile_commands.json support... "
752 if {[cctest -lang c -cflags {/dev/null -MJ} -source {}]} {
753 # This test reportedly incorrectly succeeds on one of
754 # Martin G.'s older systems.
755 msg-result "compiler supports compile_commands.json"
756 define MAKE_COMPILATION_DB yes
757 return 1
758 } else {
759 msg-result "compiler does not support compile_commands.json"
760 define MAKE_COMPILATION_DB no
761 return 0
762 }
763 }
764
765 define MAKE_COMPILATION_DB no
766 if {!$outOfTreeBuild} {
767 if {[opt-bool compile-commands]} {
768 check-compile-commands
769 } else {
770 puts "Skipping check for compile-commands-capable compiler."
771 }
772 } else {
 
 
773 puts "Disabling compile_commands.json check for out-of-tree build."
774 # This is an attempt to resolve the problem reported at
775 # https://fossil-scm.org/forum/forumpost/d19061d09a8179d0
776 }
777
778
--- src/main.mk
+++ src/main.mk
@@ -2174,5 +2174,6 @@
21742174
#
21752175
21762176
.PHONY: all install test clean
21772177
.PHONY: compile-commands-clean compile-commands-dir
21782178
2179
+#
21792180
--- src/main.mk
+++ src/main.mk
@@ -2174,5 +2174,6 @@
2174 #
2175
2176 .PHONY: all install test clean
2177 .PHONY: compile-commands-clean compile-commands-dir
2178
 
2179
--- src/main.mk
+++ src/main.mk
@@ -2174,5 +2174,6 @@
2174 #
2175
2176 .PHONY: all install test clean
2177 .PHONY: compile-commands-clean compile-commands-dir
2178
2179 #
2180

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button