diff options
| author | Mason Reed <mason@vector35.com> | 2025-01-25 15:41:29 -0500 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2025-01-25 15:41:29 -0500 |
| commit | e19a72a20d5cb35d6f3873f308a3a98d7046d762 (patch) | |
| tree | 10abaa9bdee57ab6a3dee67b0a972a388725cefe /plugins/pdb-ng | |
| parent | 26ed2cdfb13591c63a52e978ead5eae0b6acb0c4 (diff) | |
Fix statically linking PDB import plugin for demo builds
Diffstat (limited to 'plugins/pdb-ng')
| -rw-r--r-- | plugins/pdb-ng/CMakeLists.txt | 44 | ||||
| -rw-r--r-- | plugins/pdb-ng/demo/Cargo.toml | 7 |
2 files changed, 32 insertions, 19 deletions
diff --git a/plugins/pdb-ng/CMakeLists.txt b/plugins/pdb-ng/CMakeLists.txt index d0282c1a..5f409b38 100644 --- a/plugins/pdb-ng/CMakeLists.txt +++ b/plugins/pdb-ng/CMakeLists.txt @@ -15,11 +15,21 @@ file(GLOB_RECURSE API_SOURCES CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/../../rust/src/*.rs) if(CMAKE_BUILD_TYPE MATCHES Debug) - set(TARGET_DIR ${PROJECT_BINARY_DIR}/target/debug) - set(CARGO_OPTS --target-dir=${PROJECT_BINARY_DIR}/target) + if(DEMO) + set(TARGET_DIR ${PROJECT_BINARY_DIR}/target/dev-demo) + set(CARGO_OPTS --target-dir=${PROJECT_BINARY_DIR}/target --profile=dev-demo) + else() + set(TARGET_DIR ${PROJECT_BINARY_DIR}/target/debug) + set(CARGO_OPTS --target-dir=${PROJECT_BINARY_DIR}/target) + endif() else() - set(TARGET_DIR ${PROJECT_BINARY_DIR}/target/release) - set(CARGO_OPTS --target-dir=${PROJECT_BINARY_DIR}/target --release) + if(DEMO) + set(TARGET_DIR ${PROJECT_BINARY_DIR}/target/release-demo) + set(CARGO_OPTS --target-dir=${PROJECT_BINARY_DIR}/target --profile=release-demo) + else() + set(TARGET_DIR ${PROJECT_BINARY_DIR}/target/release) + set(CARGO_OPTS --target-dir=${PROJECT_BINARY_DIR}/target --release) + endif() endif() if(FORCE_COLORED_OUTPUT) @@ -60,11 +70,21 @@ set(RUSTUP_COMMAND ${RUSTUP_PATH} run ${CARGO_STABLE_VERSION} cargo) if(APPLE) if(UNIVERSAL) if(CMAKE_BUILD_TYPE MATCHES Debug) - set(AARCH64_LIB_PATH ${PROJECT_BINARY_DIR}/target/aarch64-apple-darwin/debug/${OUTPUT_FILE_NAME}) - set(X86_64_LIB_PATH ${PROJECT_BINARY_DIR}/target/x86_64-apple-darwin/debug/${OUTPUT_FILE_NAME}) + if(DEMO) + set(AARCH64_LIB_PATH ${PROJECT_BINARY_DIR}/target/aarch64-apple-darwin/dev-demo/${OUTPUT_FILE_NAME}) + set(X86_64_LIB_PATH ${PROJECT_BINARY_DIR}/target/x86_64-apple-darwin/dev-demo/${OUTPUT_FILE_NAME}) + else() + set(AARCH64_LIB_PATH ${PROJECT_BINARY_DIR}/target/aarch64-apple-darwin/debug/${OUTPUT_FILE_NAME}) + set(X86_64_LIB_PATH ${PROJECT_BINARY_DIR}/target/x86_64-apple-darwin/debug/${OUTPUT_FILE_NAME}) + endif() else() - set(AARCH64_LIB_PATH ${PROJECT_BINARY_DIR}/target/aarch64-apple-darwin/release/${OUTPUT_FILE_NAME}) - set(X86_64_LIB_PATH ${PROJECT_BINARY_DIR}/target/x86_64-apple-darwin/release/${OUTPUT_FILE_NAME}) + if(DEMO) + set(AARCH64_LIB_PATH ${PROJECT_BINARY_DIR}/target/aarch64-apple-darwin/release-demo/${OUTPUT_FILE_NAME}) + set(X86_64_LIB_PATH ${PROJECT_BINARY_DIR}/target/x86_64-apple-darwin/release-demo/${OUTPUT_FILE_NAME}) + else() + set(AARCH64_LIB_PATH ${PROJECT_BINARY_DIR}/target/aarch64-apple-darwin/release/${OUTPUT_FILE_NAME}) + set(X86_64_LIB_PATH ${PROJECT_BINARY_DIR}/target/x86_64-apple-darwin/release/${OUTPUT_FILE_NAME}) + endif() endif() add_custom_command( @@ -86,12 +106,6 @@ if(APPLE) DEPENDS ${PLUGIN_SOURCES} ${API_SOURCES} ) else() - if(CMAKE_BUILD_TYPE MATCHES Debug) - set(LIB_PATH ${PROJECT_BINARY_DIR}/target/debug/${OUTPUT_FILE_NAME}) - else() - set(LIB_PATH ${PROJECT_BINARY_DIR}/target/release/${OUTPUT_FILE_NAME}) - endif() - add_custom_command( OUTPUT ${OUTPUT_FILE_PATH} COMMAND ${CMAKE_COMMAND} -E env @@ -100,7 +114,7 @@ if(APPLE) COMMAND ${CMAKE_COMMAND} -E env MACOSX_DEPLOYMENT_TARGET=10.14 BINARYNINJADIR=${BINJA_LIB_DIR} ${RUSTUP_COMMAND} build ${CARGO_OPTS} ${CARGO_FEATURES} - COMMAND ${CMAKE_COMMAND} -E copy ${LIB_PATH} ${OUTPUT_FILE_PATH} + COMMAND ${CMAKE_COMMAND} -E copy ${TARGET_DIR}/${OUTPUT_FILE_NAME} ${OUTPUT_FILE_PATH} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} DEPENDS ${PLUGIN_SOURCES} ${API_SOURCES} ) diff --git a/plugins/pdb-ng/demo/Cargo.toml b/plugins/pdb-ng/demo/Cargo.toml index f9f446b5..3a36023f 100644 --- a/plugins/pdb-ng/demo/Cargo.toml +++ b/plugins/pdb-ng/demo/Cargo.toml @@ -9,12 +9,11 @@ path = "../src/lib.rs" [dependencies] anyhow = "^1.0" -binaryninja = {path = "../../../"} -home = "^0.5.5" +binaryninja = { workspace = true, features = ["demo"]} +binaryninjacore-sys.workspace = true itertools = "^0.11" log = "0.4" -pdb = { git = "https://github.com/Vector35/pdb-rs", branch = "master" } -cab = "^0.4" +pdb = { git = "https://github.com/Vector35/pdb-rs", rev = "6016177" } regex = "1" [features] |
