Skip to content

Commit a561962

Browse files
Berrysoftgitster
authored andcommitted
cmake: fix CMakeLists.txt on Linux
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e54793a commit a561962

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contrib/buildsystems/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ set(CMAKE_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../..)
5454

5555
option(USE_VCPKG "Whether or not to use vcpkg for obtaining dependencies. Only applicable to Windows platforms" ON)
5656
if(NOT WIN32)
57-
set(USE_VCPKG OFF CACHE BOOL FORCE)
57+
set(USE_VCPKG OFF CACHE BOOL "" FORCE)
5858
endif()
5959

6060
if(NOT DEFINED CMAKE_EXPORT_COMPILE_COMMANDS)
@@ -277,7 +277,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
277277

278278
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
279279
add_compile_definitions(PROCFS_EXECUTABLE_PATH="/proc/self/exe" HAVE_DEV_TTY )
280-
list(APPEND compat_SOURCES unix-socket.c unix-stream-server.c)
280+
list(APPEND compat_SOURCES unix-socket.c unix-stream-server.c compat/linux/procinfo.c)
281281
endif()
282282

283283
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")

0 commit comments

Comments
 (0)