Skip to content

Commit

Permalink
Fix: add extension to cxxbridge path (#550)
Browse files Browse the repository at this point in the history
* Fix: installed cxxbridge path should has extension

* Fix: detect extension by host
  • Loading branch information
Kr328 authored Aug 12, 2024
1 parent a94c5e6 commit f6ccb71
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cmake/Corrosion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1462,7 +1462,11 @@ function(corrosion_add_cxxbridge cxx_target)
# No suitable version of cxxbridge was installed, so use custom target to build correct version.
if(NOT cxxbridge)
if(NOT TARGET "cxxbridge_v${cxx_required_version}")
add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/corrosion/cxxbridge_v${cxx_required_version}/bin/cxxbridge"
unset(executable_postfix)
if(Rust_CARGO_HOST_OS STREQUAL "windows")
set(executable_postfix ".exe")
endif()
add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/corrosion/cxxbridge_v${cxx_required_version}/bin/cxxbridge${executable_postfix}"
COMMAND
${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/corrosion/cxxbridge_v${cxx_required_version}"
COMMAND
Expand All @@ -1477,10 +1481,10 @@ function(corrosion_add_cxxbridge cxx_target)
COMMENT "Building cxxbridge (version ${cxx_required_version})"
)
add_custom_target("cxxbridge_v${cxx_required_version}"
DEPENDS "${CMAKE_BINARY_DIR}/corrosion/cxxbridge_v${cxx_required_version}/bin/cxxbridge"
DEPENDS "${CMAKE_BINARY_DIR}/corrosion/cxxbridge_v${cxx_required_version}/bin/cxxbridge${executable_postfix}"
)
endif()
set(cxxbridge "${CMAKE_BINARY_DIR}/corrosion/cxxbridge_v${cxx_required_version}/bin/cxxbridge")
set(cxxbridge "${CMAKE_BINARY_DIR}/corrosion/cxxbridge_v${cxx_required_version}/bin/cxxbridge${executable_postfix}")
endif()


Expand Down

0 comments on commit f6ccb71

Please sign in to comment.