Skip to content

Commit

Permalink
Add to 'byproducts' list only files that corresponds to BUILD_SHARED_…
Browse files Browse the repository at this point in the history
…LIBS
  • Loading branch information
vdimir committed Nov 26, 2022
1 parent 7426f4a commit f84e33e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmake/Corrosion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -529,11 +529,11 @@ function(_corrosion_add_library_target workspace_manifest_path target_name has_s
set(pdb_name "${lib_name}.pdb")

set(archive_output_byproducts "")
if(has_staticlib)
if(has_staticlib AND NOT BUILD_SHARED_LIBS)
list(APPEND archive_output_byproducts ${static_lib_name})
endif()

if(has_cdylib)
if(has_cdylib AND BUILD_SHARED_LIBS)
set(${out_shared_lib_byproduct} "${dynamic_lib_name}" PARENT_SCOPE)
if(is_windows)
list(APPEND archive_output_byproducts ${implib_name})
Expand Down Expand Up @@ -1417,7 +1417,7 @@ endfunction()
# <cxx_target> is the name of the target created that will host the cxx interface
# CRATE <crate> is the name of the specific imported target generated by corrosion_import_crate
# FILES [<filePath, ...] is the relative paths to files with #[cxx::bridge]. These are relative to <tomlPath>/src
#
#
# Example: corrosion_add_cxxbridge(myCxxTarget CRATE someCrate FILES lib.rs)
function(corrosion_add_cxxbridge cxx_target)
set(OPTIONS)
Expand Down Expand Up @@ -1518,7 +1518,7 @@ function(corrosion_add_cxxbridge cxx_target)
set(generated_dir "${corrosion_generated_dir}/cxxbridge/${cxx_target}")
set(header_placement_dir "${generated_dir}/include/${cxx_target}")
set(source_placement_dir "${generated_dir}/src")

add_library(${cxx_target})
target_include_directories(${cxx_target}
PUBLIC
Expand Down

0 comments on commit f84e33e

Please sign in to comment.