CMake isn't the only one doing that.
sub is_non_verbose_build {
my ($line, $next_line, $cc_regex, $skip_ref) = @_;
- my $cmake_non_verbose = qr/^\s*\[[\d ]+%\] Building (?:C|CXX) object (.+?)$/;
if (not ($line =~ /^checking if you want to see long compiling messages\.\.\. no/
- or $line =~ /^\s*(?:CC|CCLD)\s+/
- or $line =~ /^\s*(?:C|c)ompiling\s+/
- or $line =~ /$cmake_non_verbose/)) {
+ or $line =~ /^\s*(?:CC|CCLD)\s+(.+?)$/
+ or $line =~ /^\s*(?:C|c)ompiling\s+(.+?)$/
+ or $line =~ /^\s*(?:B|b)uilding (?:program|shared library)\s+(.+?)$/
+ or $line =~ /^\s*\[[\d ]+%\] Building (?:C|CXX) object (.+?)$/)) {
return 0;
}
+ my $file = $1;
+
# On the first pass we only check if this line is verbose or not.
return 1 if not defined $next_line;
# Second pass, we have access to the next line.
${$skip_ref} = 0;
- # CMake prints the non-verbose messages also when building verbose. If a
- # compiler and the file name occurs in the next line, treat it as verbose
- # build.
- if ($line =~ /$cmake_non_verbose/) {
+ # CMake and other build systems print the non-verbose messages also when
+ # building verbose. If a compiler and the file name occurs in the next
+ # line, treat it as verbose build.
+ if (defined $file) {
# Get filename, we can't use the complete path as only parts of it are
- # used in the real compiler command ...
- $1 =~ m{/([a-zA-Z0-9._-]+)$};
- my $file = $1;
+ # used in the real compiler command.
+ $file =~ m{/([a-zA-Z0-9._-]+)$};
+ $file = $1;
if ($next_line =~ /\Q$file\E/ and $next_line =~ /$cc_regex/) {
# We still have to skip the current line as it doesn't contain any
Byte-compiling python modules...
Byte-compiling python modules (optimized versions) ...
-Compiling test/test.cc to ../build/test/test.cc
+# Non verbose.
+Compiling test/test.cc to ../build/test/test.o
+Building shared library ../build/test/libtest.so.1.2.3
+Compiling test.cc to ../build/test/test.o
+Building program ../build/bin/test
+# Verbose ...
+Compiling test/test.cc to ../build/test/test.o
+g++ -c -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -o ../build/test/test.o test/test.cc
+Building shared library ../build/test/libtest.so.1.2.3
+g++ -fPIC -DPIC \
+ -o ../build/test/libtest.so.1.2.3 -shared \
+ ../build/obj/test/test-a.o ../build/obj/test/test-b.o ../build/obj/test/test-c.o
+Compiling test.cc to ../build/test/test.o
+g++ -c -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat-security -Werror=format-security -o ../build/test/test.o test.cc
+Building program ../build/bin/test
+g++ ../build/obj/test/test.o -o /../build/bin/test
# Non verbose.
[ 22%] Building CXX object src/CMakeFiles/test/test.cpp.o
[ 82%] Building C object src/CMakeFiles/test/test.c.o
# Verbose ...
[ 45%] Building CXX object src/CMakeFiles/test-verbose.dir/verbose.cpp.o
-cd /tmp/test/src && /usr/bin/c++ -g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -o CMakeFiles/test-verbose.dir/verbose.cpp.o -c -D_FORTIFY_SOURCE=2 /tmp/test/src/test-verbose/verbose.cpp
+cd /tmp/test/src && /usr/bin/c++ -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat-security -Werror=format-security -o CMakeFiles/test-verbose.dir/verbose.cpp.o -c -D_FORTIFY_SOURCE=2 /tmp/test/src/test-verbose/verbose.cpp
[ 83%] Building C object src/CMakeFiles/test-verbose-c.dir/verbose-c.c.o
-cd /tmp/test/src && /usr/bin/gcc -g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -o CMakeFiles/test-verbose-c.dir/verbose-c.c.o -c -D_FORTIFY_SOURCE=2 /tmp/test/src/test-verbose-c/verbose-c.c
+cd /tmp/test/src && /usr/bin/gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -o CMakeFiles/test-verbose-c.dir/verbose-c.c.o -c -D_FORTIFY_SOURCE=2 /tmp/test/src/test-verbose-c/verbose-c.c
# check the build log is verbose
-is_blhc 'verbose-build', '', 4,
+is_blhc 'verbose-build', '', 12,
'NONVERBOSE BUILD: checking if you want to see long compiling messages... no
NONVERBOSE BUILD: CC libtest-a.lo
NONVERBOSE BUILD: CC libtest-b.lo
NONVERBOSE BUILD: CC libtest-d.lo
NONVERBOSE BUILD: CCLD libtest.la
NONVERBOSE BUILD: CC modules/server/test.c
-NONVERBOSE BUILD: Compiling test/test.cc to ../build/test/test.cc
+NONVERBOSE BUILD: Compiling test/test.cc to ../build/test/test.o
+NONVERBOSE BUILD: Building shared library ../build/test/libtest.so.1.2.3
+NONVERBOSE BUILD: Compiling test.cc to ../build/test/test.o
+NONVERBOSE BUILD: Building program ../build/bin/test
+CPPFLAGS missing (-D_FORTIFY_SOURCE=2): g++ -c -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -o ../build/test/test.o test/test.cc
+LDFLAGS missing (-Wl,-z,relro): g++ -fPIC -DPIC \ -o ../build/test/libtest.so.1.2.3 -shared \ ../build/obj/test/test-a.o ../build/obj/test/test-b.o ../build/obj/test/test-c.o
+CFLAGS missing (-Wformat): g++ -c -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat-security -Werror=format-security -o ../build/test/test.o test.cc
+CPPFLAGS missing (-D_FORTIFY_SOURCE=2): g++ -c -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat-security -Werror=format-security -o ../build/test/test.o test.cc
+LDFLAGS missing (-Wl,-z,relro): g++ ../build/obj/test/test.o -o /../build/bin/test
NONVERBOSE BUILD: [ 22%] Building CXX object src/CMakeFiles/test/test.cpp.o
NONVERBOSE BUILD: [ 82%] Building C object src/CMakeFiles/test/test.c.o
+CFLAGS missing (-Wformat): cd /tmp/test/src && /usr/bin/c++ -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat-security -Werror=format-security -o CMakeFiles/test-verbose.dir/verbose.cpp.o -c -D_FORTIFY_SOURCE=2 /tmp/test/src/test-verbose/verbose.cpp
+CFLAGS missing (-Werror=format-security): cd /tmp/test/src && /usr/bin/gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -o CMakeFiles/test-verbose-c.dir/verbose-c.c.o -c -D_FORTIFY_SOURCE=2 /tmp/test/src/test-verbose-c/verbose-c.c
';