Skip to content

Commit

Permalink
Add an option to skip including corrosion, enabling only install rules (
Browse files Browse the repository at this point in the history
corrosion-rs#485)

In some environments (e.g. `vcpkg` testing environment) users may wish to install Corrosion, without including Rust.
Users can still install rust at a later point in time, in which case the installed Corrosion would work as expected, otherwise the installed Corrosion would simply report that it is unabled to find rust.

---------

Co-authored-by: Jonathan Schwender <[email protected]>
  • Loading branch information
bconn98 and jschwe authored Feb 9, 2024
1 parent 5b0a786 commit 0a3bdf4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ endif()
#
# It is strongly encouraged to install Corrosion separately and use
# `find_package(Corrosion REQUIRED)` instead if that works with your workflow.
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(Corrosion)
option(CORROSION_INSTALL_ONLY "Only add rules for installing Corrosion itself." OFF)
if (NOT CORROSION_INSTALL_ONLY)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(Corrosion)
endif()

# Testing
if (CORROSION_BUILD_TESTS)
Expand Down

0 comments on commit 0a3bdf4

Please sign in to comment.