Skip to content

Commit

Permalink
Fixed imported location to match the copied location.
Browse files Browse the repository at this point in the history
  • Loading branch information
obsgolem committed Oct 10, 2024
1 parent d6566eb commit 89a6f2d
Show file tree
Hide file tree
Showing 18 changed files with 16 additions and 38 deletions.
2 changes: 1 addition & 1 deletion cmake/Corrosion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function(_corrosion_set_imported_location_deferred target_name base_property out
if(output_dir_curr_config)
set(curr_out_dir "${output_dir_curr_config}")
elseif(output_directory)
set(curr_out_dir "${output_directory}")
set(curr_out_dir "${output_directory}/${config_type}")
else()
set(curr_out_dir "${CMAKE_CURRENT_BINARY_DIR}")
endif()
Expand Down
2 changes: 0 additions & 2 deletions test/cargo_flags/cargo_flags/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions test/cbindgen/rust2cpp/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions test/cpp2rust/cpp2rust/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions test/features/features/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions test/gensource/gensource/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions test/gensource/gensource/generator/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions test/hostbuild/hostbuild/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions test/multitarget/multitarget/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions test/nostd/nostd/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 14 additions & 6 deletions test/output directory/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ if(CORROSION_TESTS_INSTALL_CORROSION)
set_tests_properties("output_directory_build" PROPERTIES FIXTURES_REQUIRED "fixture_corrosion_install")
endif()

get_cmake_property(IS_MULTI_CONFIG GENERATOR_IS_MULTI_CONFIG)

if (IS_MULTI_CONFIG)
set(config_path_str "$<CONFIG>/")
else()
set(config_path_str "")
endif()

foreach(output_approach targetprop var targetprop_pdb_fallback)
if(output_approach STREQUAL "targetprop")
set(rust_proj_suffix "1")
Expand All @@ -57,7 +65,7 @@ foreach(output_approach targetprop var targetprop_pdb_fallback)
COMMAND
"${CMAKE_COMMAND}"
-P "${CMAKE_CURRENT_SOURCE_DIR}/TestFileExists.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/build/custom_bin_${output_approach}/${bin_name}"
"${CMAKE_CURRENT_BINARY_DIR}/build/custom_bin_${output_approach}/${config_path_str}${bin_name}"
)
set_tests_properties("output_directory_bin_${output_approach}" PROPERTIES FIXTURES_REQUIRED "build_fixture_output_directory")

Expand All @@ -69,7 +77,7 @@ foreach(output_approach targetprop var targetprop_pdb_fallback)
COMMAND
"${CMAKE_COMMAND}"
-P "${CMAKE_CURRENT_SOURCE_DIR}/TestFileExists.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/build/custom_archive_${output_approach}/${static_lib_name}"
"${CMAKE_CURRENT_BINARY_DIR}/build/custom_archive_${output_approach}/${config_path_str}${static_lib_name}"
)
set_tests_properties("output_directory_staticlib_${output_approach}" PROPERTIES FIXTURES_REQUIRED "build_fixture_output_directory")

Expand All @@ -85,7 +93,7 @@ foreach(output_approach targetprop var targetprop_pdb_fallback)
COMMAND
"${CMAKE_COMMAND}"
-P "${CMAKE_CURRENT_SOURCE_DIR}/TestFileExists.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/build/custom_lib_${output_approach}/${dynamic_lib_name}"
"${CMAKE_CURRENT_BINARY_DIR}/build/custom_lib_${output_approach}/${config_path_str}${dynamic_lib_name}"
)
set_tests_properties("output_directory_cdylib_${output_approach}" PROPERTIES FIXTURES_REQUIRED "build_fixture_output_directory")

Expand All @@ -98,7 +106,7 @@ foreach(output_approach targetprop var targetprop_pdb_fallback)
-P "${CMAKE_CURRENT_SOURCE_DIR}/TestFileExists.cmake"
# Implib is an ARCHIVE artifact, see:
# https://cmake.org/cmake/help/v3.25/manual/cmake-buildsystem.7.html#archive-output-artifacts
"${CMAKE_CURRENT_BINARY_DIR}/build/custom_archive_${output_approach}/${implib_name}"
"${CMAKE_CURRENT_BINARY_DIR}/build/custom_archive_${output_approach}/${config_path_str}${implib_name}"
)
set_tests_properties("output_directory_implib_${output_approach}" PROPERTIES FIXTURES_REQUIRED "build_fixture_output_directory")

Expand All @@ -123,7 +131,7 @@ foreach(output_approach targetprop var targetprop_pdb_fallback)
COMMAND
"${CMAKE_COMMAND}"
-P "${CMAKE_CURRENT_SOURCE_DIR}/TestFileExists.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/build/${expected_lib_pdb_path}/${lib_pdb_name}"
"${CMAKE_CURRENT_BINARY_DIR}/build/${expected_lib_pdb_path}/${config_path_str}${lib_pdb_name}"
)
set_tests_properties("output_directory_cdylib_pdb_${output_approach}" PROPERTIES FIXTURES_REQUIRED "build_fixture_output_directory")

Expand All @@ -132,7 +140,7 @@ foreach(output_approach targetprop var targetprop_pdb_fallback)
COMMAND
"${CMAKE_COMMAND}"
-P "${CMAKE_CURRENT_SOURCE_DIR}/TestFileExists.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/build/${expected_bin_pdb_path}/${bin_pdb_name}"
"${CMAKE_CURRENT_BINARY_DIR}/build/${expected_bin_pdb_path}/${config_path_str}${bin_pdb_name}"
)
set_tests_properties("output_directory_bin_pdb_${output_approach}" PROPERTIES FIXTURES_REQUIRED "build_fixture_output_directory")
endif()
Expand Down
2 changes: 1 addition & 1 deletion test/output directory/output directory/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ add_custom_command(TARGET cargo-build_rust_bin1 POST_BUILD
COMMAND
${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/another_dir"
COMMAND
${CMAKE_COMMAND} -E copy_if_different "$<TARGET_PROPERTY:rust_bin1,LOCATION>" "${CMAKE_CURRENT_BINARY_DIR}/another_dir/moved_bin"
${CMAKE_COMMAND} -E copy_if_different "$<TARGET_PROPERTY:rust_bin1,LOCATION_$<CONFIG>>" "${CMAKE_CURRENT_BINARY_DIR}/another_dir/moved_bin"
)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/custom_bin_var")
Expand Down
2 changes: 0 additions & 2 deletions test/output directory/output directory/proj1/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions test/output directory/output directory/proj2/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions test/output directory/output directory/proj3/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions test/rustflags/cargo_config_rustflags/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions test/rustflags/rustflags/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions test/workspace/workspace/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 89a6f2d

Please sign in to comment.