-
-
Save rtkay123/36e83cee9318b9cff6a3167c6d15135c to your computer and use it in GitHub Desktop.
vosk-rs setup files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Relative to root of the project | |
const LIB_LINK_PATH: &str = "./lib"; | |
fn main() { | |
println!("cargo:rustc-link-search={LIB_LINK_PATH}"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[config] | |
default_to_workspace = false | |
[config.modify_core_tasks] | |
private = true | |
namespace = "core" | |
[env] | |
RUST_BACKTRACE = 0 | |
LIB_DIR = "./lib" | |
RESOURCE_DIR = "./resources" | |
# -- Development profile is the default | |
TARGET_DIR = "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/debug" | |
CARGO_MAKE_CARGO_BUILD_TEST_FLAGS = "" | |
# Directory where the .exe should be placed (except for dist task, same as TARGET_DIR) | |
OUT_DIR = "${TARGET_DIR}" | |
[env.release] | |
TARGET_DIR = "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/release" | |
CARGO_MAKE_CARGO_BUILD_TEST_FLAGS = "--release" | |
OUT_DIR = "${TARGET_DIR}" | |
[env.dist] | |
TARGET_DIR = "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/release" | |
CARGO_MAKE_CARGO_BUILD_TEST_FLAGS = "--release" | |
OUT_DIR = "./dist" | |
[tasks.build] | |
dependencies = ["core::build", "copy-libs", "copy-resources", "move-exe"] | |
[tasks.run] | |
dependencies = ["build", "cargo-run"] | |
[tasks.copy-libs] | |
private = true | |
script_runner = "@duckscript" | |
script = ''' | |
files = glob_array ${LIB_DIR}/* | |
for file in ${files} | |
file_name = basename ${file} | |
cp ${file} ${OUT_DIR}/${file_name} | |
end | |
''' | |
[tasks.copy-resources] | |
private = true | |
condition = { profiles = ["release"] } | |
script_runner = "@duckscript" | |
script = ''' | |
glob_cp ${RESOURCE_DIR}/**/* ${OUT_DIR} | |
''' | |
[tasks.move-exe] | |
private = true | |
condition = { profiles = ["dist"] } | |
script_runner = "@duckscript" | |
script = ''' | |
glob_cp ${TARGET_DIR}/*.exe ${OUT_DIR} | |
''' | |
[tasks.cargo-run] | |
private = true | |
command = "cargo" | |
args = [ | |
"run", | |
"@@remove-empty(CARGO_MAKE_CARGO_VERBOSE_FLAGS)", | |
"@@split(CARGO_MAKE_CARGO_BUILD_TEST_FLAGS, )", | |
"${@}" | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment