build: Make sure libraries are correctly linked in external plugins
This commit is contained in:
parent
6ae86ce906
commit
bde476dfb7
@ -14,9 +14,10 @@ option(IMHEX_ENABLE_LTO "Enables Link Time Optimizations if possible" OFF)
|
|||||||
option(IMHEX_USE_DEFAULT_BUILD_SETTINGS "Use default build settings" OFF)
|
option(IMHEX_USE_DEFAULT_BUILD_SETTINGS "Use default build settings" OFF)
|
||||||
option(IMHEX_STRICT_WARNINGS "Enable most available warnings and treat them as errors" ON)
|
option(IMHEX_STRICT_WARNINGS "Enable most available warnings and treat them as errors" ON)
|
||||||
option(IMHEX_STATIC_LINK_PLUGINS "Statically link all plugins into the main executable" OFF)
|
option(IMHEX_STATIC_LINK_PLUGINS "Statically link all plugins into the main executable" OFF)
|
||||||
option(IMHEX_GENERATE_PACKAGE "Specify if a native package should be built. Only usable on Windows and MacOS" OFF)
|
option(IMHEX_GENERATE_PACKAGE "Specify if a native package should be built. (Windows and MacOS only)" OFF)
|
||||||
option(IMHEX_ENABLE_UNITY_BUILD "Enables building ImHex as a unity build." OFF)
|
option(IMHEX_ENABLE_UNITY_BUILD "Enables building ImHex as a unity build." OFF)
|
||||||
option(IMHEX_GENERATE_PDBS "Enable generating PDB files in non-debug builds" ON)
|
option(IMHEX_GENERATE_PDBS "Enable generating PDB files in non-debug builds" ON)
|
||||||
|
option(IMHEX_ENABLE_STD_ASSERTS "Enable debug asserts in the C++ std library. (Breaks Plugin ABI!)" OFF)
|
||||||
|
|
||||||
# Basic compiler and cmake configurations
|
# Basic compiler and cmake configurations
|
||||||
set(CMAKE_CXX_STANDARD 23)
|
set(CMAKE_CXX_STANDARD 23)
|
||||||
|
@ -22,7 +22,6 @@ macro(addDefines)
|
|||||||
add_compile_definitions(NDEBUG)
|
add_compile_definitions(NDEBUG)
|
||||||
elseif (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
elseif (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
set(IMHEX_VERSION_STRING ${IMHEX_VERSION_STRING}-Debug)
|
set(IMHEX_VERSION_STRING ${IMHEX_VERSION_STRING}-Debug)
|
||||||
add_compile_definitions(DEBUG _GLIBCXX_DEBUG _GLIBCXX_VERBOSE)
|
|
||||||
elseif (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
|
elseif (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
|
||||||
set(IMHEX_VERSION_STRING ${IMHEX_VERSION_STRING})
|
set(IMHEX_VERSION_STRING ${IMHEX_VERSION_STRING})
|
||||||
add_compile_definitions(NDEBUG)
|
add_compile_definitions(NDEBUG)
|
||||||
@ -31,6 +30,10 @@ macro(addDefines)
|
|||||||
add_compile_definitions(NDEBUG)
|
add_compile_definitions(NDEBUG)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
if (IMHEX_ENABLE_STD_ASSERTS)
|
||||||
|
add_compile_definitions(DEBUG _GLIBCXX_DEBUG _GLIBCXX_VERBOSE)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (IMHEX_STATIC_LINK_PLUGINS)
|
if (IMHEX_STATIC_LINK_PLUGINS)
|
||||||
add_compile_definitions(IMHEX_STATIC_LINK_PLUGINS)
|
add_compile_definitions(IMHEX_STATIC_LINK_PLUGINS)
|
||||||
endif ()
|
endif ()
|
||||||
@ -711,7 +714,7 @@ function(generateSDKDirectory)
|
|||||||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/lib/third_party/nlohmann_json DESTINATION "${SDK_PATH}/lib/third_party")
|
install(DIRECTORY ${CMAKE_SOURCE_DIR}/lib/third_party/nlohmann_json DESTINATION "${SDK_PATH}/lib/third_party")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
install(FILES ${CMAKE_SOURCE_DIR}/cmake/modules/ImHexPlugin.cmake DESTINATION "${SDK_PATH}/cmake/modules")
|
install(DIRECTORY ${CMAKE_SOURCE_DIR}/cmake/modules DESTINATION "${SDK_PATH}/cmake")
|
||||||
install(FILES ${CMAKE_SOURCE_DIR}/cmake/build_helpers.cmake DESTINATION "${SDK_PATH}/cmake")
|
install(FILES ${CMAKE_SOURCE_DIR}/cmake/build_helpers.cmake DESTINATION "${SDK_PATH}/cmake")
|
||||||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/cmake/sdk/ DESTINATION "${SDK_PATH}")
|
install(DIRECTORY ${CMAKE_SOURCE_DIR}/cmake/sdk/ DESTINATION "${SDK_PATH}")
|
||||||
install(TARGETS libimhex ARCHIVE DESTINATION "${SDK_PATH}/lib")
|
install(TARGETS libimhex ARCHIVE DESTINATION "${SDK_PATH}/lib")
|
||||||
|
@ -33,6 +33,11 @@ add_subdirectory(lib/external/libwolv EXCLUDE_FROM_ALL)
|
|||||||
set(LIBPL_ENABLE_CLI OFF CACHE BOOL "" FORCE)
|
set(LIBPL_ENABLE_CLI OFF CACHE BOOL "" FORCE)
|
||||||
add_subdirectory(lib/external/pattern_language EXCLUDE_FROM_ALL)
|
add_subdirectory(lib/external/pattern_language EXCLUDE_FROM_ALL)
|
||||||
|
|
||||||
|
find_package(CURL REQUIRED)
|
||||||
|
find_package(mbedTLS 3.4.0 REQUIRED)
|
||||||
|
set(CURL_LIBRARIES ${CURL_LIBRARIES} PARENT_SCOPE)
|
||||||
|
set(MBEDTLS_LIBRARIES ${MBEDTLS_LIBRARIES} PARENT_SCOPE)
|
||||||
|
|
||||||
add_subdirectory(lib/libimhex)
|
add_subdirectory(lib/libimhex)
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
|
@ -102,11 +102,11 @@ if (NOT IMHEX_EXTERNAL_PLUGIN_BUILD)
|
|||||||
target_link_libraries(libimhex PUBLIC ${FOUNDATION})
|
target_link_libraries(libimhex PUBLIC ${FOUNDATION})
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
target_link_libraries(libimhex PRIVATE microtar libwolv ${NFD_LIBRARIES} magic dl ${MBEDTLS_LIBRARIES} ${JTHREAD_LIBRARIES})
|
target_link_libraries(libimhex PRIVATE microtar libwolv ${NFD_LIBRARIES} magic dl ${JTHREAD_LIBRARIES})
|
||||||
target_link_libraries(libimhex PUBLIC libpl ${IMGUI_LIBRARIES})
|
target_link_libraries(libimhex PUBLIC libpl ${IMGUI_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(libimhex ${LIBIMHEX_LIBRARY_TYPE} ${NLOHMANN_JSON_LIBRARIES} imgui_all_includes ${FMT_LIBRARIES})
|
target_link_libraries(libimhex ${LIBIMHEX_LIBRARY_TYPE} ${NLOHMANN_JSON_LIBRARIES} imgui_all_includes ${MBEDTLS_LIBRARIES} ${FMT_LIBRARIES})
|
||||||
|
|
||||||
set_property(TARGET libimhex PROPERTY INTERPROCEDURAL_OPTIMIZATION FALSE)
|
set_property(TARGET libimhex PROPERTY INTERPROCEDURAL_OPTIMIZATION FALSE)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user