1
0
mirror of synced 2024-11-24 07:40:17 +01:00

build: Don't add defines to libimhex after precompiling headers

This commit is contained in:
WerWolv 2024-02-29 20:39:14 +01:00
parent c412ba66d8
commit 7bdde15796

View File

@ -65,6 +65,16 @@ if (APPLE)
set(LIBIMHEX_SOURCES ${LIBIMHEX_SOURCES} source/helpers/utils_macos.m)
endif ()
if (GIT_COMMIT_HASH_LONG STREQUAL "" OR GIT_BRANCH STREQUAL "")
message(WARNING "Failed to to determine commit hash/branch")
else()
addDefineToSource(source/api/imhex_api.cpp "GIT_COMMIT_HASH_LONG=\"${GIT_COMMIT_HASH_LONG}\"")
addDefineToSource(source/api/imhex_api.cpp "GIT_BRANCH=\"${GIT_BRANCH}\"")
endif ()
addDefineToSource(source/api/imhex_api.cpp "IMHEX_VERSION=\"${IMHEX_VERSION_STRING}\"")
if (IMHEX_EXTERNAL_PLUGIN_BUILD)
add_library(libimhex IMPORTED SHARED GLOBAL)
set(LIBIMHEX_LIBRARY_TYPE INTERFACE)
@ -137,13 +147,4 @@ else()
)
endif ()
if (GIT_COMMIT_HASH_LONG STREQUAL "" OR GIT_BRANCH STREQUAL "")
message(WARNING "Failed to to determine commit hash/branch")
else()
addDefineToSource(source/api/imhex_api.cpp "GIT_COMMIT_HASH_LONG=\"${GIT_COMMIT_HASH_LONG}\"")
addDefineToSource(source/api/imhex_api.cpp "GIT_BRANCH=\"${GIT_BRANCH}\"")
endif ()
addDefineToSource(source/api/imhex_api.cpp "IMHEX_VERSION=\"${IMHEX_VERSION_STRING}\"")
add_dependencies(imhex_all libimhex)