From cfc7113b26ca6bdd263aa4dc9dc2499817e20f7b Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Tue, 8 Oct 2024 21:41:31 +0900 Subject: [PATCH 1/2] Avoid errors with an old cmake used on libretro CI Fixes https://github.com/aduros/wasm4/issues/768 --- runtimes/native/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/runtimes/native/CMakeLists.txt b/runtimes/native/CMakeLists.txt index 13e7e360..8f5b2284 100644 --- a/runtimes/native/CMakeLists.txt +++ b/runtimes/native/CMakeLists.txt @@ -161,8 +161,14 @@ target_include_directories(wasm4 PRIVATE $<$:${CMAKE_SOURCE_DIR}/vendor/glad/include> $<$:${CMAKE_SOURCE_DIR}/vendor/wasm3/source> $<$:${toywasm_tmp_install}/include>) +# Note: as of writing this, libretro CI uses an ancient cmake, which +# doesn't have target_link_directories. the following target_link_directories +# is wrapped with an otherwise redundant "if (TOYWASM)" to avoid errors there. +# https://github.com/aduros/wasm4/issues/768 +if (TOYWASM) target_link_directories(wasm4 PRIVATE $<$:${toywasm_tmp_install}/lib>) +endif () target_link_libraries(wasm4 cubeb $<$:minifb> From d43eba417192feb54a3d6ebc0e18771e60da7888 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 9 Oct 2024 00:52:30 +0900 Subject: [PATCH 2/2] Another "if (TOYWASM)" to wrap target_link_directories Fixes https://github.com/aduros/wasm4/issues/768 --- runtimes/native/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/runtimes/native/CMakeLists.txt b/runtimes/native/CMakeLists.txt index 8f5b2284..cfcbf9ad 100644 --- a/runtimes/native/CMakeLists.txt +++ b/runtimes/native/CMakeLists.txt @@ -214,8 +214,10 @@ endif () target_include_directories(wasm4_libretro PRIVATE $<$:${CMAKE_SOURCE_DIR}/vendor/wasm3/source> $<$:${toywasm_tmp_install}/include>) +if (TOYWASM) # https://github.com/aduros/wasm4/issues/768 target_link_directories(wasm4_libretro PRIVATE $<$:${toywasm_tmp_install}/lib>) +endif () target_include_directories(wasm4_libretro PRIVATE "${CMAKE_SOURCE_DIR}/vendor/libretro/include") target_link_libraries(wasm4_libretro $<$:toywasm-core>) set_target_properties(wasm4_libretro PROPERTIES C_STANDARD 99)