summaryrefslogtreecommitdiff
path: root/examples/workflows
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2022-02-01 16:34:18 -0500
committerGlenn Smith <glenn@vector35.com>2022-02-02 19:22:08 -0500
commitb8af211f9a3647687c7e45c0fd04b0768df87ffe (patch)
tree64f13fe262399189d70aadf33e1c6e33f0a74c3e /examples/workflows
parent5f5785fd2b1cee6bc9a082e1209de00b1497d410 (diff)
Fancier CMake: find scripts, out-of-tree example builds
Diffstat (limited to 'examples/workflows')
-rw-r--r--examples/workflows/inliner/CMakeLists.txt11
-rw-r--r--examples/workflows/objectivec/CMakeLists.txt11
-rw-r--r--examples/workflows/tailcall/CMakeLists.txt11
3 files changed, 33 insertions, 0 deletions
diff --git a/examples/workflows/inliner/CMakeLists.txt b/examples/workflows/inliner/CMakeLists.txt
index c42d580e..0a271d4b 100644
--- a/examples/workflows/inliner/CMakeLists.txt
+++ b/examples/workflows/inliner/CMakeLists.txt
@@ -9,6 +9,17 @@ file(GLOB SOURCES
add_library(workflow_inliner SHARED ${SOURCES})
+if(NOT BN_API_BUILD_EXAMPLES)
+ # Out-of-tree build
+ find_path(
+ BN_API_DIR
+ NAMES binaryninjaapi.h
+ HINTS ../../.. binaryninjaapi $ENV{BN_API_DIR}
+ REQUIRED
+ )
+ add_subdirectory(${BN_API_DIR} api)
+endif()
+
target_link_libraries(workflow_inliner binaryninjaapi)
set_target_properties(workflow_inliner PROPERTIES
diff --git a/examples/workflows/objectivec/CMakeLists.txt b/examples/workflows/objectivec/CMakeLists.txt
index f5f8ea5e..a4c0198a 100644
--- a/examples/workflows/objectivec/CMakeLists.txt
+++ b/examples/workflows/objectivec/CMakeLists.txt
@@ -9,6 +9,17 @@ file(GLOB SOURCES
add_library(workflow_objectivec SHARED ${SOURCES})
+if(NOT BN_API_BUILD_EXAMPLES)
+ # Out-of-tree build
+ find_path(
+ BN_API_DIR
+ NAMES binaryninjaapi.h
+ HINTS ../../.. binaryninjaapi $ENV{BN_API_DIR}
+ REQUIRED
+ )
+ add_subdirectory(${BN_API_DIR} api)
+endif()
+
target_link_libraries(workflow_objectivec binaryninjaapi)
set_target_properties(workflow_objectivec PROPERTIES
diff --git a/examples/workflows/tailcall/CMakeLists.txt b/examples/workflows/tailcall/CMakeLists.txt
index fa322684..6d7e5eb0 100644
--- a/examples/workflows/tailcall/CMakeLists.txt
+++ b/examples/workflows/tailcall/CMakeLists.txt
@@ -9,6 +9,17 @@ file(GLOB SOURCES
add_library(workflow_tailcall SHARED ${SOURCES})
+if(NOT BN_API_BUILD_EXAMPLES)
+ # Out-of-tree build
+ find_path(
+ BN_API_DIR
+ NAMES binaryninjaapi.h
+ HINTS ../../.. binaryninjaapi $ENV{BN_API_DIR}
+ REQUIRED
+ )
+ add_subdirectory(${BN_API_DIR} api)
+endif()
+
target_link_libraries(workflow_tailcall binaryninjaapi)
set_target_properties(workflow_tailcall PROPERTIES