@matheusbsbs / matheus-bagliano / commits / 2d9eb4ed2c
Fork 0

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 <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Sep 30, 2020 at 15:26 UTC 2d9eb4ed2cd8a0105c65167fdc9ddb0ddcde42c5
1 file changed +2
contrib/buildsystems/CMakeLists.txt
+2
@@ -617,6 +617,8 @@ if(WIN32)
617 target_link_options(common-main PUBLIC -municode -Wl,-nxcompat -Wl,-dynamicbase -Wl,-entry:wmainCRTStartup -Wl,invalidcontinue.obj)
618 elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
619 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}")
622 endif()
623 elseif(UNIX)
624 target_link_libraries(common-main pthread rt)