CMake: Fix HOST_BINARY_DIR cross compiling
This commit is contained in:
@@ -243,7 +243,9 @@ set_target_properties(openttd PROPERTIES OUTPUT_NAME "${BINARY_NAME}")
|
||||
|
||||
set(host_tools_list strgen settingsgen)
|
||||
|
||||
if(CMAKE_CROSSCOMPILING)
|
||||
if(HOST_BINARY_DIR)
|
||||
# Host tools already exist, nothing to do
|
||||
elseif(CMAKE_CROSSCOMPILING)
|
||||
# Pawn off the creation of the host utilities into its own dedicated space
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/host_tools)
|
||||
file(TO_NATIVE_PATH ${CMAKE_COMMAND} native_cmake_command)
|
||||
@@ -280,7 +282,7 @@ add_subdirectory(${CMAKE_SOURCE_DIR}/src)
|
||||
add_subdirectory(${CMAKE_SOURCE_DIR}/media/baseset)
|
||||
add_subdirectory(${CMAKE_SOURCE_DIR}/bin)
|
||||
|
||||
if(NOT CMAKE_CROSSCOMPILING)
|
||||
if(NOT CMAKE_CROSSCOMPILING AND NOT HOST_BINARY_DIR)
|
||||
foreach(tgt IN ITEMS ${host_tools_list})
|
||||
add_executable(host${tgt} ALIAS ${tgt})
|
||||
endforeach()
|
||||
|
@@ -65,6 +65,7 @@ set(LANG_BINARY_DIR ${CMAKE_BINARY_DIR}/lang)
|
||||
|
||||
if (HOST_BINARY_DIR)
|
||||
include(${HOST_BINARY_DIR}/strgen.cmake)
|
||||
add_executable(hoststrgen ALIAS strgen)
|
||||
endif()
|
||||
|
||||
# Walk over all the (finished) language files, and generate a command to compile them
|
||||
|
@@ -13,6 +13,7 @@ set(TABLE_INI_SOURCE_FILES
|
||||
|
||||
if (HOST_BINARY_DIR)
|
||||
include(${HOST_BINARY_DIR}/settingsgen.cmake)
|
||||
add_executable(hostsettingsgen ALIAS settingsgen)
|
||||
endif()
|
||||
|
||||
# Generate a command and target to create the settings table
|
||||
|
Reference in New Issue
Block a user