From 6a7ec4be7b8a22ab16cea0f294b5973dbcdd637a Mon Sep 17 00:00:00 2001 From: Jason Liu Date: Sat, 17 Jun 2023 22:14:08 -0400 Subject: [PATCH] Fix linking error "ld: unknown option: --no-undefined" on macOS --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e868150..89ecf64c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -163,7 +163,7 @@ elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" AND NOT MSVC) # Error if there's symbols that are not found at link time. if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") add_link_options("-Wl,-undefined,error") - else() + elseif(NOT APPLE) add_link_options("-Wl,--no-undefined") endif() endif()