Skip to content

Commit dac4b54

Browse files
committed
More verbose debug logging
1 parent c228443 commit dac4b54

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

rust/binaryninjacore-sys/build.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,17 @@ fn generate_stubs() -> PathBuf {
5151
.unwrap();
5252

5353
let stubs_path = api_base_path.join("stubs");
54-
cmake::build(stubs_path).join("build")
54+
let mut cmake_config = cmake::Config::new(stubs_path);
55+
56+
if cfg!(target_os = "windows") {
57+
cmake_config.build_arg("-clp:ShowCommandLine");
58+
}
59+
else {
60+
cmake_config.build_arg("VERBOSE=1");
61+
}
62+
cmake_config
63+
.build()
64+
.join("build")
5565
}
5666

5767
fn main() {

stubs/CMakeLists.txt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22
project(binaryninjacore_stubs)
33

4-
file(REAL_PATH "${PROJECT_SOURCE_DIR}/../" ABSOLUTE_API_PATH)
5-
64
# Generate stubs.cpp with implementations of all the BNAPI functions
7-
execute_process(COMMAND python ${PROJECT_SOURCE_DIR}/generate_stubs.py ${ABSOLUTE_API_PATH}/binaryninjacore.h ${PROJECT_BINARY_DIR})
5+
execute_process(COMMAND python ${PROJECT_SOURCE_DIR}/generate_stubs.py ${PROJECT_SOURCE_DIR}/../binaryninjacore.h ${PROJECT_BINARY_DIR})
86

97
# Compile those stubs into a stub library we can use to fool the linker
108
add_library(binaryninjacore_stubs SHARED ${PROJECT_BINARY_DIR}/stubs.cpp)
@@ -20,6 +18,14 @@ set_target_properties(binaryninjacore_stubs
2018
ARCHIVE_OUTPUT_DIRECTORY $<1:${PROJECT_BINARY_DIR}>
2119
)
2220

23-
target_include_directories(binaryninjacore_stubs PUBLIC ${ABSOLUTE_API_PATH})
21+
get_target_property(LIB_INCLUDES binaryninjacore_stubs INCLUDE_DIRECTORIES)
22+
message(STATUS "Include directories for binaryninjacore_stubs: ${LIB_INCLUDES}")
23+
24+
message(STATUS "Adding include path ..")
25+
26+
target_include_directories(binaryninjacore_stubs PUBLIC ..)
27+
28+
get_target_property(LIB_INCLUDES binaryninjacore_stubs INCLUDE_DIRECTORIES)
29+
message(STATUS "Include directories for binaryninjacore_stubs: ${LIB_INCLUDES}")
2430

2531
install(TARGETS binaryninjacore_stubs LIBRARY DESTINATION ${PROJECT_BINARY_DIR})

0 commit comments

Comments
 (0)