From d41543f8299e6484fbba4f5874d3713e7476ca29 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 24 Aug 2022 16:57:03 +0900 Subject: [PATCH] cmake: Use CMAKE_BINARY_DIR instead of ${CMAKE_CURRENT_SOURCE_DIR}/build (#1410) --- product-mini/platforms/android/CMakeLists.txt | 2 +- samples/multi-module/CMakeLists.txt | 10 +++++----- samples/socket-api/CMakeLists.txt | 6 +++--- samples/workload/XNNPACK/CMakeLists.txt | 2 +- samples/workload/bwa/CMakeLists.txt | 2 +- samples/workload/meshoptimizer/CMakeLists.txt | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/product-mini/platforms/android/CMakeLists.txt b/product-mini/platforms/android/CMakeLists.txt index 22db06b03..a65b18089 100644 --- a/product-mini/platforms/android/CMakeLists.txt +++ b/product-mini/platforms/android/CMakeLists.txt @@ -104,7 +104,7 @@ else() target_link_libraries (iwasm ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} -lm -ldl -landroid -llog) endif() -set (distribution_DIR ${CMAKE_CURRENT_SOURCE_DIR}/build/distribution) +set (distribution_DIR ${CMAKE_BINARY_DIR}/distribution) set_target_properties (iwasm PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${distribution_DIR}/wasm/lib") add_custom_command (TARGET iwasm POST_BUILD diff --git a/samples/multi-module/CMakeLists.txt b/samples/multi-module/CMakeLists.txt index 26c99d828..b57df2cb4 100644 --- a/samples/multi-module/CMakeLists.txt +++ b/samples/multi-module/CMakeLists.txt @@ -135,11 +135,11 @@ ExternalProject_Add(WASM_MODULE -S ${CMAKE_CURRENT_SOURCE_DIR}/wasm-apps BUILD_COMMAND ${CMAKE_COMMAND} --build . INSTALL_COMMAND ${CMAKE_COMMAND} -E copy - ./mA.wasm ${CMAKE_CURRENT_SOURCE_DIR}/build/ - ./mB.wasm ${CMAKE_CURRENT_SOURCE_DIR}/build/ - ./mC.wasm ${CMAKE_CURRENT_SOURCE_DIR}/build/ - ./mD.wasm ${CMAKE_CURRENT_SOURCE_DIR}/build/ - ./mE.wasm ${CMAKE_CURRENT_SOURCE_DIR}/build/ + ./mA.wasm ${CMAKE_BINARY_DIR} + ./mB.wasm ${CMAKE_BINARY_DIR} + ./mC.wasm ${CMAKE_BINARY_DIR} + ./mD.wasm ${CMAKE_BINARY_DIR} + ./mE.wasm ${CMAKE_BINARY_DIR} ) ################ NATIVE diff --git a/samples/socket-api/CMakeLists.txt b/samples/socket-api/CMakeLists.txt index 5ce2543b9..2508ac7cf 100644 --- a/samples/socket-api/CMakeLists.txt +++ b/samples/socket-api/CMakeLists.txt @@ -87,9 +87,9 @@ ExternalProject_Add(wasm-app ${CMAKE_CURRENT_SOURCE_DIR}/wasm-src BUILD_COMMAND ${CMAKE_COMMAND} --build . INSTALL_COMMAND ${CMAKE_COMMAND} -E copy - tcp_client.wasm ${CMAKE_CURRENT_SOURCE_DIR}/build - tcp_server.wasm ${CMAKE_CURRENT_SOURCE_DIR}/build - send_recv.wasm ${CMAKE_CURRENT_SOURCE_DIR}/build + tcp_client.wasm ${CMAKE_BINARY_DIR} + tcp_server.wasm ${CMAKE_BINARY_DIR} + send_recv.wasm ${CMAKE_BINARY_DIR} ) add_executable(tcp_server ${CMAKE_CURRENT_SOURCE_DIR}/wasm-src/tcp_server.c) diff --git a/samples/workload/XNNPACK/CMakeLists.txt b/samples/workload/XNNPACK/CMakeLists.txt index 1be033268..3f67367a7 100644 --- a/samples/workload/XNNPACK/CMakeLists.txt +++ b/samples/workload/XNNPACK/CMakeLists.txt @@ -90,5 +90,5 @@ ExternalProject_Add(xnnpack //:f32_sqrt_ulp_eval.wasm INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/xnnpack/bazel-out/wasm-opt/bin/ - ${CMAKE_CURRENT_SOURCE_DIR}/build/wasm-opt + ${CMAKE_BINARY_DIR}/wasm-opt ) diff --git a/samples/workload/bwa/CMakeLists.txt b/samples/workload/bwa/CMakeLists.txt index 9ea6704b3..7f7e31825 100644 --- a/samples/workload/bwa/CMakeLists.txt +++ b/samples/workload/bwa/CMakeLists.txt @@ -42,5 +42,5 @@ ExternalProject_Add(bwa -DCMAKE_SYSROOT=${WASI_SDK_HOME}/share/wasi-sysroot ${CMAKE_CURRENT_SOURCE_DIR}/bwa BUILD_COMMAND make bwa_wasm_opt - INSTALL_COMMAND ${CMAKE_COMMAND} -E copy ./bwa.opt.wasm ${CMAKE_CURRENT_SOURCE_DIR}/build/bwa.wasm + INSTALL_COMMAND ${CMAKE_COMMAND} -E copy ./bwa.opt.wasm ${CMAKE_BINARY_DIR}/bwa.wasm ) diff --git a/samples/workload/meshoptimizer/CMakeLists.txt b/samples/workload/meshoptimizer/CMakeLists.txt index 97f98fa3a..172de8d67 100644 --- a/samples/workload/meshoptimizer/CMakeLists.txt +++ b/samples/workload/meshoptimizer/CMakeLists.txt @@ -26,5 +26,5 @@ ExternalProject_Add(codecbench -DCMAKE_SYSROOT=${WASI_SDK_HOME}/share/wasi-sysroot ${CMAKE_CURRENT_SOURCE_DIR}/meshoptimizer BUILD_COMMAND make codecbench - INSTALL_COMMAND ${CMAKE_COMMAND} -E copy ./codecbench.wasm ${CMAKE_CURRENT_SOURCE_DIR}/build/codecbench.wasm + INSTALL_COMMAND ${CMAKE_COMMAND} -E copy ./codecbench.wasm ${CMAKE_BINARY_DIR}/codecbench.wasm )