From eb6b602095d177a61eafe86d5da567a971697e86 Mon Sep 17 00:00:00 2001 From: hqwrong Date: Thu, 22 Mar 2018 17:35:44 +0800 Subject: [PATCH] fix build error on macos --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 21182d33..ddcf39b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -184,7 +184,11 @@ if(ASAN) else() # Forbid undefined symbols in shared libraries. This is incompatible with # asan, so it's in the else branch here. - add_dllflag("-Wl,-z,defs") + if(APPLE) + add_dllflag("-undefined error") + else() + add_dllflag("-Wl,-z,defs") + endif() endif() option(USE_IPV6 "Use IPv6 in tests" ON)