2023-07-15 14:29:14 +02:00
|
|
|
cmake_minimum_required(VERSION 3.16)
|
|
|
|
|
2023-12-23 21:09:41 +01:00
|
|
|
include(ImHexPlugin)
|
2024-05-17 21:01:35 +02:00
|
|
|
|
2023-12-23 21:09:41 +01:00
|
|
|
find_package(CoreClrEmbed)
|
2024-07-02 23:15:54 +02:00
|
|
|
add_library(dotnet INTERFACE)
|
2024-05-17 21:01:35 +02:00
|
|
|
if (CoreClrEmbed_FOUND)
|
|
|
|
set(IMHEX_DOTNET_SCRIPT_SUPPORT ON)
|
|
|
|
|
2024-07-02 23:15:54 +02:00
|
|
|
target_compile_definitions(dotnet INTERFACE IMHEX_DOTNET_RUNTIME_VERSION="${CoreClrEmbed_VERSION}")
|
|
|
|
|
2024-05-17 21:01:35 +02:00
|
|
|
add_library(nethost SHARED IMPORTED)
|
|
|
|
target_include_directories(nethost INTERFACE "${CoreClrEmbed_INCLUDE_DIRS}")
|
|
|
|
get_filename_component(CoreClrEmbed_FOLDER ${CoreClrEmbed_SHARED_LIBRARIES} DIRECTORY)
|
|
|
|
set_target_properties(nethost
|
|
|
|
PROPERTIES
|
|
|
|
IMPORTED_IMPLIB ${CoreClrEmbed_SHARED_LIBRARIES}
|
|
|
|
IMPORTED_LOCATION ${CoreClrEmbed_LIBRARIES}
|
|
|
|
BUILD_RPATH ${CoreClrEmbed_FOLDER}
|
|
|
|
INSTALL_RPATH ${CoreClrEmbed_FOLDER})
|
|
|
|
|
|
|
|
set(EXTRA_BUNDLE_LIBRARY_PATHS "${CoreClrEmbed_FOLDER}" PARENT_SCOPE)
|
|
|
|
|
|
|
|
if (IMHEX_BUNDLE_DOTNET)
|
|
|
|
install(FILES ${CoreClrEmbed_SHARED_LIBRARIES} DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
|
|
endif()
|
2024-07-08 18:12:46 +02:00
|
|
|
|
|
|
|
message(STATUS "Enabling .NET Scripting support!")
|
|
|
|
|
|
|
|
target_link_directories(dotnet INTERFACE ${CoreClrEmbed_FOLDER})
|
|
|
|
target_include_directories(dotnet INTERFACE ${CoreClrEmbed_INCLUDE_DIRS})
|
|
|
|
target_compile_definitions(dotnet INTERFACE IMHEX_DOTNET_SCRIPT_SUPPORT=1)
|
|
|
|
target_sources(dotnet INTERFACE
|
|
|
|
source/loaders/dotnet/dotnet_loader.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
add_subdirectory(support/dotnet)
|
|
|
|
add_dependencies(dotnet AssemblyLoader)
|
2024-05-17 21:01:35 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
add_subdirectory(support/c)
|
|
|
|
|
|
|
|
|
2023-12-23 21:09:41 +01:00
|
|
|
|
|
|
|
add_imhex_plugin(
|
|
|
|
NAME
|
|
|
|
script_loader
|
|
|
|
|
|
|
|
SOURCES
|
|
|
|
source/plugin_script_loader.cpp
|
|
|
|
INCLUDES
|
|
|
|
include
|
2023-12-26 00:22:47 +01:00
|
|
|
|
|
|
|
LIBRARIES
|
2024-05-17 21:01:35 +02:00
|
|
|
c_api
|
2024-01-28 22:14:59 +01:00
|
|
|
fonts
|
2024-05-18 12:57:29 +02:00
|
|
|
ui
|
2024-07-02 23:15:54 +02:00
|
|
|
dotnet
|
2024-07-08 18:12:46 +02:00
|
|
|
)
|