From 32c0167eab25a955caa4e46a6466288db3d6a61c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6neberg?= Date: Tue, 16 Aug 2022 22:12:01 +0200 Subject: [PATCH] specify `-pipe` for GCC to use pipes instead of temporary files - greatly reduces I/O usage (#4360) --- Makefile | 2 +- cmake/compileroptions.cmake | 3 +++ tools/dmake.cpp | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 6cae34dbb..903439e4c 100644 --- a/Makefile +++ b/Makefile @@ -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++) diff --git a/cmake/compileroptions.cmake b/cmake/compileroptions.cmake index aac8eb2ea..ddb16bd00 100644 --- a/cmake/compileroptions.cmake +++ b/cmake/compileroptions.cmake @@ -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) diff --git a/tools/dmake.cpp b/tools/dmake.cpp index e3932cc0f..218e5e8e6 100644 --- a/tools/dmake.cpp +++ b/tools/dmake.cpp @@ -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"