Use corrosion instead of CMakeRust (#3273)

* Use corrosion instead of CMakeRust
* use OpenSUSE tumbleweed (latest) to get newer CMake
This commit is contained in:
Dustin J. Mitchell 2024-03-02 16:21:34 -05:00 committed by GitHub
parent 8dd29e0a8a
commit 18a8bd2997
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
47 changed files with 48 additions and 2786 deletions

View file

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.0)
cmake_minimum_required (VERSION 3.22)
include_directories (${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/src/tc
@ -52,9 +52,9 @@ add_executable (lex_executable lex.cpp)
# Yes, 'task' (and hence libshared) is included twice, otherwise linking fails on assorted OSes.
# Similarly for `tc`.
target_link_libraries (task_executable task tc tc-rust commands tc columns libshared task libshared ${TASK_LIBRARIES})
target_link_libraries (calc_executable task tc tc-rust commands tc columns libshared task libshared ${TASK_LIBRARIES})
target_link_libraries (lex_executable task tc tc-rust commands tc columns libshared task libshared ${TASK_LIBRARIES})
target_link_libraries (task_executable task tc commands tc columns libshared task libshared ${TASK_LIBRARIES})
target_link_libraries (calc_executable task tc commands tc columns libshared task libshared ${TASK_LIBRARIES})
target_link_libraries (lex_executable task tc commands tc columns libshared task libshared ${TASK_LIBRARIES})
if (DARWIN)
# SystemConfiguration is required by Rust libraries like reqwest, to get proxy configuration.
target_link_libraries (task_executable "-framework CoreFoundation -framework Security -framework SystemConfiguration")

View file

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.0)
cmake_minimum_required (VERSION 3.22)
include_directories (${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/src/tc

View file

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.0)
cmake_minimum_required (VERSION 3.22)
include_directories (${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/src/tc

1
src/tc/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
libtaskchampion_lib.a

View file

@ -1,4 +1,18 @@
cmake_minimum_required (VERSION 3.0)
cmake_minimum_required (VERSION 3.22)
FetchContent_Declare (
Corrosion
GIT_REPOSITORY https://github.com/corrosion-rs/corrosion.git
GIT_TAG v0.4.7
)
FetchContent_MakeAvailable(Corrosion)
# Import taskchampion-lib as a CMake library.
corrosion_import_crate(
MANIFEST_PATH "${CMAKE_SOURCE_DIR}/Cargo.toml"
LOCKED
CRATES "taskchampion-lib")
include_directories (${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/src/tc
@ -15,3 +29,4 @@ set (tc_SRCS
Task.cpp Task.h)
add_library (tc STATIC ${tc_SRCS})
target_link_libraries(tc taskchampion-lib)

View file

@ -1,4 +0,0 @@
target
x86_64-unknown-linux-gnu
aarch64-apple-darwin
.rustc_info.json

View file

@ -1 +0,0 @@
cargo_build(NAME tc-rust)

2068
src/tc/rust/Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,10 +0,0 @@
[package]
name = "tc-rust"
version = "0.1.0"
[lib]
crate-type = ["staticlib"]
[dependencies]
taskchampion = { path = "../../../taskchampion/taskchampion", features = ["server-gcp", "server-sync"] }
taskchampion-lib = { path = "../../../taskchampion/lib" }

View file

@ -1,2 +0,0 @@
extern crate taskchampion_lib;
pub use taskchampion_lib::*;