Skip to content

Commit

Permalink
Merge pull request #47800 from fastly/jkarneges/src-plain-makefile
Browse files Browse the repository at this point in the history
convert rust build from qmake project to plain makefile
  • Loading branch information
jkarneges authored Nov 27, 2023
2 parents 5942abe + f981156 commit 5c0a42b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 84 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ vendor
/conf.log
/conf.pri
/Makefile
/src/Makefile
/src/cpp/Makefile
/src/cpp/cpp/Makefile
/src/cpp/tests/Makefile
/src/rust/Makefile
/src/runner/certs/*.crt
/src/runner/certs/*.key
/postbuild/Makefile
Expand Down
11 changes: 5 additions & 6 deletions postbuild/postbuild.pro
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
TEMPLATE = aux
CONFIG -= debug_and_release debug

include($$OUT_PWD/../target/postbuild_conf.pri)

root_dir = $$PWD/..
bin_dir = $$root_dir/bin

CONFIG(debug, debug|release) {
cargo_flags =
target_dir = $$root_dir/target/debug
} else {
cargo_flags = --release
RELEASE = $$(RELEASE)

!isEmpty(RELEASE) {
target_dir = $$root_dir/target/release
} else {
target_dir = $$root_dir/target/debug
}

# copy bin files
Expand Down
18 changes: 18 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
ifdef RELEASE
cargo_flags = --offline --release
else
cargo_flags =
endif

all: build

build:
cd .. && cargo build $(cargo_flags)

clean:
cd .. && cargo clean

distclean: clean

check:
cd .. && cargo test $(cargo_flags)
71 changes: 0 additions & 71 deletions src/rust/rust.pro

This file was deleted.

5 changes: 0 additions & 5 deletions src/src.pro

This file was deleted.

0 comments on commit 5c0a42b

Please sign in to comment.