From a97b75cbd2fc8df188c57f3ea545ab848a9e9bbf Mon Sep 17 00:00:00 2001 From: Matt Witherspoon <32485495+spoonincode@users.noreply.github.com> Date: Tue, 12 Nov 2024 18:22:06 -0500 Subject: [PATCH] create db_find_secondary_test.wasm from wast when cdt enabled --- .../db_find_secondary_test/CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/unittests/test-contracts/db_find_secondary_test/CMakeLists.txt b/unittests/test-contracts/db_find_secondary_test/CMakeLists.txt index 307394da74..5f78fe379b 100644 --- a/unittests/test-contracts/db_find_secondary_test/CMakeLists.txt +++ b/unittests/test-contracts/db_find_secondary_test/CMakeLists.txt @@ -1,2 +1,10 @@ -configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/db_find_secondary_test.wasm ${CMAKE_CURRENT_BINARY_DIR}/db_find_secondary_test.wasm COPYONLY ) +if(EOSIO_COMPILE_TEST_CONTRACTS) + add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/db_find_secondary_test.wasm" + COMMAND "${CDT_ROOT}/bin/eosio-wast2wasm" "${CMAKE_CURRENT_SOURCE_DIR}/db_find_secondary_test.wast" -o "${CMAKE_CURRENT_BINARY_DIR}/db_find_secondary_test.wasm" + DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/db_find_secondary_test.wast") + + add_custom_target(gen_db_find_secondary_test_wasm ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/db_find_secondary_test.wasm") +else() + configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/db_find_secondary_test.wasm ${CMAKE_CURRENT_BINARY_DIR}/db_find_secondary_test.wasm COPYONLY ) +endif() configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/db_find_secondary_test.abi ${CMAKE_CURRENT_BINARY_DIR}/db_find_secondary_test.abi COPYONLY )