diff options
author | Aki <please@ignore.pl> | 2024-03-07 23:59:51 +0100 |
---|---|---|
committer | Aki <please@ignore.pl> | 2024-03-07 23:59:51 +0100 |
commit | 3f857bb284d3c8aa99bcd61980e0f0cab2dd8e19 (patch) | |
tree | 4a2724f89ce213b1834d5550229243cccfad9fb3 /cmake/modules/GenerateEmulator.cmake | |
parent | 1ef05b8b227194ec32ae49f0eaf3e483ef35bb6b (diff) | |
download | starshatter-3f857bb284d3c8aa99bcd61980e0f0cab2dd8e19.zip starshatter-3f857bb284d3c8aa99bcd61980e0f0cab2dd8e19.tar.gz starshatter-3f857bb284d3c8aa99bcd61980e0f0cab2dd8e19.tar.bz2 |
Added gtest to the project and a stub test for showcase
Diffstat (limited to 'cmake/modules/GenerateEmulator.cmake')
-rw-r--r-- | cmake/modules/GenerateEmulator.cmake | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/cmake/modules/GenerateEmulator.cmake b/cmake/modules/GenerateEmulator.cmake new file mode 100644 index 0000000..f25ae5f --- /dev/null +++ b/cmake/modules/GenerateEmulator.cmake @@ -0,0 +1,21 @@ +# Generates and attaches new emulator wrapper for a TARGET for use with tests and custom target jobs. + +set(GENERATE_EMULATOR_TEMPLATE "${CMAKE_CURRENT_LIST_DIR}/wine.sh.in") +if(CMAKE_CROSSCOMPILING) + function(generate_emulator TARGET) + cmake_parse_arguments(PARSE_ARGV 1 GENERATE_EMULATOR "" "" "LIBS") + set(WINE_PREFIX "$ENV{HOME}/.wine-${TOOLCHAIN_PREFIX}") + set(WINE_PATH "${CMAKE_FIND_ROOT_PATH}/bin") + foreach(LIB IN ITEMS ${GENERATE_EMULATOR_LIBS}) + get_target_property(DIR ${LIB} BINARY_DIR) + list(PREPEND WINE_PATH "${DIR}") + endforeach() + set(EMULATOR "${CMAKE_CURRENT_BINARY_DIR}/wine") + configure_file("${GENERATE_EMULATOR_TEMPLATE}" "${EMULATOR}" @ONLY) + set_target_properties(${TARGET} PROPERTIES CROSSCOMPILING_EMULATOR "${EMULATOR}") + endfunction() +else() + function(generate_emulator TARGET) + # no-op + endfunction() +endif() |