Skip to content

Commit

Permalink
Support custom profile for CorrosionGenerator.cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
crabtw committed Jan 26, 2022
1 parent a11ba3b commit 2a11e75
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions cmake/Corrosion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,8 @@ function(corrosion_import_crate)
"${CMAKE_CONFIGURATION_TYPES}"
CRATES
"${COR_CRATES}"
PROFILE
"${COR_PROFILE}"
)
else()
execute_process(
Expand Down
6 changes: 4 additions & 2 deletions cmake/CorrosionGenerator.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function(_generator_parse_target manifest package target)
)
endfunction()

function(_generator_add_target manifest ix cargo_version)
function(_generator_add_target manifest ix cargo_version profile)
get_source_file_property(package_name ${manifest} CORROSION_TARGET${ix}_PACKAGE_NAME)
get_source_file_property(manifest_path ${manifest} CORROSION_TARGET${ix}_MANIFEST_PATH)
get_source_file_property(target_name ${manifest} CORROSION_TARGET${ix}_TARGET_NAME)
Expand Down Expand Up @@ -242,6 +242,7 @@ function(_generator_add_target manifest ix cargo_version)
TARGET ${target_name}
MANIFEST_PATH "${manifest_path}"
BYPRODUCTS ${byproducts}
PROFILE "${profile}"
)

if(is_library)
Expand Down Expand Up @@ -366,7 +367,7 @@ endfunction()

function(_generator_add_cargo_targets)
set(options "")
set(one_value_args MANIFEST_PATH CONFIGURATION_ROOT CONFIGURATION_TYPE TARGET CARGO_VERSION)
set(one_value_args MANIFEST_PATH CONFIGURATION_ROOT CONFIGURATION_TYPE TARGET CARGO_VERSION PROFILE)
set(multi_value_args CONFIGURATION_TYPES CRATES)
cmake_parse_arguments(
GGC
Expand Down Expand Up @@ -446,6 +447,7 @@ function(_generator_add_cargo_targets)
${GGC_MANIFEST_PATH}
${ix}
${GGC_CARGO_VERSION}
"${GGC_PROFILE}"
)
endforeach()

Expand Down

0 comments on commit 2a11e75

Please sign in to comment.