fix: Standard magic file not getting bundled into executable correctly
This commit is contained in:
parent
cbf415256b
commit
b94a4288bf
@ -117,6 +117,10 @@ macro(add_imhex_plugin)
|
||||
endmacro()
|
||||
|
||||
macro(add_romfs_resource input output)
|
||||
if (NOT EXISTS ${input})
|
||||
message(WARNING "Resource file ${input} does not exist")
|
||||
endif()
|
||||
|
||||
configure_file(${input} ${CMAKE_CURRENT_BINARY_DIR}/romfs/${output} COPYONLY)
|
||||
|
||||
list(APPEND LIBROMFS_RESOURCE_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/romfs)
|
||||
|
@ -2,6 +2,11 @@ cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
include(ImHexPlugin)
|
||||
|
||||
find_file(DEFAULT_MAGIC_FILE_PATH magic.mgc HINTS ${LIBMAGIC_INCLUDE_DIR}/../share/misc)
|
||||
if (EXISTS ${DEFAULT_MAGIC_FILE_PATH})
|
||||
add_romfs_resource(${DEFAULT_MAGIC_FILE_PATH} always_auto_extract/magic/magic.mgc)
|
||||
endif ()
|
||||
|
||||
add_imhex_plugin(
|
||||
NAME
|
||||
builtin
|
||||
@ -122,11 +127,6 @@ add_imhex_plugin(
|
||||
LLVMDemangle
|
||||
)
|
||||
|
||||
find_file(DEFAULT_MAGIC_FILE_PATH magic.mgc HINTS ${LIBMAGIC_INCLUDE_DIR}/../share/misc)
|
||||
if (DEFAULT_MAGIC_FILE_PATH)
|
||||
add_romfs_resource(${DEFAULT_MAGIC_FILE_PATH} always_auto_extract/magic/magic.mgc)
|
||||
endif ()
|
||||
|
||||
if (WIN32)
|
||||
target_link_libraries(builtin PRIVATE setupapi)
|
||||
endif ()
|
Loading…
Reference in New Issue
Block a user