Skip to content

Commit 2d9eb4e

Browse files
dschogitster
authored andcommitted
cmake (Windows): complain when encountering an unknown compiler
We have some custom handling regarding the link options, which are specific to each compiler. Therefore: let's not just continue without setting the link options if configuring for a currently unhandled compiler, but error out. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8c35e82 commit 2d9eb4e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

contrib/buildsystems/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,8 @@ if(WIN32)
617617
target_link_options(common-main PUBLIC -municode -Wl,-nxcompat -Wl,-dynamicbase -Wl,-entry:wmainCRTStartup -Wl,invalidcontinue.obj)
618618
elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
619619
target_link_options(common-main PUBLIC /IGNORE:4217 /IGNORE:4049 /NOLOGO /ENTRY:wmainCRTStartup /SUBSYSTEM:CONSOLE invalidcontinue.obj)
620+
else()
621+
message(FATAL_ERROR "Unhandled compiler: ${CMAKE_C_COMPILER_ID}")
620622
endif()
621623
elseif(UNIX)
622624
target_link_libraries(common-main pthread rt)

0 commit comments

Comments
 (0)