mirror of
https://github.com/neovim/neovim.git
synced 2024-12-23 12:45:17 -07:00
build: add CMAKE_C_FLAGS to --version output
Closes https://github.com/neovim/neovim/issues/25754.
This commit is contained in:
parent
0b1ec3b162
commit
1094d0c0db
@ -161,6 +161,12 @@ configure_file (
|
||||
"${PROJECT_BINARY_DIR}/cmake.config/auto/config.h"
|
||||
)
|
||||
|
||||
# Prevent double space in --version output if CMAKE_C_FLAGS is empty
|
||||
set(C_FLAGS_VERSION_OUTPUT ${CMAKE_C_FLAGS})
|
||||
if(C_FLAGS_VERSION_OUTPUT)
|
||||
string(PREPEND C_FLAGS_VERSION_OUTPUT " ")
|
||||
endif()
|
||||
|
||||
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.15)
|
||||
configure_file(versiondef.h.in auto/versiondef.h.gen)
|
||||
else()
|
||||
|
@ -15,7 +15,7 @@
|
||||
#define NVIM_API_LEVEL_COMPAT @NVIM_API_LEVEL_COMPAT@
|
||||
#define NVIM_API_PRERELEASE @NVIM_API_PRERELEASE@
|
||||
|
||||
#define NVIM_VERSION_CFLAGS "${CMAKE_C_COMPILER} $<$<CONFIG:Debug>:${CMAKE_C_FLAGS_DEBUG}>$<$<CONFIG:Release>:${CMAKE_C_FLAGS_RELEASE}>$<$<CONFIG:RelWithDebInfo>:${CMAKE_C_FLAGS_RELWITHDEBINFO}>$<$<CONFIG:MinSizeRel>:${CMAKE_C_FLAGS_MINSIZEREL}> $<JOIN:$<TARGET_PROPERTY:nvim,COMPILE_OPTIONS>, > -D$<JOIN:$<TARGET_PROPERTY:nvim,COMPILE_DEFINITIONS>, -D> -I$<JOIN:$<REMOVE_DUPLICATES:$<TARGET_PROPERTY:nvim,INCLUDE_DIRECTORIES>>, -I>"
|
||||
#define NVIM_VERSION_CFLAGS "${CMAKE_C_COMPILER}${C_FLAGS_VERSION_OUTPUT} $<$<CONFIG:Debug>:${CMAKE_C_FLAGS_DEBUG}>$<$<CONFIG:Release>:${CMAKE_C_FLAGS_RELEASE}>$<$<CONFIG:RelWithDebInfo>:${CMAKE_C_FLAGS_RELWITHDEBINFO}>$<$<CONFIG:MinSizeRel>:${CMAKE_C_FLAGS_MINSIZEREL}> $<JOIN:$<TARGET_PROPERTY:nvim,COMPILE_OPTIONS>, > -D$<JOIN:$<TARGET_PROPERTY:nvim,COMPILE_DEFINITIONS>, -D> -I$<JOIN:$<REMOVE_DUPLICATES:$<TARGET_PROPERTY:nvim,INCLUDE_DIRECTORIES>>, -I>"
|
||||
#define NVIM_VERSION_BUILD_TYPE "$<CONFIG>"
|
||||
|
||||
#endif // AUTO_VERSIONDEF_H
|
||||
|
@ -15,7 +15,7 @@
|
||||
#define NVIM_API_LEVEL_COMPAT @NVIM_API_LEVEL_COMPAT@
|
||||
#define NVIM_API_PRERELEASE @NVIM_API_PRERELEASE@
|
||||
|
||||
#define NVIM_VERSION_CFLAGS "${CMAKE_C_COMPILER} $<$<CONFIG:Debug>:${CMAKE_C_FLAGS_DEBUG}>$<$<CONFIG:Release>:${CMAKE_C_FLAGS_RELEASE}>$<$<CONFIG:RelWithDebInfo>:${CMAKE_C_FLAGS_RELWITHDEBINFO}>$<$<CONFIG:MinSizeRel>:${CMAKE_C_FLAGS_MINSIZEREL}> $<JOIN:$<TARGET_PROPERTY:nvim,COMPILE_OPTIONS>, > -D$<JOIN:$<TARGET_PROPERTY:nvim,COMPILE_DEFINITIONS>, -D> -I$<JOIN:$<TARGET_PROPERTY:nvim,INCLUDE_DIRECTORIES>, -I>"
|
||||
#define NVIM_VERSION_CFLAGS "${CMAKE_C_COMPILER}${C_FLAGS_VERSION_OUTPUT} $<$<CONFIG:Debug>:${CMAKE_C_FLAGS_DEBUG}>$<$<CONFIG:Release>:${CMAKE_C_FLAGS_RELEASE}>$<$<CONFIG:RelWithDebInfo>:${CMAKE_C_FLAGS_RELWITHDEBINFO}>$<$<CONFIG:MinSizeRel>:${CMAKE_C_FLAGS_MINSIZEREL}> $<JOIN:$<TARGET_PROPERTY:nvim,COMPILE_OPTIONS>, > -D$<JOIN:$<TARGET_PROPERTY:nvim,COMPILE_DEFINITIONS>, -D> -I$<JOIN:$<TARGET_PROPERTY:nvim,INCLUDE_DIRECTORIES>, -I>"
|
||||
#define NVIM_VERSION_BUILD_TYPE "$<CONFIG>"
|
||||
|
||||
#endif // AUTO_VERSIONDEF_H
|
||||
|
Loading…
Reference in New Issue
Block a user