diff options
| author | Glenn Smith <glenn@vector35.com> | 2022-02-01 16:34:18 -0500 |
|---|---|---|
| committer | Glenn Smith <glenn@vector35.com> | 2022-02-02 19:22:08 -0500 |
| commit | b8af211f9a3647687c7e45c0fd04b0768df87ffe (patch) | |
| tree | 64f13fe262399189d70aadf33e1c6e33f0a74c3e /examples/x86_extension | |
| parent | 5f5785fd2b1cee6bc9a082e1209de00b1497d410 (diff) | |
Fancier CMake: find scripts, out-of-tree example builds
Diffstat (limited to 'examples/x86_extension')
| -rw-r--r-- | examples/x86_extension/CMakeLists.txt | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/examples/x86_extension/CMakeLists.txt b/examples/x86_extension/CMakeLists.txt index 8980ca60..9faf9c88 100644 --- a/examples/x86_extension/CMakeLists.txt +++ b/examples/x86_extension/CMakeLists.txt @@ -1,12 +1,23 @@ cmake_minimum_required(VERSION 3.9 FATAL_ERROR) -project(x86_extension CXX) +project(x86_extension CXX C) add_library(${PROJECT_NAME} SHARED src/x86_extension.cpp src/asmx86/asmx86.c src/asmx86/asmx86.h) +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(${PROJECT_NAME} binaryninjaapi) |
