]> git.ipfire.org Git - thirdparty/git.git/commitdiff
cmake: fix CMakeLists.txt on Linux
authorYuyi Wang <Strawberry_Str@hotmail.com>
Tue, 24 May 2022 06:38:47 +0000 (06:38 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 24 May 2022 23:05:00 +0000 (16:05 -0700)
CMakeLists.txt didn't follow the grammar of `set`, and it will fail when
setting `USE_VCPKG` off on non-Windows platforms.

When the platform is Linux, the Makefile adds `compat/linux/procinfo.o`
to `COMPAT_OBJS`, but the CMakeLists.txt didn't add
`compat/linux/procinfo.c` to `compat_SOURCES`. It would cause linkage
error.

Signed-off-by: Yuyi Wang <Strawberry_Str@hotmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/buildsystems/CMakeLists.txt

index 185f56f414f4b75109857cdf9d4a0a240e2069b6..7f333e303c24c15a6d181dfc9dda6c8249b2db62 100644 (file)
@@ -54,7 +54,7 @@ set(CMAKE_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../..)
 
 option(USE_VCPKG "Whether or not to use vcpkg for obtaining dependencies.  Only applicable to Windows platforms" ON)
 if(NOT WIN32)
-       set(USE_VCPKG OFF CACHE BOOL FORCE)
+       set(USE_VCPKG OFF CACHE BOOL "" FORCE)
 endif()
 
 if(NOT DEFINED CMAKE_EXPORT_COMPILE_COMMANDS)
@@ -277,7 +277,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
 
 elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
        add_compile_definitions(PROCFS_EXECUTABLE_PATH="/proc/self/exe" HAVE_DEV_TTY )
-       list(APPEND compat_SOURCES unix-socket.c unix-stream-server.c)
+       list(APPEND compat_SOURCES unix-socket.c unix-stream-server.c compat/linux/procinfo.c)
 endif()
 
 if(CMAKE_SYSTEM_NAME STREQUAL "Windows")