Skip to content

Commit bb864ee

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 de5da9c + 7e9f8ce commit bb864ee

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
@@ -733,7 +733,13 @@ if(WIN32)
733733
endif()
734734

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

0 commit comments

Comments
 (0)