cmake: fix replacement pattern that finds sh-elf-objcopy

The previous one would fail if "gcc" was in the install path.
This commit is contained in:
Lephenixnoir 2021-04-17 15:59:35 +02:00
parent 42bc49b89a
commit d09ad9dd17
No known key found for this signature in database
GPG key ID: 1BBA026E13FC0495

View file

@ -35,7 +35,7 @@ function(generate_g1a)
list(APPEND FXG1A_ARGS "-i" "${G1A_ICON}") list(APPEND FXG1A_ARGS "-i" "${G1A_ICON}")
endif() endif()
string(REPLACE "gcc" "objcopy" OBJCOPY "${CMAKE_C_COMPILER}") string(REGEX REPLACE "sh-elf-gcc$" "sh-elf-objcopy" OBJCOPY "${CMAKE_C_COMPILER}")
add_custom_command( add_custom_command(
TARGET "${G1A_TARGET}" POST_BUILD TARGET "${G1A_TARGET}" POST_BUILD