Skip to content

Commit c8e5c86

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 5774d7b + 43c600b commit c8e5c86

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
@@ -740,7 +740,13 @@ if(WIN32)
740740
endif()
741741

742742
add_executable(headless-git ${CMAKE_SOURCE_DIR}/compat/win32/headless.c)
743-
target_link_options(headless-git PUBLIC /NOLOGO /ENTRY:wWinMainCRTStartup /SUBSYSTEM:WINDOWS)
743+
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
744+
target_link_options(headless-git PUBLIC -municode -Wl,-subsystem,windows)
745+
elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
746+
target_link_options(headless-git PUBLIC /NOLOGO /ENTRY:wWinMainCRTStartup /SUBSYSTEM:WINDOWS)
747+
else()
748+
message(FATAL_ERROR "Unhandled compiler: ${CMAKE_C_COMPILER_ID}")
749+
endif()
744750
elseif(UNIX)
745751
target_link_libraries(common-main pthread rt)
746752
endif()

0 commit comments

Comments
 (0)