diff options
Diffstat (limited to 'mkspecs')
-rw-r--r-- | mkspecs/features/gn_generator.prf | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/mkspecs/features/gn_generator.prf b/mkspecs/features/gn_generator.prf index c1399a453..4efbd92f2 100644 --- a/mkspecs/features/gn_generator.prf +++ b/mkspecs/features/gn_generator.prf @@ -26,15 +26,17 @@ isEmpty(GN_FILE): GN_FILE = $$system_path($$_PRO_FILE_PWD_/BUILD.gn) isEmpty(GN_RUN_BINARY_SCRIPT): GN_RUN_BINARY_SCRIPT = "//build/gn_run_binary.py" isEmpty(GN_FIND_MOCABLES_SCRIPT): GN_FIND_MOCABLES_SCRIPT = "//build/gn_find_mocables.py" +GN_CONTENTS += "import(\"//build/config/jumbo.gni\")" + # MOC SETUP GN_CONTENTS += "moc_source_h_files = exec_script(\"$$GN_FIND_MOCABLES_SCRIPT\"," -GN_CONTENTS += " [ \"$$_PRO_FILE_PWD_\"," +GN_CONTENTS += " [" for (headerfile, HEADERS): GN_CONTENTS += " \"$$GN_SRC_DIR/$$headerfile\"," GN_CONTENTS += " ], \"list lines\", [\"$$system_path($$_PRO_FILE_)\"]"\ ")" GN_CONTENTS += "moc_source_cpp_files = exec_script(\"$$GN_FIND_MOCABLES_SCRIPT\"," -GN_CONTENTS += " [ \"$$_PRO_FILE_PWD_\"," +GN_CONTENTS += " [" for (sourcefile, SOURCES): GN_CONTENTS += " \"$$GN_SRC_DIR/$$sourcefile\"," GN_CONTENTS += " ], \"list lines\", [\"$$system_path($$_PRO_FILE_)\"]"\ ")" @@ -169,6 +171,26 @@ GN_CONTENTS += "}" # TARGET SETUP +GN_CONTENTS += "jumbo_source_set(\"$${TARGET}_MOC\") {" +GN_CONTENTS += " configs += [ \":$${TARGET}_config\" ]" +GN_CONTENTS += " configs += [ \"//build/config:precompiled_headers\" ]" +GN_CONTENTS += " sources = []" +GN_CONTENTS += " deps = []" +GN_CONTENTS += " if (moc_source_h_files != []) {" +GN_CONTENTS += " deps += [" +GN_CONTENTS += " \":generate_h_mocs\"," +GN_CONTENTS += " ]" +# Add moc output files to compile +GN_CONTENTS += " sources += get_target_outputs(\":generate_h_mocs\")" +GN_CONTENTS += " }" +GN_CONTENTS += " if (moc_source_cpp_files != []) {" +GN_CONTENTS += " deps += [" +GN_CONTENTS += " \":generate_cpp_mocs\"," +GN_CONTENTS += " ]" +GN_CONTENTS += " }" +GN_CONTENTS += "}" + + TARGET_TYPE = $$getTargetType() GN_CONTENTS += "$${TARGET_TYPE}(\"$$TARGET\") {" @@ -177,7 +199,8 @@ GN_CONTENTS += "$${TARGET_TYPE}(\"$$TARGET\") {" for (imp, GN_IMPORTS): GN_CONTENTS += " import(\"$$imp\")" } -GN_CONTENTS += " configs += [ \":$${TARGET}_config\" ] " +GN_CONTENTS += " configs += [ \":$${TARGET}_config\" ]" +GN_CONTENTS += " configs += [ \"//build/config:precompiled_headers\" ]" # Source files to compile GN_CONTENTS += " sources = [" @@ -220,18 +243,7 @@ win32 { CONFIG(rtti): GN_CONTENTS += " configs += [\"//build/config/compiler:rtti\"]" } -GN_CONTENTS += " if (moc_source_h_files != []) {" -GN_CONTENTS += " deps += [" -GN_CONTENTS += " \":generate_h_mocs\"," -GN_CONTENTS += " ]" -# Add moc output files to compile -GN_CONTENTS += " sources += get_target_outputs(\":generate_h_mocs\")" -GN_CONTENTS += " }" -GN_CONTENTS += " if (moc_source_cpp_files != []) {" -GN_CONTENTS += " deps += [" -GN_CONTENTS += " \":generate_cpp_mocs\"," -GN_CONTENTS += " ]" -GN_CONTENTS += " }" +GN_CONTENTS += " deps += [ \":$${TARGET}_MOC\" ]" GN_CONTENTS += "}" GN_CONTENTS += "" GN_CONTENTS += "if (!defined(core_include_dirs)) {"\ |