Update develop. Ready for pre-release v0.4 #49
@ -1,7 +1,7 @@
|
|||||||
set(CMAKE_SYSTEM_NAME Generic)
|
set(CMAKE_SYSTEM_NAME Generic)
|
||||||
set(CMAKE_SYSTEM_PROCESSOR arm)
|
set(CMAKE_SYSTEM_PROCESSOR arm)
|
||||||
set(CMAKE_CROSSCOMPILING 1)
|
set(CMAKE_CROSSCOMPILING 1)
|
||||||
cmake_minimum_required(VERSION 3.0)
|
cmake_minimum_required(VERSION 3.18)
|
||||||
|
|
||||||
set(CMAKE_TOOLCHAIN_FILE "arm-none-eabi-gcc.cmake")
|
set(CMAKE_TOOLCHAIN_FILE "arm-none-eabi-gcc.cmake")
|
||||||
|
|
||||||
@ -43,26 +43,12 @@ else (GIT_FOUND)
|
|||||||
message("Version is set to: ${GIT_DESCRIBE}${ColorReset}")
|
message("Version is set to: ${GIT_DESCRIBE}${ColorReset}")
|
||||||
endif (GIT_FOUND)
|
endif (GIT_FOUND)
|
||||||
|
|
||||||
find_program(VIRTUALENV virtualenv)
|
find_program(PATCHELFCRC patchelfcrc)
|
||||||
if (VIRTUALENV)
|
if (PATCHELFCRC)
|
||||||
message("Python virtual environment found")
|
message("patchelfcrc found: ${PATCHELFCRC}")
|
||||||
execute_process(
|
else(PATCHELFCRC)
|
||||||
COMMAND ${VIRTUALENV} venv
|
message(FATAL_ERROR "${BoldRed}Patchelfcrc not found. Cannot patch CRC checksum into ELF file: patchelfcrc: command not found! See: https://git.shimatta.de/mhu/patchelfcrc${ColorReset}")
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
endif (PATCHELFCRC)
|
||||||
OUTPUT_QUIET
|
|
||||||
COMMAND_ERROR_IS_FATAL ANY
|
|
||||||
)
|
|
||||||
set(VENV_BIN "${CMAKE_CURRENT_BINARY_DIR}/venv/bin")
|
|
||||||
execute_process(
|
|
||||||
COMMAND ./pip install -r "${CMAKE_CURRENT_SOURCE_DIR}/crc-patcher/requirements.txt"
|
|
||||||
WORKING_DIRECTORY ${VENV_BIN}
|
|
||||||
OUTPUT_QUIET
|
|
||||||
COMMAND_ERROR_IS_FATAL ANY
|
|
||||||
)
|
|
||||||
message("${BoldGreen}python virtual environment set up!${ColorReset}")
|
|
||||||
else(VIRTUALENV)
|
|
||||||
message(FATAL_ERROR "${BoldRed}Python virtual environment not set up: virtualenv: command not found!${ColorReset}")
|
|
||||||
endif (VIRTUALENV)
|
|
||||||
|
|
||||||
|
|
||||||
set(ELFFILE ${PROJECT_NAME}.elf)
|
set(ELFFILE ${PROJECT_NAME}.elf)
|
||||||
@ -131,8 +117,8 @@ target_include_directories(${ELFFILE} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/updat
|
|||||||
add_custom_command(
|
add_custom_command(
|
||||||
TARGET ${ELFFILE}
|
TARGET ${ELFFILE}
|
||||||
POST_BUILD
|
POST_BUILD
|
||||||
COMMAND ./python "${CMAKE_CURRENT_SOURCE_DIR}/crc-patcher/crc_patch_elf.py" "${CMAKE_CURRENT_BINARY_DIR}/${ELFFILE}"
|
COMMAND ${PATCHELFCRC} --little-endian --verbose --granularity word --start-magic 0xa8be53f9 --end-magic 0xffa582ff -O .flashcrc -p crc-32-mpeg -S .text -S .data -S .ccmdata -S .vectors "${CMAKE_CURRENT_BINARY_DIR}/${ELFFILE}"
|
||||||
WORKING_DIRECTORY ${VENV_BIN}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
COMMENT "Running Flash CRC Patcher"
|
COMMENT "Running Flash CRC Patcher"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user