From a155d0e531926402b7dbfa5b1bc8fa77f825cf34 Mon Sep 17 00:00:00 2001 From: Christian Prochaska Date: Wed, 16 Jan 2019 18:14:29 +0100 Subject: [PATCH] qt5: fix parallel build issues related to generated files Store all files generated by moc and rcc in the application's build directory to prevent the use of unfinished generated files for other applications built at the same time. Issue #3115 --- repos/libports/lib/import/import-qt5.inc | 19 ------------------ .../src/app/qt5/tmpl/target_final.inc | 20 +++++++++++++++++++ 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/repos/libports/lib/import/import-qt5.inc b/repos/libports/lib/import/import-qt5.inc index a54259c84..6eeb717ed 100644 --- a/repos/libports/lib/import/import-qt5.inc +++ b/repos/libports/lib/import/import-qt5.inc @@ -35,20 +35,7 @@ QT_DEFINES += -D__GENODE__ CC_OPT += $(QT_DEFINES) -SOURCES_FILTERED = $(filter-out $(SOURCES_FILTER_OUT), $(SOURCES)) -HEADERS_FILTERED = $(filter-out $(HEADERS_FILTER_OUT), $(HEADERS)) - -# add sources defined in qmake project files -SRC_CC += $(SOURCES_FILTERED) - # handle moc-headers, resources and ui descriptions -$(addsuffix .o,$(basename $(SRC_CC))): $(addprefix ui_,$(FORMS:.ui=.h)) - -SRC_CC_QT_GENERATED = $(join $(dir $(HEADERS_FILTERED)),$(addprefix moc_,$(notdir $(HEADERS_FILTERED:.h=.cpp)))) \ - $(join $(dir $(RESOURCES)),$(addprefix qrc_,$(notdir $(RESOURCES:.qrc=.cpp)))) - -.SECONDARY: $(SRC_CC_QT_GENERATED) -SRC_CC += $(SRC_CC_QT_GENERATED) # # Locations of moc, rcc, and uic binaries @@ -104,10 +91,4 @@ ifneq ($(filter arm,$(SPECS)),) QT_DEFINES += -DQT_ARCH_ARMV6 endif -# remove generated files in clean rules -clean cleanall: clean_rule -clean_rule: - $(VERBOSE)$(RM) -f $(SRC_CC_QT_GENERATED) - $(VERBOSE)$(RM) -f $(SOURCES_FILTERED:.cpp=.moc) - $(VERBOSE)$(RM) -f $(addprefix ui_,$(FORMS:.ui=.h)) endif diff --git a/repos/libports/src/app/qt5/tmpl/target_final.inc b/repos/libports/src/app/qt5/tmpl/target_final.inc index e21499886..b9050ddb7 100644 --- a/repos/libports/src/app/qt5/tmpl/target_final.inc +++ b/repos/libports/src/app/qt5/tmpl/target_final.inc @@ -1,5 +1,25 @@ INC_DIR += $(PRG_DIR) +SOURCES_FILTERED = $(filter-out $(SOURCES_FILTER_OUT), $(SOURCES)) +HEADERS_FILTERED = $(filter-out $(HEADERS_FILTER_OUT), $(HEADERS)) + +# add sources defined in qmake project files +SRC_CC += $(SOURCES_FILTERED) + +# add generated sources +SRC_CC_QT_GENERATED = $(addprefix moc_,$(notdir $(HEADERS_FILTERED:.h=.cpp))) \ + $(addprefix qrc_,$(notdir $(RESOURCES:.qrc=.cpp))) + +SRC_CC += $(SRC_CC_QT_GENERATED) + +# handle relative paths in the 'HEADERS' variable +vpath %.h $(abspath $(addprefix $(PRG_DIR)/,$(sort $(dir $(HEADERS_FILTERED))))) + +# handle relative paths in the 'RESOURCES' variable +vpath %.qrc $(abspath $(addprefix $(PRG_DIR)/,$(sort $(dir $(RESOURCES))))) + +$(addsuffix .o,$(basename $(SRC_CC))): $(addprefix ui_,$(FORMS:.ui=.h)) + LIBS += libc base # QtCore