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

copy bins from postbuild #47791

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
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
57 changes: 57 additions & 0 deletions postbuild/postbuild.pro
Original file line number Diff line number Diff line change
@@ -1,10 +1,67 @@
TEMPLATE = aux
CONFIG -= debug_and_release debug

include($$OUT_PWD/../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
target_dir = $$root_dir/target/release
}

# copy bin files

condure_bin.target = $$bin_dir/condure
condure_bin.depends = $$target_dir/condure
condure_bin.commands = mkdir -p $$bin_dir && cp -a $$target_dir/condure $$bin_dir/condure

m2adapter_bin.target = $$bin_dir/m2adapter
m2adapter_bin.depends = $$target_dir/m2adapter
m2adapter_bin.commands = mkdir -p $$bin_dir && cp -a $$target_dir/m2adapter $$bin_dir/m2adapter

proxy_bin.target = $$bin_dir/pushpin-proxy
proxy_bin.depends = $$target_dir/pushpin-proxy
proxy_bin.commands = mkdir -p $$bin_dir && cp -a $$target_dir/pushpin-proxy $$bin_dir/pushpin-proxy

handler_bin.target = $$bin_dir/pushpin-handler
handler_bin.depends = $$target_dir/pushpin-handler
handler_bin.commands = mkdir -p $$bin_dir && cp -a $$target_dir/pushpin-handler $$bin_dir/pushpin-handler

runner_legacy_bin.target = $$root_dir/pushpin-legacy
runner_legacy_bin.depends = $$target_dir/pushpin-legacy
runner_legacy_bin.commands = cp -a $$target_dir/pushpin-legacy $$root_dir/pushpin-legacy

runner_bin.target = $$root_dir/pushpin
runner_bin.depends = $$target_dir/pushpin
runner_bin.commands = cp -a $$target_dir/pushpin $$root_dir/pushpin

publish_bin.target = $$bin_dir/pushpin-publish
publish_bin.depends = $$target_dir/pushpin-publish
publish_bin.commands = mkdir -p $$bin_dir && cp -a $$target_dir/pushpin-publish $$bin_dir/pushpin-publish

QMAKE_EXTRA_TARGETS += \
condure_bin \
m2adapter_bin \
proxy_bin \
handler_bin \
runner_legacy_bin \
runner_bin \
publish_bin

PRE_TARGETDEPS += \
$$bin_dir/condure \
$$bin_dir/m2adapter \
$$bin_dir/pushpin-proxy \
$$bin_dir/pushpin-handler \
$$root_dir/pushpin-legacy \
$$root_dir/pushpin \
$$bin_dir/pushpin-publish

# generate pushpin.conf for installation

pushpin_conf_inst.target = pushpin.conf.inst
Expand Down
59 changes: 10 additions & 49 deletions src/rust/rust.pro
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
TEMPLATE = aux
OBJECTS_DIR = ./
DESTDIR = ./
CONFIG -= debug_and_release debug

include($$OUT_PWD/../../conf.pri)

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

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

check.commands = cd "$$root_dir" && cargo test --offline $$cargo_flags
Expand Down Expand Up @@ -50,35 +47,6 @@ publish_build.target = $$target_dir/pushpin-publish
publish_build.depends = rust_build
publish_build.commands = @:

condure_bin.target = $$bin_dir/condure
condure_bin.depends = condure_build
condure_bin.commands = mkdir -p $$bin_dir && cp -a $$target_dir/condure $$bin_dir/condure

m2adapter_bin.target = $$bin_dir/m2adapter
m2adapter_bin.depends = m2adapter_build
m2adapter_bin.commands = mkdir -p $$bin_dir && cp -a $$target_dir/m2adapter $$bin_dir/m2adapter

proxy_bin.target = $$bin_dir/pushpin-proxy
proxy_bin.depends = proxy_build
proxy_bin.commands = mkdir -p $$bin_dir && cp -a $$target_dir/pushpin-proxy $$bin_dir/pushpin-proxy

handler_bin.target = $$bin_dir/pushpin-handler
handler_bin.depends = handler_build
handler_bin.commands = mkdir -p $$bin_dir && cp -a $$target_dir/pushpin-handler $$bin_dir/pushpin-handler

runner_legacy_bin.target = $$root_dir/pushpin-legacy
runner_legacy_bin.depends = runner_legacy_build
runner_legacy_bin.commands = cp -a $$target_dir/pushpin-legacy $$root_dir/pushpin-legacy

runner_bin.target = $$root_dir/pushpin
runner_bin.depends = runner_build
runner_bin.commands = cp -a $$target_dir/pushpin $$root_dir/pushpin

publish_bin.target = $$bin_dir/pushpin-publish
publish_bin.depends = publish_build
publish_bin.commands = mkdir -p $$bin_dir && cp -a $$target_dir/pushpin-publish $$bin_dir/pushpin-publish


QMAKE_EXTRA_TARGETS += \
check \
rust_build \
Expand All @@ -89,24 +57,17 @@ QMAKE_EXTRA_TARGETS += \
handler_build \
runner_legacy_build \
runner_build \
publish_build \
condure_bin \
m2adapter_bin \
proxy_bin \
handler_bin \
runner_legacy_bin \
runner_bin \
publish_bin
publish_build

# make built-in clean depend on rust_clean
clean.depends = rust_clean
QMAKE_EXTRA_TARGETS += clean

PRE_TARGETDEPS += \
$$bin_dir/condure \
$$bin_dir/m2adapter \
$$bin_dir/pushpin-proxy \
$$bin_dir/pushpin-handler \
$$root_dir/pushpin-legacy \
$$root_dir/pushpin \
$$bin_dir/pushpin-publish
$$target_dir/condure \
$$target_dir/m2adapter \
$$target_dir/pushpin-proxy \
$$target_dir/pushpin-handler \
$$target_dir/pushpin-legacy \
$$target_dir/pushpin \
$$target_dir/pushpin-publish
Loading