From c0824c6c25903edc009bd7fa54df8b3391c9c2fc Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 16 Feb 2023 11:01:01 +0800 Subject: [PATCH] build: cmake: put generated sources into ${scylla_gen_build_dir} to be aligned with the convention of configure.py Signed-off-by: Kefu Chai --- idl/CMakeLists.txt | 6 +++--- rust/CMakeLists.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/idl/CMakeLists.txt b/idl/CMakeLists.txt index 64fff80198..0316e8abc3 100644 --- a/idl/CMakeLists.txt +++ b/idl/CMakeLists.txt @@ -2,15 +2,15 @@ find_package(Python3 COMPONENTS QUIET REQUIRED Interpreter) # Create C++ bindings for IDL serializers function(compile_idl input) - cmake_parse_arguments(parsed_args "" "SOURCES" "" ${ARGN}) + cmake_parse_arguments(parsed_args "" "SOURCES;OUT_DIR" "" ${ARGN}) get_filename_component(basename ${input} NAME_WE) get_filename_component(directory ${input} DIRECTORY) set(input "${CMAKE_CURRENT_SOURCE_DIR}/${input}") if(directory) - set(directory "${CMAKE_CURRENT_BINARY_DIR}/${directory}") + set(directory "${parsed_args_OUT_DIR}/${directory}") file(MAKE_DIRECTORY "${directory}") else() - set(directory "${CMAKE_CURRENT_BINARY_DIR}") + set(directory "${parsed_args_OUT_DIR}") endif() set(idl_compiler "${CMAKE_SOURCE_DIR}/idl-compiler.py") set(output "${directory}/${basename}.dist.hh") diff --git a/rust/CMakeLists.txt b/rust/CMakeLists.txt index e7deda75e6..ae3cd59a27 100644 --- a/rust/CMakeLists.txt +++ b/rust/CMakeLists.txt @@ -57,7 +57,7 @@ add_custom_command( generate_cxxbridge(wasmtime_bindings INPUT wasmtime_bindings/src/lib.rs INCLUDE ${cxx_header} - OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}" + OUTPUT_DIR "${scylla_gen_build_dir}" SOURCES wasmtime_bindings_sources) set_target_properties(Rust::rust_combined PROPERTIES