1
0
mirror of synced 2024-11-28 09:30:51 +01:00
ImHex/CMakeLists.txt
WerWolv 46ba46ce9d
build/plugins: Added initial support for Rust plugins (#327)
* build: Added initial support for Rust plugins

* github: Install correct rust version

* github: Fixed rustup command

* github: Fix swapped win/linux commands

* github: Install linux rust toolchain on Linux

* github: Add rustup parameters to correct command

* build: libimhex-rust -> hex

* rust-plugins: Disable optimization to export functions correctly

* build: Use cdylib instead of dylib

* build: Fixed rust building and artifact copying

* build: Fixed installing plugins

* build: Fix copying and installing on Windows

* github: Added windows debugging

* github: Use curl instead of wget

* github: Added debug on failure

* github: Update path variable with rust toolchain path

* build/github: Set rust location so cmake can find it

* build: Remove leftovers

* api: Added rust wrappers for the ImHexAPI

* rust: Fixed compile flags with older gcc/clang

* build: Enable concepts for cxx.rs

* build: Explicitly set compiler for cxx.rs

* rust: Added imgui-rs to libimhex-rust

* rust: Export functions with double underscore prefix on mac

* rust: Export functions adjusted for ABI

* Add Rust target folder to gitignore

* Add vendored imgui-rs copy

* Add Context::current() to vendored imgui-rs

* Fix libimhex not exporting cimgui symbols

* Simplify plugin export mangling

* build: Fixed cimgui linking

* build: Only specify --export-all-symbols on Windows

* Add context setting to Rust plugins

* rust: Cleanup

* deps: Update curl

Co-authored-by: jam1garner <8260240+jam1garner@users.noreply.github.com>
2021-10-16 11:37:29 +02:00

89 lines
2.3 KiB
CMake

cmake_minimum_required(VERSION 3.16)
# Updating the version here will update it throughout ImHex as well
set(IMHEX_VERSION "1.10.1")
project(imhex VERSION ${IMHEX_VERSION})
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
include("${CMAKE_SOURCE_DIR}/cmake/build_helpers.cmake")
setDefaultBuiltTypeIfUnset()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
# List plugin names here. Project name must match folder name
set(PLUGINS
builtin
windows
# example_cpp
# example_rust
)
findLibraries()
detectOS()
detectArch()
# Add bundled dependencies
add_subdirectory(plugins/libimhex)
# Add include directories
include_directories(include)
enable_testing()
add_subdirectory(tests)
addVersionDefines()
configurePackageCreation()
add_executable(imhex ${application_type}
source/main.cpp
source/window/window.cpp
source/window/win_window.cpp
source/window/macos_window.cpp
source/window/linux_window.cpp
source/init/splash_window.cpp
source/init/tasks.cpp
source/helpers/patches.cpp
source/helpers/project_file_handler.cpp
source/helpers/loader_script_handler.cpp
source/helpers/plugin_manager.cpp
source/helpers/encoding_file.cpp
source/providers/file_provider.cpp
source/views/view_hexeditor.cpp
source/views/view_pattern_editor.cpp
source/views/view_pattern_data.cpp
source/views/view_hashes.cpp
source/views/view_information.cpp
source/views/view_help.cpp
source/views/view_tools.cpp
source/views/view_strings.cpp
source/views/view_data_inspector.cpp
source/views/view_disassembler.cpp
source/views/view_bookmarks.cpp
source/views/view_patches.cpp
source/views/view_command_palette.cpp
source/views/view_settings.cpp
source/views/view_data_processor.cpp
source/views/view_yara.cpp
source/views/view_constants.cpp
source/views/view_store.cpp
source/views/view_diff.cpp
${imhex_icon}
)
set_target_properties(imhex PROPERTIES CXX_VISIBILITY_PRESET hidden)
if (WIN32)
target_link_libraries(imhex dl libimhex wsock32 ws2_32 Dwmapi.lib)
else ()
target_link_libraries(imhex dl libimhex pthread)
endif ()
createPackage()