Improve Build Time

This commit is contained in:
TheBrokenRail 2024-08-02 01:03:20 -04:00
parent 98c4ee306d
commit 63e2525ee9
5 changed files with 27 additions and 15 deletions

@ -1 +1 @@
Subproject commit 0d7025eb709351d2db51d19a46ff8e2640bd4465 Subproject commit 2f5953779674ec3a14114aa34b24c81005571ec4

View File

@ -1,5 +1,5 @@
# Pick Archive # 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) execute_process(COMMAND uname -m OUTPUT_VARIABLE arch OUTPUT_STRIP_TRAILING_WHITESPACE)
if(arch STREQUAL "x86_64") if(arch STREQUAL "x86_64")
set(toolchain_file "arm-gnu-toolchain-${toolchain_version}-x86_64-arm-none-linux-gnueabihf.tar.xz") set(toolchain_file "arm-gnu-toolchain-${toolchain_version}-x86_64-arm-none-linux-gnueabihf.tar.xz")

View File

@ -3,7 +3,7 @@ project(runtime)
## Extra Runtime ## Extra Runtime
# QEMU # 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") set(RUNTIME_QEMU_ARCHIVE "${CMAKE_CURRENT_SOURCE_DIR}/../../archives/qemu-${QEMU_VERSION}.tar.xz")
if(NOT BUILD_NATIVE_COMPONENTS) if(NOT BUILD_NATIVE_COMPONENTS)
set(TRAMPOLINE_HEADERS_ONLY TRUE) set(TRAMPOLINE_HEADERS_ONLY TRUE)

@ -1 +1 @@
Subproject commit 10026e9a0419ff1cea1ddb80f5ccddf6a53818d3 Subproject commit 2a63f1ff521087f3faf23bf281503cc07a50d2df

View File

@ -188,11 +188,6 @@ set(SRC
src/recipes/ReqItem.def src/recipes/ReqItem.def
src/recipes/CItem.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 # Directories
function(set_and_mkdir name dir) 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(HEADER_OUTPUT_DIR "${INCLUDE_OUTPUT_DIR}/symbols")
set_and_mkdir(SRC_OUTPUT_DIR "${GENERATED_DIR}/src") set_and_mkdir(SRC_OUTPUT_DIR "${GENERATED_DIR}/src")
# Files # Generated Header File
set(HEADER_OUTPUT_FILE "${HEADER_OUTPUT_DIR}/minecraft.h") 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 # 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( add_custom_command(
OUTPUT "${SRC_OUTPUT_FILE}" "${HEADER_OUTPUT_FILE}" OUTPUT ${OUTPUT_FILES}
DEPENDS ${RESOLVED_SRC} DEPENDS ${INPUT_FILES}
COMMAND npm start --silent -- "${SRC_OUTPUT_FILE}" "${HEADER_OUTPUT_FILE}" ${RESOLVED_SRC} COMMAND npm start --silent -- "${SRC_OUTPUT_DIR}" "${HEADER_OUTPUT_FILE}" ${INPUT_FILES}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/symbol-processor/src" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/symbol-processor/src"
VERBATIM VERBATIM
) )
# Build # 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 # Show In IDE
add_custom_target(symbols-src add_custom_target(symbols-src