build: create separate targets for nvim with and without runtime files

This distinction is important for correct dependency management, as the
nvim binary is used to create some runtime files. The nvim binary (and
the target to build it) is thus called `nvim_bin` and the target to
build all of nvim (binary+runtime) is called `nvim`.
This commit is contained in:
dundargoc
2024-01-19 13:21:25 +01:00
committed by dundargoc
parent ed103cde28
commit f936a962d0
7 changed files with 72 additions and 68 deletions

View File

@ -148,7 +148,7 @@ foreach(BUILD_TYPE Debug Release RelWithDebInfo MinSizeRel)
set(GEN_RHS "${CMAKE_C_FLAGS_${BUILD_TYPE_UPPER}} ")
string(APPEND VERSION_STRING "$<${GEN_CONFIG}:${GEN_RHS}>")
set(GEN_RHS "$<$<BOOL:$<TARGET_PROPERTY:nvim,INTERPROCEDURAL_OPTIMIZATION_${BUILD_TYPE_UPPER}>>:${CMAKE_C_COMPILE_OPTIONS_IPO}>")
set(GEN_RHS "$<$<BOOL:$<TARGET_PROPERTY:nvim_bin,INTERPROCEDURAL_OPTIMIZATION_${BUILD_TYPE_UPPER}>>:${CMAKE_C_COMPILE_OPTIONS_IPO}>")
string(APPEND VERSION_STRING "$<${GEN_CONFIG}:${GEN_RHS}>")
endforeach()
@ -161,7 +161,7 @@ function(append_target_expression)
""
${ARGN})
set(TARGET_EXPRESSION "$<TARGET_PROPERTY:nvim,${ARG_PROPERTY}>")
set(TARGET_EXPRESSION "$<TARGET_PROPERTY:nvim_bin,${ARG_PROPERTY}>")
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.15)
set(TARGET_EXPRESSION "$<REMOVE_DUPLICATES:${TARGET_EXPRESSION}>")
endif()