Merge branch 'mh/rust-crate-subdir' into seen
* mh/rust-crate-subdir: move rust gitcore crate to a different subdirectory
commit
5bb168cf0e
|
|
@ -1,6 +1,4 @@
|
|||
/fuzz_corpora
|
||||
/target/
|
||||
/Cargo.lock
|
||||
/GIT-BUILD-DIR
|
||||
/GIT-BUILD-OPTIONS
|
||||
/GIT-CFLAGS
|
||||
|
|
@ -263,3 +261,5 @@ Release/
|
|||
/contrib/buildsystems/out
|
||||
/contrib/libgit-rs/target
|
||||
/contrib/libgit-sys/target
|
||||
/rust/target
|
||||
/rust/Cargo.lock
|
||||
|
|
|
|||
24
Makefile
24
Makefile
|
|
@ -966,7 +966,7 @@ RUST_LIB_NAME = gitcore.lib
|
|||
else
|
||||
RUST_LIB_NAME = libgitcore.a
|
||||
endif
|
||||
RUST_LIB = target$(if $(CARGO_BUILD_TARGET),/$(CARGO_BUILD_TARGET))/$(RUST_BUILD_CONFIG)/$(RUST_LIB_NAME)
|
||||
RUST_LIB = rust/target$(if $(CARGO_BUILD_TARGET),/$(CARGO_BUILD_TARGET))/$(RUST_BUILD_CONFIG)/$(RUST_LIB_NAME)
|
||||
endif
|
||||
|
||||
GITLIBS = common-main.o $(LIB_FILE)
|
||||
|
|
@ -1585,11 +1585,11 @@ CLAR_TEST_OBJS += $(UNIT_TEST_DIR)/unit-test.o
|
|||
|
||||
UNIT_TEST_OBJS += $(UNIT_TEST_DIR)/test-lib.o
|
||||
|
||||
RUST_SOURCES += src/csum_file.rs
|
||||
RUST_SOURCES += src/hash.rs
|
||||
RUST_SOURCES += src/lib.rs
|
||||
RUST_SOURCES += src/loose.rs
|
||||
RUST_SOURCES += src/varint.rs
|
||||
RUST_SOURCES += rust/src/csum_file.rs
|
||||
RUST_SOURCES += rust/src/hash.rs
|
||||
RUST_SOURCES += rust/src/lib.rs
|
||||
RUST_SOURCES += rust/src/loose.rs
|
||||
RUST_SOURCES += rust/src/varint.rs
|
||||
|
||||
GIT-VERSION-FILE: FORCE
|
||||
@OLD=$$(cat $@ 2>/dev/null || :) && \
|
||||
|
|
@ -3070,8 +3070,8 @@ $(LIB_FILE): $(LIB_OBJS)
|
|||
|
||||
ifndef NO_RUST
|
||||
ifeq ($(RUST_TARGETS),)
|
||||
$(RUST_LIB): Cargo.toml $(RUST_SOURCES) $(LIB_FILE)
|
||||
$(QUIET_CARGO)cargo build $(CARGO_ARGS)
|
||||
$(RUST_LIB): rust/Cargo.toml $(RUST_SOURCES) $(LIB_FILE)
|
||||
$(QUIET_CARGO)cargo build --manifest-path rust/Cargo.toml $(CARGO_ARGS)
|
||||
else
|
||||
ifneq ($(words $(RUST_TARGETS)),1)
|
||||
ifneq ($(uname_S),Darwin)
|
||||
|
|
@ -3079,9 +3079,9 @@ $(error Building universal Rust libraries requires macOS (lipo is not available
|
|||
endif
|
||||
endif
|
||||
|
||||
RUST_MEMBER_LIBS = $(foreach target,$(RUST_TARGETS),target/$(target)/$(RUST_BUILD_CONFIG)/$(RUST_LIB_NAME))
|
||||
$(RUST_MEMBER_LIBS): target/%/$(RUST_BUILD_CONFIG)/$(RUST_LIB_NAME): Cargo.toml $(RUST_SOURCES) $(LIB_FILE)
|
||||
$(QUIET_CARGO)cargo build $(CARGO_ARGS) --target $*
|
||||
RUST_MEMBER_LIBS = $(foreach target,$(RUST_TARGETS),rust/target/$(target)/$(RUST_BUILD_CONFIG)/$(RUST_LIB_NAME))
|
||||
$(RUST_MEMBER_LIBS): rust/target/%/$(RUST_BUILD_CONFIG)/$(RUST_LIB_NAME): rust/Cargo.toml $(RUST_SOURCES) $(LIB_FILE)
|
||||
$(QUIET_CARGO)cargo build --manifest-path rust/Cargo.toml $(CARGO_ARGS) --target $*
|
||||
|
||||
$(RUST_LIB): $(RUST_MEMBER_LIBS)
|
||||
$(call mkdir_p_parent_template)
|
||||
|
|
@ -3948,7 +3948,7 @@ clean: profile-clean coverage-clean cocciclean
|
|||
$(RM) $(FUZZ_PROGRAMS)
|
||||
$(RM) $(SP_OBJ)
|
||||
$(RM) $(HCC)
|
||||
$(RM) -r Cargo.lock target/
|
||||
$(RM) -r rust/Cargo.lock rust/target/
|
||||
$(RM) version-def.h
|
||||
$(RM) -r $(dep_dirs) $(compdb_dir) compile_commands.json
|
||||
$(RM) $(test_bindir_programs)
|
||||
|
|
|
|||
|
|
@ -4,17 +4,17 @@
|
|||
|
||||
set +x
|
||||
|
||||
if ! group "Check Rust formatting" cargo fmt --all --check
|
||||
if ! group "Check Rust formatting" cargo fmt --manifest-path rust/Cargo.toml --all --check
|
||||
then
|
||||
RET=1
|
||||
fi
|
||||
|
||||
if ! group "Check for common Rust mistakes" cargo clippy --all-targets --all-features -- -Dwarnings
|
||||
if ! group "Check for common Rust mistakes" cargo clippy --manifest-path rust/Cargo.toml --all-targets --all-features -- -Dwarnings
|
||||
then
|
||||
RET=1
|
||||
fi
|
||||
|
||||
if ! group "Check for minimum required Rust version" cargo msrv verify
|
||||
if ! group "Check for minimum required Rust version" cargo msrv --path rust verify
|
||||
then
|
||||
RET=1
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -1801,7 +1801,7 @@ libgit_sources += version_def_h
|
|||
|
||||
rust_option = get_option('rust')
|
||||
if rust_option.allowed()
|
||||
subdir('src')
|
||||
subdir('rust')
|
||||
libgit_c_args += '-DWITH_RUST'
|
||||
|
||||
if host_machine.system() == 'windows'
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
libgit_rs_sources = [
|
||||
'csum_file.rs',
|
||||
'hash.rs',
|
||||
'lib.rs',
|
||||
'loose.rs',
|
||||
'varint.rs',
|
||||
'src/csum_file.rs',
|
||||
'src/hash.rs',
|
||||
'src/lib.rs',
|
||||
'src/loose.rs',
|
||||
'src/varint.rs',
|
||||
]
|
||||
|
||||
# Unfortunately we must use a wrapper command to move the output file into the
|
||||
|
|
@ -13,7 +13,7 @@ libgit_rs_sources = [
|
|||
cargo_command = [
|
||||
shell,
|
||||
meson.current_source_dir() / 'cargo-meson.sh',
|
||||
meson.project_source_root(),
|
||||
meson.current_source_dir(),
|
||||
meson.current_build_dir(),
|
||||
]
|
||||
if get_option('buildtype') == 'release'
|
||||
|
|
@ -22,7 +22,7 @@ endif
|
|||
|
||||
libgit_rs = custom_target('git_rs',
|
||||
input: libgit_rs_sources + [
|
||||
meson.project_source_root() / 'Cargo.toml',
|
||||
meson.current_source_dir() / 'Cargo.toml',
|
||||
],
|
||||
output: 'libgitcore.a',
|
||||
command: cargo_command,
|
||||
|
|
@ -35,7 +35,7 @@ if get_option('tests')
|
|||
args: [
|
||||
'test',
|
||||
'--manifest-path',
|
||||
meson.project_source_root() / 'Cargo.toml',
|
||||
meson.current_source_dir() / 'Cargo.toml',
|
||||
'--target-dir',
|
||||
meson.current_build_dir() / 'target',
|
||||
],
|
||||
Loading…
Reference in New Issue