From f6089034cd8c9d2da4f82f6773758ea5db683dd2 Mon Sep 17 00:00:00 2001 From: Peter Matula Date: Mon, 15 Jan 2018 16:08:10 +0100 Subject: [PATCH] CMake: add RETDEC_DEV_TOOLS option. --- CMakeLists.txt | 1 + README.md | 1 + deps/CMakeLists.txt | 11 +++++------ src/CMakeLists.txt | 14 ++++++++++---- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 21f958a0..5c7cdf61 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,7 @@ endif() option(RETDEC_DOC "Build public API documentation (requires Doxygen)." OFF) option(RETDEC_TESTS "Build tests." OFF) +option(RETDEC_DEV_TOOLS "Build dev tools." OFF) set(CMAKE_CXX_STANDARD 14) diff --git a/README.md b/README.md index c45fcd31..8d6bde89 100644 --- a/README.md +++ b/README.md @@ -197,6 +197,7 @@ You have to pass the following parameters to `cmake`: You can pass the following additional parameters to `cmake`: * `-DRETDEC_DOC=ON` to build with API documentation (requires Doxygen and Graphviz, disabled by default). * `-DRETDEC_TESTS=ON` to build with tests (disabled by default). +* `-DRETDEC_DEV_TOOLS=ON` to build with development tools (disabled by default). * `-DCMAKE_BUILD_TYPE=Debug` to build with debugging information, which is useful during development. By default, the project is built in the `Release` mode. This has no effect on Windows, but the same thing can be achieved by running `cmake --build .` with the `--config Debug` parameter. * `-DCMAKE_PROGRAM_PATH=` to use Perl at `` (probably useful only on Windows). diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index 23b8d278..80fc801f 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -4,19 +4,18 @@ if(MSVC) endif() add_subdirectory(capstone) -if(RETDEC_TESTS) - add_subdirectory(googletest) -endif() add_subdirectory(jsoncpp) -add_subdirectory(keystone) add_subdirectory(llvm) add_subdirectory(openssl) add_subdirectory(rapidjson) add_subdirectory(tinyxml2) - - add_subdirectory(elfio) add_subdirectory(libdwarf) add_subdirectory(pelib) add_subdirectory(yaracpp) add_subdirectory(yaramod) + +if(RETDEC_TESTS) + add_subdirectory(googletest) + add_subdirectory(keystone) +endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 05397dce..a2eb3972 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,7 +4,6 @@ add_subdirectory(bin2llvmir) add_subdirectory(bin2llvmirtool) add_subdirectory(bin2pat) add_subdirectory(capstone2llvmir) -add_subdirectory(capstone2llvmirtool) # TODO: CAPSTONE2LLVMIR_TOOLS add_subdirectory(config) add_subdirectory(configtool) add_subdirectory(cpdetect) @@ -13,14 +12,11 @@ add_subdirectory(ctypes) add_subdirectory(ctypesparser) add_subdirectory(debugformat) add_subdirectory(demangler) -add_subdirectory(demangler_grammar_gen) # TODO: DEMANGLER_TOOLS -add_subdirectory(demanglertool) # TODO: DEMANGLER_TOOLS add_subdirectory(dwarfparser) add_subdirectory(fileformat) add_subdirectory(fileinfo) add_subdirectory(idr2pat) add_subdirectory(llvm-support) -add_subdirectory(llvmir-emul) # TODO: CAPSTONE2LLVMIR_TESTS add_subdirectory(llvmir2hll) add_subdirectory(llvmir2hlltool) add_subdirectory(loader) @@ -34,3 +30,13 @@ add_subdirectory(stacofintool) add_subdirectory(unpacker) add_subdirectory(unpackertool) add_subdirectory(utils) + +if(RETDEC_TESTS) + add_subdirectory(llvmir-emul) +endif() + +if(RETDEC_DEV_TOOLS) + add_subdirectory(capstone2llvmirtool) + add_subdirectory(demangler_grammar_gen) + add_subdirectory(demanglertool) +endif()