build: Fix various issues with linking, clang and unity builds
This commit is contained in:
parent
2e74a78f46
commit
76e304c34e
@ -299,6 +299,8 @@ macro(configureCMake)
|
|||||||
# Enable C and C++ languages
|
# Enable C and C++ languages
|
||||||
enable_language(C CXX)
|
enable_language(C CXX)
|
||||||
|
|
||||||
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON CACHE BOOL "Enable position independent code for all targets" FORCE)
|
||||||
|
|
||||||
# Configure use of recommended build tools
|
# Configure use of recommended build tools
|
||||||
if (IMHEX_USE_DEFAULT_BUILD_SETTINGS)
|
if (IMHEX_USE_DEFAULT_BUILD_SETTINGS)
|
||||||
message(STATUS "Configuring CMake to use recommended build tools...")
|
message(STATUS "Configuring CMake to use recommended build tools...")
|
||||||
@ -483,7 +485,6 @@ endfunction()
|
|||||||
|
|
||||||
macro(setupCompilerFlags target)
|
macro(setupCompilerFlags target)
|
||||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
||||||
|
|
||||||
# Define strict compilation flags
|
# Define strict compilation flags
|
||||||
if (IMHEX_STRICT_WARNINGS)
|
if (IMHEX_STRICT_WARNINGS)
|
||||||
set(IMHEX_COMMON_FLAGS "${IMHEX_COMMON_FLAGS} -Wall -Wextra -Wpedantic -Werror")
|
set(IMHEX_COMMON_FLAGS "${IMHEX_COMMON_FLAGS} -Wall -Wextra -Wpedantic -Werror")
|
||||||
@ -497,7 +498,9 @@ macro(setupCompilerFlags target)
|
|||||||
|
|
||||||
# Disable some warnings
|
# Disable some warnings
|
||||||
set(IMHEX_C_CXX_FLAGS "-Wno-unknown-warning-option -Wno-array-bounds -Wno-deprecated-declarations")
|
set(IMHEX_C_CXX_FLAGS "-Wno-unknown-warning-option -Wno-array-bounds -Wno-deprecated-declarations")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||||
if (IMHEX_ENABLE_UNITY_BUILD AND WIN32)
|
if (IMHEX_ENABLE_UNITY_BUILD AND WIN32)
|
||||||
set(IMHEX_COMMON_FLAGS "${IMHEX_COMMON_FLAGS} -Wa,-mbig-obj")
|
set(IMHEX_COMMON_FLAGS "${IMHEX_COMMON_FLAGS} -Wa,-mbig-obj")
|
||||||
endif ()
|
endif ()
|
||||||
@ -541,23 +544,14 @@ macro(addBundledLibraries)
|
|||||||
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/imgui)
|
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/imgui)
|
||||||
|
|
||||||
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/microtar EXCLUDE_FROM_ALL)
|
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/microtar EXCLUDE_FROM_ALL)
|
||||||
set_target_properties(microtar PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
||||||
|
|
||||||
add_subdirectory(${EXTERNAL_LIBS_FOLDER}/libwolv EXCLUDE_FROM_ALL)
|
add_subdirectory(${EXTERNAL_LIBS_FOLDER}/libwolv EXCLUDE_FROM_ALL)
|
||||||
set_property(TARGET libwolv-types PROPERTY POSITION_INDEPENDENT_CODE ON)
|
|
||||||
set_property(TARGET libwolv-utils PROPERTY POSITION_INDEPENDENT_CODE ON)
|
|
||||||
set_property(TARGET libwolv-io PROPERTY POSITION_INDEPENDENT_CODE ON)
|
|
||||||
set_property(TARGET libwolv-hash PROPERTY POSITION_INDEPENDENT_CODE ON)
|
|
||||||
set_property(TARGET libwolv-containers PROPERTY POSITION_INDEPENDENT_CODE ON)
|
|
||||||
set_property(TARGET libwolv-net PROPERTY POSITION_INDEPENDENT_CODE ON)
|
|
||||||
set_property(TARGET libwolv-math_eval PROPERTY POSITION_INDEPENDENT_CODE ON)
|
|
||||||
|
|
||||||
set(XDGPP_INCLUDE_DIRS "${THIRD_PARTY_LIBS_FOLDER}/xdgpp")
|
set(XDGPP_INCLUDE_DIRS "${THIRD_PARTY_LIBS_FOLDER}/xdgpp")
|
||||||
set(FPHSA_NAME_MISMATCHED ON CACHE BOOL "")
|
set(FPHSA_NAME_MISMATCHED ON CACHE BOOL "")
|
||||||
|
|
||||||
if(NOT USE_SYSTEM_FMT)
|
if(NOT USE_SYSTEM_FMT)
|
||||||
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/fmt EXCLUDE_FROM_ALL)
|
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/fmt EXCLUDE_FROM_ALL)
|
||||||
set_target_properties(fmt PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
||||||
set(FMT_LIBRARIES fmt::fmt-header-only)
|
set(FMT_LIBRARIES fmt::fmt-header-only)
|
||||||
else()
|
else()
|
||||||
find_package(fmt REQUIRED)
|
find_package(fmt REQUIRED)
|
||||||
@ -577,7 +571,6 @@ macro(addBundledLibraries)
|
|||||||
# nfd
|
# nfd
|
||||||
if (NOT USE_SYSTEM_NFD)
|
if (NOT USE_SYSTEM_NFD)
|
||||||
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/nativefiledialog EXCLUDE_FROM_ALL)
|
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/nativefiledialog EXCLUDE_FROM_ALL)
|
||||||
set_target_properties(nfd PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
||||||
set(NFD_LIBRARIES nfd)
|
set(NFD_LIBRARIES nfd)
|
||||||
else()
|
else()
|
||||||
find_package(nfd)
|
find_package(nfd)
|
||||||
@ -595,7 +588,6 @@ macro(addBundledLibraries)
|
|||||||
|
|
||||||
if (NOT USE_SYSTEM_LLVM)
|
if (NOT USE_SYSTEM_LLVM)
|
||||||
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/llvm-demangle EXCLUDE_FROM_ALL)
|
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/llvm-demangle EXCLUDE_FROM_ALL)
|
||||||
set_target_properties(LLVMDemangle PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
||||||
else()
|
else()
|
||||||
find_package(LLVM REQUIRED Demangle)
|
find_package(LLVM REQUIRED Demangle)
|
||||||
endif()
|
endif()
|
||||||
@ -618,7 +610,6 @@ macro(addBundledLibraries)
|
|||||||
set_target_properties(
|
set_target_properties(
|
||||||
libpl
|
libpl
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
POSITION_INDEPENDENT_CODE ON
|
|
||||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
|
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||||
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
|
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||||
)
|
)
|
||||||
|
@ -45,7 +45,6 @@ macro(add_imhex_plugin)
|
|||||||
target_compile_definitions(${IMHEX_PLUGIN_NAME} PRIVATE IMHEX_PLUGIN_NAME=${IMHEX_PLUGIN_NAME})
|
target_compile_definitions(${IMHEX_PLUGIN_NAME} PRIVATE IMHEX_PLUGIN_NAME=${IMHEX_PLUGIN_NAME})
|
||||||
|
|
||||||
# Enable required compiler flags
|
# Enable required compiler flags
|
||||||
set_target_properties(${IMHEX_PLUGIN_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
||||||
enableUnityBuild(${IMHEX_PLUGIN_NAME})
|
enableUnityBuild(${IMHEX_PLUGIN_NAME})
|
||||||
setupCompilerFlags(${IMHEX_PLUGIN_NAME})
|
setupCompilerFlags(${IMHEX_PLUGIN_NAME})
|
||||||
|
|
||||||
@ -67,7 +66,6 @@ macro(add_imhex_plugin)
|
|||||||
list(APPEND LIBROMFS_RESOURCE_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/romfs)
|
list(APPEND LIBROMFS_RESOURCE_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/romfs)
|
||||||
set(LIBROMFS_PROJECT_NAME ${IMHEX_PLUGIN_NAME})
|
set(LIBROMFS_PROJECT_NAME ${IMHEX_PLUGIN_NAME})
|
||||||
add_subdirectory(${IMHEX_BASE_FOLDER}/lib/external/libromfs ${CMAKE_CURRENT_BINARY_DIR}/libromfs)
|
add_subdirectory(${IMHEX_BASE_FOLDER}/lib/external/libromfs ${CMAKE_CURRENT_BINARY_DIR}/libromfs)
|
||||||
set_target_properties(${LIBROMFS_LIBRARY} PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
||||||
target_link_libraries(${IMHEX_PLUGIN_NAME} PRIVATE ${LIBROMFS_LIBRARY})
|
target_link_libraries(${IMHEX_PLUGIN_NAME} PRIVATE ${LIBROMFS_LIBRARY})
|
||||||
|
|
||||||
foreach(feature ${IMHEX_PLUGIN_FEATURES})
|
foreach(feature ${IMHEX_PLUGIN_FEATURES})
|
||||||
|
@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.20)
|
|||||||
project(ImHexSDK)
|
project(ImHexSDK)
|
||||||
|
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
|
||||||
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON CACHE BOOL "" FORCE)
|
||||||
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/build_helpers.cmake")
|
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/build_helpers.cmake")
|
||||||
|
|
||||||
set(IMHEX_BASE_FOLDER ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE)
|
set(IMHEX_BASE_FOLDER ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE)
|
||||||
|
2
lib/external/libromfs
vendored
2
lib/external/libromfs
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 0a72f7bb33d87c4fb2709b6b94bf83518ab0022d
|
Subproject commit 61f7e412dd1ad304453a1384a1e42ed01139f729
|
2
lib/external/pattern_language
vendored
2
lib/external/pattern_language
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 1fa19577c90d0db47fbb5ad8207cdb7b346a3b69
|
Subproject commit 0c2918e13247f016bf3e43e678b36aa62be4f965
|
@ -77,7 +77,6 @@ else()
|
|||||||
target_compile_definitions(libimhex PRIVATE IMHEX_PROJECT_NAME="${PROJECT_NAME}")
|
target_compile_definitions(libimhex PRIVATE IMHEX_PROJECT_NAME="${PROJECT_NAME}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_target_properties(libimhex PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
||||||
enableUnityBuild(libimhex)
|
enableUnityBuild(libimhex)
|
||||||
setupCompilerFlags(libimhex)
|
setupCompilerFlags(libimhex)
|
||||||
|
|
||||||
|
@ -15,4 +15,3 @@ target_include_directories(imgui_color_text_editor PUBLIC
|
|||||||
target_include_directories(imgui_all_includes INTERFACE include)
|
target_include_directories(imgui_all_includes INTERFACE include)
|
||||||
|
|
||||||
target_link_libraries(imgui_color_text_editor PRIVATE imgui_includes)
|
target_link_libraries(imgui_color_text_editor PRIVATE imgui_includes)
|
||||||
set_property(TARGET imgui_color_text_editor PROPERTY POSITION_INDEPENDENT_CODE ON)
|
|
1
lib/third_party/imgui/custom/CMakeLists.txt
vendored
1
lib/third_party/imgui/custom/CMakeLists.txt
vendored
@ -14,7 +14,6 @@ target_include_directories(imgui_custom PUBLIC
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(imgui_custom PRIVATE imgui_includes)
|
target_link_libraries(imgui_custom PRIVATE imgui_includes)
|
||||||
set_property(TARGET imgui_custom PROPERTY POSITION_INDEPENDENT_CODE ON)
|
|
||||||
target_include_directories(imgui_all_includes INTERFACE include)
|
target_include_directories(imgui_all_includes INTERFACE include)
|
||||||
|
|
||||||
find_package(OpenGL REQUIRED)
|
find_package(OpenGL REQUIRED)
|
||||||
|
1
lib/third_party/imgui/imgui/CMakeLists.txt
vendored
1
lib/third_party/imgui/imgui/CMakeLists.txt
vendored
@ -24,7 +24,6 @@ target_include_directories(imgui_includes INTERFACE include)
|
|||||||
target_include_directories(imgui_all_includes INTERFACE include include/misc/freetype)
|
target_include_directories(imgui_all_includes INTERFACE include include/misc/freetype)
|
||||||
|
|
||||||
target_compile_options(imgui_imgui PRIVATE -Wno-unknown-warning-option)
|
target_compile_options(imgui_imgui PRIVATE -Wno-unknown-warning-option)
|
||||||
set_property(TARGET imgui_imgui PROPERTY POSITION_INDEPENDENT_CODE ON)
|
|
||||||
|
|
||||||
find_package(Freetype REQUIRED)
|
find_package(Freetype REQUIRED)
|
||||||
|
|
||||||
|
1
lib/third_party/imgui/imnodes/CMakeLists.txt
vendored
1
lib/third_party/imgui/imnodes/CMakeLists.txt
vendored
@ -14,4 +14,3 @@ target_include_directories(imgui_imnodes PUBLIC
|
|||||||
|
|
||||||
target_link_libraries(imgui_imnodes PRIVATE imgui_includes)
|
target_link_libraries(imgui_imnodes PRIVATE imgui_includes)
|
||||||
target_include_directories(imgui_all_includes INTERFACE include)
|
target_include_directories(imgui_all_includes INTERFACE include)
|
||||||
set_property(TARGET imgui_imnodes PROPERTY POSITION_INDEPENDENT_CODE ON)
|
|
||||||
|
2
lib/third_party/imgui/implot/CMakeLists.txt
vendored
2
lib/third_party/imgui/implot/CMakeLists.txt
vendored
@ -16,5 +16,3 @@ target_include_directories(imgui_implot PUBLIC
|
|||||||
|
|
||||||
target_link_libraries(imgui_implot PRIVATE imgui_includes)
|
target_link_libraries(imgui_implot PRIVATE imgui_includes)
|
||||||
target_include_directories(imgui_all_includes INTERFACE include)
|
target_include_directories(imgui_all_includes INTERFACE include)
|
||||||
|
|
||||||
set_property(TARGET imgui_implot PROPERTY POSITION_INDEPENDENT_CODE ON)
|
|
||||||
|
1
lib/third_party/yara/CMakeLists.txt
vendored
1
lib/third_party/yara/CMakeLists.txt
vendored
@ -107,7 +107,6 @@ set(LIBYARA_MODULES
|
|||||||
find_package(mbedTLS 2.26.0 REQUIRED)
|
find_package(mbedTLS 2.26.0 REQUIRED)
|
||||||
|
|
||||||
add_library(libyara STATIC ${LIBYARA_SOURCE} ${LIBYARA_INCLUDES} ${LIBYARA_MODULES})
|
add_library(libyara STATIC ${LIBYARA_SOURCE} ${LIBYARA_INCLUDES} ${LIBYARA_MODULES})
|
||||||
set_property(TARGET libyara PROPERTY POSITION_INDEPENDENT_CODE ON)
|
|
||||||
|
|
||||||
# Add mbedtls crypto wrappers
|
# Add mbedtls crypto wrappers
|
||||||
target_compile_definitions(libyara PRIVATE
|
target_compile_definitions(libyara PRIVATE
|
||||||
|
@ -10,5 +10,4 @@ add_dependencies(imhex_all main-forwarder)
|
|||||||
set_target_properties(main-forwarder PROPERTIES
|
set_target_properties(main-forwarder PROPERTIES
|
||||||
OUTPUT_NAME "imhex"
|
OUTPUT_NAME "imhex"
|
||||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../..
|
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../..
|
||||||
POSITION_INDEPENDENT_CODE ON
|
|
||||||
)
|
)
|
@ -30,7 +30,6 @@ setupCompilerFlags(main)
|
|||||||
set(LIBROMFS_RESOURCE_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/romfs)
|
set(LIBROMFS_RESOURCE_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/romfs)
|
||||||
set(LIBROMFS_PROJECT_NAME imhex)
|
set(LIBROMFS_PROJECT_NAME imhex)
|
||||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../lib/external/libromfs ${CMAKE_CURRENT_BINARY_DIR}/main/gui/libromfs EXCLUDE_FROM_ALL)
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../lib/external/libromfs ${CMAKE_CURRENT_BINARY_DIR}/main/gui/libromfs EXCLUDE_FROM_ALL)
|
||||||
set_target_properties(${LIBROMFS_LIBRARY} PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
||||||
add_dependencies(imhex_all main)
|
add_dependencies(imhex_all main)
|
||||||
|
|
||||||
if (EMSCRIPTEN)
|
if (EMSCRIPTEN)
|
||||||
@ -49,8 +48,7 @@ endif ()
|
|||||||
|
|
||||||
set_target_properties(main PROPERTIES
|
set_target_properties(main PROPERTIES
|
||||||
OUTPUT_NAME ${IMHEX_APPLICATION_NAME}
|
OUTPUT_NAME ${IMHEX_APPLICATION_NAME}
|
||||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../..
|
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../..)
|
||||||
POSITION_INDEPENDENT_CODE ON)
|
|
||||||
|
|
||||||
target_compile_definitions(main PRIVATE IMHEX_PROJECT_NAME="${PROJECT_NAME}")
|
target_compile_definitions(main PRIVATE IMHEX_PROJECT_NAME="${PROJECT_NAME}")
|
||||||
|
|
||||||
|
@ -17,5 +17,4 @@ endif()
|
|||||||
set_target_properties(updater PROPERTIES
|
set_target_properties(updater PROPERTIES
|
||||||
OUTPUT_NAME "imhex-updater"
|
OUTPUT_NAME "imhex-updater"
|
||||||
RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIRECTORY}
|
RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIRECTORY}
|
||||||
POSITION_INDEPENDENT_CODE ON
|
|
||||||
)
|
)
|
@ -5,7 +5,6 @@ include(ImHexPlugin)
|
|||||||
macro(addOptionalLibrary package library)
|
macro(addOptionalLibrary package library)
|
||||||
find_package(${package})
|
find_package(${package})
|
||||||
if (${package}_FOUND)
|
if (${package}_FOUND)
|
||||||
set_property(TARGET ${package}::${library} PROPERTY POSITION_INDEPENDENT_CODE ON)
|
|
||||||
string(TOUPPER ${package} PACKAGE)
|
string(TOUPPER ${package} PACKAGE)
|
||||||
set(LIBRARIES ${LIBRARIES} ${package}::${library})
|
set(LIBRARIES ${LIBRARIES} ${package}::${library})
|
||||||
message(STATUS "Enabling decompression support using ${package} (${${package}_VERSION})")
|
message(STATUS "Enabling decompression support using ${package} (${${package}_VERSION})")
|
||||||
|
@ -8,9 +8,6 @@ else()
|
|||||||
set(BUILD_TESTING OFF CACHE BOOL "" FORCE)
|
set(BUILD_TESTING OFF CACHE BOOL "" FORCE)
|
||||||
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/edlib ${CMAKE_CURRENT_BINARY_DIR}/edlib EXCLUDE_FROM_ALL)
|
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/edlib ${CMAKE_CURRENT_BINARY_DIR}/edlib EXCLUDE_FROM_ALL)
|
||||||
enableUnityBuild(edlib)
|
enableUnityBuild(edlib)
|
||||||
set_target_properties(edlib
|
|
||||||
PROPERTIES POSITION_INDEPENDENT_CODE ON
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_imhex_plugin(
|
add_imhex_plugin(
|
||||||
|
@ -7,9 +7,7 @@ if (NOT USE_SYSTEM_CAPSTONE)
|
|||||||
set(CAPSTONE_BUILD_SHARED OFF CACHE BOOL "Disable shared library building")
|
set(CAPSTONE_BUILD_SHARED OFF CACHE BOOL "Disable shared library building")
|
||||||
set(CAPSTONE_BUILD_TESTS OFF CACHE BOOL "Disable tests")
|
set(CAPSTONE_BUILD_TESTS OFF CACHE BOOL "Disable tests")
|
||||||
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/capstone ${CMAKE_CURRENT_BINARY_DIR}/capstone EXCLUDE_FROM_ALL)
|
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/capstone ${CMAKE_CURRENT_BINARY_DIR}/capstone EXCLUDE_FROM_ALL)
|
||||||
set_target_properties(capstone PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
||||||
target_compile_options(capstone PRIVATE -Wno-unused-function)
|
target_compile_options(capstone PRIVATE -Wno-unused-function)
|
||||||
enableUnityBuild(capstone)
|
|
||||||
set(CAPSTONE_LIBRARY "capstone")
|
set(CAPSTONE_LIBRARY "capstone")
|
||||||
set(CAPSTONE_INCLUDE_DIR ${THIRD_PARTY_LIBS_FOLDER}/capstone/include)
|
set(CAPSTONE_INCLUDE_DIR ${THIRD_PARTY_LIBS_FOLDER}/capstone/include)
|
||||||
else()
|
else()
|
||||||
|
@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 3.16)
|
|||||||
include(ImHexPlugin)
|
include(ImHexPlugin)
|
||||||
|
|
||||||
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/HashLibPlus ${CMAKE_CURRENT_BINARY_DIR}/HashLibPlus)
|
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/HashLibPlus ${CMAKE_CURRENT_BINARY_DIR}/HashLibPlus)
|
||||||
set_target_properties(hashplus PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
||||||
enableUnityBuild(hashplus)
|
enableUnityBuild(hashplus)
|
||||||
|
|
||||||
add_imhex_plugin(
|
add_imhex_plugin(
|
||||||
|
@ -74,8 +74,7 @@ namespace hex::ui {
|
|||||||
/* Hex Editor */
|
/* Hex Editor */
|
||||||
|
|
||||||
HexEditor::HexEditor(prv::Provider *provider) : m_provider(provider) {
|
HexEditor::HexEditor(prv::Provider *provider) : m_provider(provider) {
|
||||||
m_currDataVisualizer = ContentRegistry::HexEditor::getVisualizerByName("hex.builtin.visualizer.hexadecimal.8bit");
|
|
||||||
m_miniMapVisualizer = ContentRegistry::HexEditor::impl::getMiniMapVisualizers().front();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HexEditor::~HexEditor() {
|
HexEditor::~HexEditor() {
|
||||||
@ -194,6 +193,10 @@ namespace hex::ui {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void HexEditor::drawMinimap(ImVec2 characterSize) {
|
void HexEditor::drawMinimap(ImVec2 characterSize) {
|
||||||
|
if (const auto &visualizers = ContentRegistry::HexEditor::impl::getMiniMapVisualizers(); m_miniMapVisualizer == nullptr && !visualizers.empty())
|
||||||
|
m_miniMapVisualizer = visualizers.front();
|
||||||
|
|
||||||
|
|
||||||
ImS64 numRows = m_provider == nullptr ? 0 : (m_provider->getSize() / m_bytesPerRow) + ((m_provider->getSize() % m_bytesPerRow) == 0 ? 0 : 1);
|
ImS64 numRows = m_provider == nullptr ? 0 : (m_provider->getSize() / m_bytesPerRow) + ((m_provider->getSize() % m_bytesPerRow) == 0 ? 0 : 1);
|
||||||
|
|
||||||
auto window = ImGui::GetCurrentWindowRead();
|
auto window = ImGui::GetCurrentWindowRead();
|
||||||
@ -400,6 +403,11 @@ namespace hex::ui {
|
|||||||
const float SeparatorColumWidth = 6_scaled;
|
const float SeparatorColumWidth = 6_scaled;
|
||||||
const auto CharacterSize = ImGui::CalcTextSize("0");
|
const auto CharacterSize = ImGui::CalcTextSize("0");
|
||||||
|
|
||||||
|
if (const auto &visualizer = ContentRegistry::HexEditor::getVisualizerByName("hex.builtin.visualizer.hexadecimal.8bit"); m_currDataVisualizer == nullptr && visualizer != nullptr) {
|
||||||
|
m_currDataVisualizer = visualizer;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const auto bytesPerCell = m_currDataVisualizer->getBytesPerCell();
|
const auto bytesPerCell = m_currDataVisualizer->getBytesPerCell();
|
||||||
const u16 columnCount = m_bytesPerRow / bytesPerCell;
|
const u16 columnCount = m_bytesPerRow / bytesPerCell;
|
||||||
auto byteColumnCount = 2 + columnCount + getByteColumnSeparatorCount(columnCount) + 2 + 2;
|
auto byteColumnCount = 2 + columnCount + getByteColumnSeparatorCount(columnCount) + 2 + 2;
|
||||||
|
@ -4,7 +4,6 @@ include(ImHexPlugin)
|
|||||||
|
|
||||||
if (NOT USE_SYSTEM_MINIAUDIO)
|
if (NOT USE_SYSTEM_MINIAUDIO)
|
||||||
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/miniaudio ${CMAKE_CURRENT_BINARY_DIR}/miniaudio EXCLUDE_FROM_ALL)
|
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/miniaudio ${CMAKE_CURRENT_BINARY_DIR}/miniaudio EXCLUDE_FROM_ALL)
|
||||||
set_target_properties(miniaudio PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
||||||
set(MINIAUDIO_LIBRARIES miniaudio)
|
set(MINIAUDIO_LIBRARIES miniaudio)
|
||||||
else()
|
else()
|
||||||
find_package(miniaudio REQUIRED)
|
find_package(miniaudio REQUIRED)
|
||||||
|
@ -4,7 +4,6 @@ include(ImHexPlugin)
|
|||||||
|
|
||||||
if (NOT USE_SYSTEM_YARA)
|
if (NOT USE_SYSTEM_YARA)
|
||||||
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/yara ${CMAKE_CURRENT_BINARY_DIR}/yara EXCLUDE_FROM_ALL)
|
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/yara ${CMAKE_CURRENT_BINARY_DIR}/yara EXCLUDE_FROM_ALL)
|
||||||
set_target_properties(libyara PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
||||||
set(YARA_LIBRARIES libyara)
|
set(YARA_LIBRARIES libyara)
|
||||||
else()
|
else()
|
||||||
find_package(Yara REQUIRED)
|
find_package(Yara REQUIRED)
|
||||||
|
Loading…
Reference in New Issue
Block a user