From 25e97a5b06c6bac9db7b924257d023648652ee5c Mon Sep 17 00:00:00 2001 From: Greg Fischer Date: Tue, 24 May 2022 13:31:03 -0600 Subject: [PATCH] Fix build for clang + mingw32-make Fixes #2951 --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a792c4675..6a43f6ff2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -191,7 +191,11 @@ elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" AND NOT MSVC) # Error if there's symbols that are not found at link time. # add_link_options() was added in CMake 3.13 - if using an earlier # version don't set this - it should be caught by presubmits anyway. - add_link_options("-Wl,-undefined,error") + if (WIN32) + add_link_options("-Wl,--no-undefined") + else() + add_link_options("-Wl,-undefined,error") + endif() endif() elseif(MSVC) if(NOT ENABLE_RTTI)