diff options
| author | Xusheng <xusheng@vector35.com> | 2020-11-06 14:08:40 +0800 |
|---|---|---|
| committer | Xusheng <xusheng@vector35.com> | 2020-11-06 17:02:20 +0800 |
| commit | 7f7244419b3776f69ad2140995299eef3f6a3257 (patch) | |
| tree | c0f1221ac4edbb9341504911d6a6bee28354de14 /CMakeLists.txt | |
| parent | 0d28293999682389b0eb09128dba99b2723a6efb (diff) | |
fix UI plugin build and update build instructions
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b024a3a8..e812c14a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,6 +53,20 @@ if((NOT BN_CORE_LIBRARY) AND (NOT BN_INTERNAL_BUILD)) endif() endif() +if(NOT HEADLESS) + if((NOT BN_UI_LIBRARY) AND (NOT BN_INTERNAL_BUILD)) + find_library(BN_UI_LIBRARY + NAMES binaryninjaui libbinaryninjaui.so.1 + PATHS ${BN_INSTALL_BIN_DIR}) + + if(BN_UI_LIBRARY) + message(STATUS "Binary Ninja UI: ${BN_UI_LIBRARY}") + else() + message(FATAL_ERROR "Binary Ninja UI Not Found") + endif() + endif() +endif() + file(GLOB BN_API_SOURCES *.cpp *.h json/json.h json/json-forwards.h) if(NOT DEMO) list(APPEND BN_API_SOURCES json/jsoncpp.cpp) @@ -69,6 +83,16 @@ else() target_link_libraries(binaryninjaapi binaryninjacore) endif() +if(NOT HEADLESS) + target_include_directories(binaryninjaapi PUBLIC ${PROJECT_SOURCE_DIR}/ui) + + if(NOT BN_INTERNAL_BUILD) + target_link_libraries(binaryninjaapi ${BN_UI_LIBRARY}) + else() + target_link_libraries(binaryninjaapi) + endif() +endif() + set_target_properties(binaryninjaapi PROPERTIES CXX_STANDARD 17 CXX_VISIBILITY_PRESET hidden |
