Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to using Corrosion #222

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 8 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,29 +59,16 @@ list(APPEND sqfvm_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/git_sha1.cpp")
## ##
############################

include(ExternalProject)

find_program(CARGO cargo REQUIRED)

ExternalProject_Add(
fileio_ext
DOWNLOAD_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ${CARGO} build --release
SOURCE_DIR "${PROJECT_SOURCE_DIR}/src/fileio"
BUILD_IN_SOURCE ON
INSTALL_COMMAND ""
LOG_BUILD ON
)
include(FetchContent)

add_library(fileio INTERFACE)
add_dependencies(fileio fileio_ext)
target_include_directories(fileio INTERFACE "${PROJECT_SOURCE_DIR}/src/fileio")
target_link_libraries(fileio INTERFACE
# Below are examples
DEBUG "${PROJECT_SOURCE_DIR}/src/fileio/target/debug/fileio.dll"
OPTIMIZED "${PROJECT_SOURCE_DIR}/src/fileio/target/release/fileio.dll"
FetchContent_Declare(
Corrosion
GIT_REPOSITORY https://github.com/corrosion-rs/corrosion.git
GIT_TAG v0.4
)
FetchContent_MakeAvailable(Corrosion)

corrosion_import_crate(MANIFEST_PATH src/fileio/Cargo.toml)

############################
## ##
Expand Down
Loading