From 63e2525ee9c244bdf1529a5d87257b9a490cffaf Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Fri, 2 Aug 2024 01:03:20 -0400 Subject: [PATCH] Improve Build Time --- archives | 2 +- cmake/options/prebuilt-armhf-toolchain.cmake | 2 +- dependencies/runtime/CMakeLists.txt | 2 +- dependencies/symbol-processor/src | 2 +- symbols/CMakeLists.txt | 34 +++++++++++++------- 5 files changed, 27 insertions(+), 15 deletions(-) diff --git a/archives b/archives index 0d7025eb70..2f59537796 160000 --- a/archives +++ b/archives @@ -1 +1 @@ -Subproject commit 0d7025eb709351d2db51d19a46ff8e2640bd4465 +Subproject commit 2f5953779674ec3a14114aa34b24c81005571ec4 diff --git a/cmake/options/prebuilt-armhf-toolchain.cmake b/cmake/options/prebuilt-armhf-toolchain.cmake index ae045e3b9a..06cbc0aa6a 100644 --- a/cmake/options/prebuilt-armhf-toolchain.cmake +++ b/cmake/options/prebuilt-armhf-toolchain.cmake @@ -1,5 +1,5 @@ # Pick Archive -set(toolchain_version "13.2.rel1") +set(toolchain_version "13.3.rel1") execute_process(COMMAND uname -m OUTPUT_VARIABLE arch OUTPUT_STRIP_TRAILING_WHITESPACE) if(arch STREQUAL "x86_64") set(toolchain_file "arm-gnu-toolchain-${toolchain_version}-x86_64-arm-none-linux-gnueabihf.tar.xz") diff --git a/dependencies/runtime/CMakeLists.txt b/dependencies/runtime/CMakeLists.txt index 9929c24142..aec71c3867 100644 --- a/dependencies/runtime/CMakeLists.txt +++ b/dependencies/runtime/CMakeLists.txt @@ -3,7 +3,7 @@ project(runtime) ## Extra Runtime # QEMU -set(QEMU_VERSION "9.0.0") +set(QEMU_VERSION "9.0.2") set(RUNTIME_QEMU_ARCHIVE "${CMAKE_CURRENT_SOURCE_DIR}/../../archives/qemu-${QEMU_VERSION}.tar.xz") if(NOT BUILD_NATIVE_COMPONENTS) set(TRAMPOLINE_HEADERS_ONLY TRUE) diff --git a/dependencies/symbol-processor/src b/dependencies/symbol-processor/src index 10026e9a04..2a63f1ff52 160000 --- a/dependencies/symbol-processor/src +++ b/dependencies/symbol-processor/src @@ -1 +1 @@ -Subproject commit 10026e9a0419ff1cea1ddb80f5ccddf6a53818d3 +Subproject commit 2a63f1ff521087f3faf23bf281503cc07a50d2df diff --git a/symbols/CMakeLists.txt b/symbols/CMakeLists.txt index 36c3e4f2f2..fe2909d30c 100644 --- a/symbols/CMakeLists.txt +++ b/symbols/CMakeLists.txt @@ -188,11 +188,6 @@ set(SRC src/recipes/ReqItem.def src/recipes/CItem.def ) -# Resolve Definition Files -set(RESOLVED_SRC "") -foreach(FILE IN LISTS SRC) - list(APPEND RESOLVED_SRC "${CMAKE_CURRENT_SOURCE_DIR}/${FILE}") -endforeach() # Directories function(set_and_mkdir name dir) @@ -204,21 +199,38 @@ set_and_mkdir(INCLUDE_OUTPUT_DIR "${GENERATED_DIR}/include") set_and_mkdir(HEADER_OUTPUT_DIR "${INCLUDE_OUTPUT_DIR}/symbols") set_and_mkdir(SRC_OUTPUT_DIR "${GENERATED_DIR}/src") -# Files +# Generated Header File set(HEADER_OUTPUT_FILE "${HEADER_OUTPUT_DIR}/minecraft.h") -set(SRC_OUTPUT_FILE "${SRC_OUTPUT_DIR}/minecraft.cpp") + +# Generated Source Files +set(SRC_OUTPUT_FILES "") +foreach(FILE IN LISTS SRC) + get_filename_component(FILE_EXT "${FILE}" EXT) + if(FILE_EXT STREQUAL ".def") + get_filename_component(FILE "${FILE}" NAME_WE) + list(APPEND SRC_OUTPUT_FILES "${SRC_OUTPUT_DIR}/${FILE}.cpp") + endif() +endforeach() # Generate +set(INPUT_FILES "") +foreach(FILE IN LISTS SRC) + list(APPEND INPUT_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${FILE}") +endforeach() +set(OUTPUT_FILES ${SRC_OUTPUT_FILES} "${HEADER_OUTPUT_FILE}") add_custom_command( - OUTPUT "${SRC_OUTPUT_FILE}" "${HEADER_OUTPUT_FILE}" - DEPENDS ${RESOLVED_SRC} - COMMAND npm start --silent -- "${SRC_OUTPUT_FILE}" "${HEADER_OUTPUT_FILE}" ${RESOLVED_SRC} + OUTPUT ${OUTPUT_FILES} + DEPENDS ${INPUT_FILES} + COMMAND npm start --silent -- "${SRC_OUTPUT_DIR}" "${HEADER_OUTPUT_FILE}" ${INPUT_FILES} WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/symbol-processor/src" VERBATIM ) # Build -add_library(symbols SHARED "${SRC_OUTPUT_FILE}" "${HEADER_OUTPUT_FILE}") +add_library(symbols SHARED ${OUTPUT_FILES}) + +# Speed Up Compilation +#target_precompile_headers(symbols PRIVATE "${HEADER_OUTPUT_FILE}") # Show In IDE add_custom_target(symbols-src