specify `-pipe` for GCC to use pipes instead of temporary files - greatly reduces I/O usage (#4360)

This commit is contained in:
Oliver Stöneberg 2022-08-16 22:12:01 +02:00 committed by GitHub
parent 3dc2c0bd42
commit 32c0167eab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 2 deletions

View File

@ -102,7 +102,7 @@ ifndef CXXFLAGS
endif
ifeq (g++, $(findstring g++,$(CXX)))
override CXXFLAGS += -std=gnu++0x
override CXXFLAGS += -std=gnu++0x -pipe
else ifeq (clang++, $(findstring clang++,$(CXX)))
override CXXFLAGS += -std=c++0x
else ifeq ($(CXX), c++)

View File

@ -46,6 +46,9 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# use pipes instead of temporary files - greatly reduces I/O usage
add_compile_options(-pipe)
add_compile_options(-Woverloaded-virtual) # when a function declaration hides virtual functions from a base class
add_compile_options(-Wno-maybe-uninitialized) # there are some false positives
add_compile_options(-Wsuggest-attribute=noreturn)

View File

@ -374,7 +374,7 @@ int main(int argc, char **argv)
}
fout << "ifeq (g++, $(findstring g++,$(CXX)))\n"
<< " override CXXFLAGS += -std=gnu++0x\n"
<< " override CXXFLAGS += -std=gnu++0x -pipe\n"
<< "else ifeq (clang++, $(findstring clang++,$(CXX)))\n"
<< " override CXXFLAGS += -std=c++0x\n"
<< "else ifeq ($(CXX), c++)\n"