project(LIEF) # Silence Warnings add_compile_options(-w -Wno-psabi) ## LIEF # Options set(BUILD_SHARED_LIBS TRUE CACHE BOOL "" FORCE) set(LIEF_C_API FALSE CACHE BOOL "" FORCE) set(LIEF_EXAMPLES FALSE CACHE BOOL "" FORCE) set(LIEF_PYTHON_API FALSE CACHE BOOL "" FORCE) set(LIEF_TESTS FALSE CACHE BOOL "" FORCE) set(LIEF_USE_CCACHE FALSE CACHE BOOL "" FORCE) set(LIEF_LOGGING FALSE CACHE BOOL "" FORCE) set(LIEF_LOGGING_DEBUG FALSE CACHE BOOL "" FORCE) set(LIEF_ENABLE_JSON FALSE CACHE BOOL "" FORCE) set(LIEF_ELF TRUE CACHE BOOL "" FORCE) set(LIEF_PE FALSE CACHE BOOL "" FORCE) set(LIEF_MACHO FALSE CACHE BOOL "" FORCE) set(LIEF_DEX FALSE CACHE BOOL "" FORCE) set(LIEF_ART FALSE CACHE BOOL "" FORCE) set(LIEF_OAT FALSE CACHE BOOL "" FORCE) set(LIEF_VDEX FALSE CACHE BOOL "" FORCE) # Download set(MESSAGE_QUIET TRUE) add_subdirectory(src EXCLUDE_FROM_ALL) unset(MESSAGE_QUIET) # Install setup_library(LIB_LIEF TRUE TRUE) # License install(FILES src/LICENSE DESTINATION "${MCPI_LEGAL_DIR}/LIEF") # Fix Flags function(fix_flags property) get_target_property(flags LIB_LIEF "${property}") list(REMOVE_ITEM flags "_GLIBCXX_USE_CXX11_ABI=1") set_target_properties(LIB_LIEF PROPERTIES "${property}" "${flags}") endfunction() fix_flags(COMPILE_DEFINITIONS) fix_flags(INTERFACE_COMPILE_DEFINITIONS)