Skip to content

Commit 61c30e1

Browse files
dschoGit for Windows Build Agent
authored and
Git for Windows Build Agent
committed
Merge pull request #3466 from Berrysoft/main
Fix CMakeLists for MinGW.
2 parents e063559 + 22de1a3 commit 61c30e1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

contrib/buildsystems/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,13 @@ if(WIN32)
734734
endif()
735735

736736
add_executable(headless-git ${CMAKE_SOURCE_DIR}/compat/win32/headless.c)
737-
target_link_options(headless-git PUBLIC /NOLOGO /ENTRY:wWinMainCRTStartup /SUBSYSTEM:WINDOWS)
737+
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
738+
target_link_options(headless-git PUBLIC -municode -Wl,-subsystem,windows)
739+
elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
740+
target_link_options(headless-git PUBLIC /NOLOGO /ENTRY:wWinMainCRTStartup /SUBSYSTEM:WINDOWS)
741+
else()
742+
message(FATAL_ERROR "Unhandled compiler: ${CMAKE_C_COMPILER_ID}")
743+
endif()
738744
elseif(UNIX)
739745
target_link_libraries(common-main pthread rt)
740746
endif()

0 commit comments

Comments
 (0)