aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake.config/CMakeLists.txt13
-rw-r--r--cmake.config/versiondef-multi.h.in21
-rwxr-xr-xsrc/nvim/CMakeLists.txt11
3 files changed, 12 insertions, 33 deletions
diff --git a/cmake.config/CMakeLists.txt b/cmake.config/CMakeLists.txt
index 9ae81074e7..8f6e5b21c0 100644
--- a/cmake.config/CMakeLists.txt
+++ b/cmake.config/CMakeLists.txt
@@ -161,18 +161,9 @@ configure_file (
"${PROJECT_BINARY_DIR}/cmake.config/auto/config.h"
)
-# TODO(dundargoc): the following is a hack to work around the behavior of
-# file(GENERATE) for multi-config generators, since it doesn't allow different
-# output with the same filename. This should be fixed to be generator
-# independent in the future.
-get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
-if(isMultiConfig)
- configure_file(versiondef-multi.h.in auto/versiondef.h.gen)
-else()
- configure_file(versiondef.h.in auto/versiondef.h.gen)
-endif()
+configure_file(versiondef.h.in auto/versiondef.h.gen)
file(GENERATE
- OUTPUT "${PROJECT_BINARY_DIR}/cmake.config/auto/versiondef.h"
+ OUTPUT "${PROJECT_BINARY_DIR}/cmake.config/auto/versiondef-$<CONFIG>.h"
INPUT "${PROJECT_BINARY_DIR}/cmake.config/auto/versiondef.h.gen")
find_program(WHOAMI_PRG whoami)
diff --git a/cmake.config/versiondef-multi.h.in b/cmake.config/versiondef-multi.h.in
deleted file mode 100644
index de2d950af7..0000000000
--- a/cmake.config/versiondef-multi.h.in
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef AUTO_VERSIONDEF_H
-#define AUTO_VERSIONDEF_H
-
-#define NVIM_VERSION_MAJOR @NVIM_VERSION_MAJOR@
-#define NVIM_VERSION_MINOR @NVIM_VERSION_MINOR@
-#define NVIM_VERSION_PATCH @NVIM_VERSION_PATCH@
-#define NVIM_VERSION_PRERELEASE "@NVIM_VERSION_PRERELEASE@"
-
-#cmakedefine NVIM_VERSION_MEDIUM "@NVIM_VERSION_MEDIUM@"
-#ifndef NVIM_VERSION_MEDIUM
-# include "auto/versiondef_git.h"
-#endif
-
-#define NVIM_API_LEVEL @NVIM_API_LEVEL@
-#define NVIM_API_LEVEL_COMPAT @NVIM_API_LEVEL_COMPAT@
-#define NVIM_API_PRERELEASE @NVIM_API_PRERELEASE@
-
-#define NVIM_VERSION_CFLAGS "${CMAKE_C_COMPILER} $<JOIN:$<TARGET_PROPERTY:nvim,COMPILE_OPTIONS>, > -I$<JOIN:$<TARGET_PROPERTY:nvim,INCLUDE_DIRECTORIES>, -I>"
-#define NVIM_VERSION_BUILD_TYPE "Unknown"
-
-#endif // AUTO_VERSIONDEF_H
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt
index d6a53456d7..04fe8aec5e 100755
--- a/src/nvim/CMakeLists.txt
+++ b/src/nvim/CMakeLists.txt
@@ -466,6 +466,15 @@ add_custom_target(update_version_stamp
-P ${PROJECT_SOURCE_DIR}/cmake/GenerateVersion.cmake
BYPRODUCTS ${NVIM_VERSION_GIT_H})
+set(NVIM_VERSION_DEF_H ${PROJECT_BINARY_DIR}/cmake.config/auto/versiondef.h)
+add_custom_command(
+ OUTPUT "${NVIM_VERSION_DEF_H}"
+ COMMAND "${CMAKE_COMMAND}"
+ -E copy
+ "${PROJECT_BINARY_DIR}/cmake.config/auto/versiondef-$<CONFIG>.h"
+ "${NVIM_VERSION_DEF_H}"
+ DEPENDS "${PROJECT_BINARY_DIR}/cmake.config/auto/versiondef-$<CONFIG>.h")
+
# NVIM_GENERATED_FOR_HEADERS: generated headers to be included in headers
# NVIM_GENERATED_FOR_SOURCES: generated headers to be included in sources
# NVIM_GENERATED_SOURCES: generated source files
@@ -503,7 +512,7 @@ foreach(sfile ${NVIM_SOURCES}
set(depends "${HEADER_GENERATOR}" "${sfile}")
if("${f}" STREQUAL "version.c")
# Ensure auto/versiondef_git.h exists after "make clean".
- list(APPEND depends update_version_stamp "${NVIM_VERSION_GIT_H}")
+ list(APPEND depends update_version_stamp "${NVIM_VERSION_GIT_H}" "${NVIM_VERSION_DEF_H}")
endif()
add_custom_command(
OUTPUT "${gf_c_h}" "${gf_h_h}"