From 95ee06ade21ef7bf525b137995ce39d8ed572be0 Mon Sep 17 00:00:00 2001 From: aWZHY0yQH81uOYvH <32046476+aWZHY0yQH81uOYvH@users.noreply.github.com> Date: Fri, 10 Nov 2023 20:07:58 -0800 Subject: [PATCH] fix CMake build on macOS (#2133) --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 75f476caf..1b743c38b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -290,6 +290,14 @@ set_target_properties( synlig PROPERTIES SOVERSION "${SYNLIG_VERSION_MAJOR}.${SYNLIG_VERSION_MINOR}") set_target_properties(synlig PROPERTIES OUTPUT_NAME "systemverilog") set_target_properties(synlig PROPERTIES PREFIX "") +set_target_properties(synlig PROPERTIES SUFFIX ".so") + +# Allow undefined symbols at link time on macOS. These symbols should already be +# present within yosys when the plugin is loaded. +if(APPLE) + set_target_properties(synlig PROPERTIES LINK_FLAGS + "-undefined dynamic_lookup") +endif() target_include_directories( synlig