mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-11 08:36:16 +00:00
added MOMO_BUILD_AS_LIBRARY
this allows to build the emulator as a static library. useful for using the project as a library
This commit is contained in:
@@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.26.4)
|
||||
##########################################
|
||||
|
||||
option(MOMO_ENABLE_SANITIZER "Enable sanitizer" OFF)
|
||||
option(MOMO_BUILD_AS_LIBRARY "Configure and Build the emulator as a shared library (without the samples and tests)" OFF)
|
||||
|
||||
##########################################
|
||||
|
||||
|
||||
@@ -2,11 +2,13 @@ add_subdirectory(common)
|
||||
add_subdirectory(emulator)
|
||||
add_subdirectory(unicorn-emulator)
|
||||
add_subdirectory(windows-emulator)
|
||||
add_subdirectory(analyzer)
|
||||
add_subdirectory(fuzzing-engine)
|
||||
add_subdirectory(fuzzer)
|
||||
if(WIN32)
|
||||
add_subdirectory(bad-sample)
|
||||
add_subdirectory(test-sample)
|
||||
if (NOT MOMO_BUILD_AS_LIBRARY)
|
||||
add_subdirectory(analyzer)
|
||||
add_subdirectory(fuzzing-engine)
|
||||
add_subdirectory(fuzzer)
|
||||
if(WIN32)
|
||||
add_subdirectory(bad-sample)
|
||||
add_subdirectory(test-sample)
|
||||
endif()
|
||||
add_subdirectory(windows-emulator-test)
|
||||
endif()
|
||||
add_subdirectory(windows-emulator-test)
|
||||
|
||||
@@ -6,7 +6,11 @@ file(GLOB_RECURSE SRC_FILES CONFIGURE_DEPENDS
|
||||
|
||||
list(SORT SRC_FILES)
|
||||
|
||||
add_library(unicorn-emulator SHARED ${SRC_FILES})
|
||||
if(MOMO_BUILD_AS_LIBRARY)
|
||||
add_library(unicorn-emulator STATIC ${SRC_FILES})
|
||||
else()
|
||||
add_library(unicorn-emulator SHARED ${SRC_FILES})
|
||||
endif()
|
||||
|
||||
target_include_directories(unicorn-emulator INTERFACE
|
||||
"${CMAKE_CURRENT_LIST_DIR}"
|
||||
|
||||
Reference in New Issue
Block a user