2015-09-06 16:44:30 +00:00
|
|
|
|
2020-10-22 06:47:06 +00:00
|
|
|
include(ExternalProject)
|
2019-02-13 10:06:49 +00:00
|
|
|
|
|
|
|
function(setup_host_tools)
|
2020-10-22 06:47:06 +00:00
|
|
|
list(APPEND HOST_TOOLS bin2c widl gendib cabman fatten hpp isohybrid mkhive mkisofs obj2bin spec2def geninc mkshelllink utf16le xml2sdb)
|
|
|
|
if(NOT MSVC)
|
|
|
|
list(APPEND HOST_TOOLS rsym pefixup)
|
|
|
|
endif()
|
|
|
|
list(TRANSFORM HOST_TOOLS PREPEND "${REACTOS_BINARY_DIR}/host-tools/bin/" OUTPUT_VARIABLE HOST_TOOLS_OUTPUT)
|
|
|
|
if (CMAKE_HOST_WIN32)
|
|
|
|
list(TRANSFORM HOST_TOOLS_OUTPUT APPEND ".exe")
|
|
|
|
set(HOST_EXE_SUFFIX ".exe")
|
2019-02-13 10:06:49 +00:00
|
|
|
endif()
|
|
|
|
|
2020-10-22 06:47:06 +00:00
|
|
|
ExternalProject_Add(host-tools
|
|
|
|
SOURCE_DIR ${REACTOS_SOURCE_DIR}
|
|
|
|
PREFIX ${REACTOS_BINARY_DIR}/host-tools
|
|
|
|
INSTALL_DIR ${REACTOS_BINARY_DIR}/host-tools
|
|
|
|
CMAKE_ARGS -UCMAKE_TOOLCHAIN_FILE -DARCH:STRING=${ARCH} -DCMAKE_INSTALL_PREFIX=${REACTOS_BINARY_DIR}/host-tools
|
|
|
|
BUILD_ALWAYS TRUE
|
|
|
|
BUILD_BYPRODUCTS ${HOST_TOOLS_OUTPUT}
|
|
|
|
)
|
|
|
|
|
|
|
|
ExternalProject_Get_Property(host-tools INSTALL_DIR)
|
|
|
|
|
|
|
|
foreach(_tool ${HOST_TOOLS})
|
|
|
|
add_executable(native-${_tool} IMPORTED)
|
|
|
|
set_target_properties(native-${_tool} PROPERTIES IMPORTED_LOCATION ${INSTALL_DIR}/bin/${_tool}${HOST_EXE_SUFFIX})
|
|
|
|
add_dependencies(native-${_tool} host-tools)
|
|
|
|
endforeach()
|
2019-02-13 10:06:49 +00:00
|
|
|
endfunction()
|