build(cmake): Allow spliting of toolchains, which will help with multi-platform support

CMake: Use ExternalProject_Add() to split by toolchain

Splits targets between native and cross-compiled targets, provides a cleaner solution to problems raised by compiling for example on Apple silicon, and better managing dependencies by allowing for object libraries in a cleaner way.
This commit is contained in:
Peter Feerick
2022-04-24 10:29:31 +10:00
committed by GitHub
624 changed files with 888 additions and 206891 deletions
+7 -4
View File
@@ -354,10 +354,10 @@ if(POLICY CMP0026)
cmake_policy(SET CMP0026 OLD) # https://cmake.org/cmake/help/v3.0/policy/CMP0026.html
endif()
if(SIMU_TARGET)
get_property(current_plugin TARGET edgetx-${FLAVOUR}-simulator PROPERTY LOCATION)
list(APPEND simulator_plugins "${current_plugin}")
endif()
#if(SIMU_TARGET)
# get_property(current_plugin TARGET edgetx-${FLAVOUR}-simulator PROPERTY LOCATION)
# list(APPEND simulator_plugins "${current_plugin}")
#endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
message(STATUS "install " ${CMAKE_BINARY_DIR} " to " ${CMAKE_INSTALL_PREFIX}/bin)
@@ -383,6 +383,9 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
install(FILES ../targets/linux/45-usbasp.rules DESTINATION ${INSTALL_TEMP_LIB_PFX}lib/udev/rules.d RENAME 45-companion${C9X_NAME_SUFFIX}-usbasp.rules)
# Linux specific code
set(OperatingSystem "Linux")
# Shortcut target
add_custom_target(companion DEPENDS ${COMPANION_NAME})
add_custom_target(simulator DEPENDS ${SIMULATOR_NAME})
elseif(WIN32)
set(INSTALL_DESTINATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}")
message(STATUS "Install to " ${INSTALL_DESTINATION})