Fix: [CMake] cross-compiling requires native tools

(cherry picked from commit fdaf0d0b2f82701c8ea1e9a1125415351cf49e57)
This commit is contained in:
glx22
2020-06-29 19:15:28 +02:00
committed by Jonathan G Rennison
parent 33c2150c49
commit 909c9656ce
3 changed files with 45 additions and 6 deletions

View File

@@ -67,11 +67,11 @@ foreach(LANG_SOURCE_FILE IN LISTS LANG_SOURCE_FILES)
add_custom_command(OUTPUT ${LANG_BINARY_FILE}
COMMAND ${CMAKE_COMMAND} -E make_directory ${LANG_BINARY_DIR}
COMMAND strgen
COMMAND hoststrgen
-s ${CMAKE_CURRENT_SOURCE_DIR}
-d ${LANG_BINARY_DIR}
${LANG_SOURCE_FILE}
DEPENDS strgen
DEPENDS hoststrgen
MAIN_DEPENDENCY ${LANG_SOURCE_FILE}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Compiling language ${LANG_SOURCE_FILE_NAME_WE}"
@@ -96,10 +96,10 @@ set(TABLE_BINARY_DIR ${GENERATED_BINARY_DIR}/table)
# Generate a command and target to create the strings table
add_custom_command_timestamp(OUTPUT ${TABLE_BINARY_DIR}/strings.h
COMMAND ${CMAKE_COMMAND} -E make_directory ${TABLE_BINARY_DIR}
COMMAND strgen
COMMAND hoststrgen
-s ${CMAKE_CURRENT_SOURCE_DIR}
-d ${TABLE_BINARY_DIR}
DEPENDS strgen ${LANG_SOURCE_FILES}
DEPENDS hoststrgen ${LANG_SOURCE_FILES}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating table/strings.h"
)