Skip to content

Commit

Permalink
fix CMake build on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
aWZHY0yQH81uOYvH committed Nov 7, 2023
1 parent b746752 commit e5bfc05
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ if(WIN32)
add_compile_definitions(WIN32_LEAN_AND_MEAN)
endif()

# Ensure dynamic library extension is always .so
set(CMAKE_SHARED_LIBRARY_SUFFIX ".so")

# Put source code here, files that are generated at build time in
# surelog_generated_SRC
set(synlig_SRC
Expand Down Expand Up @@ -291,6 +294,13 @@ set_target_properties(
set_target_properties(synlig PROPERTIES OUTPUT_NAME "systemverilog")
set_target_properties(synlig PROPERTIES PREFIX "")

# 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
PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/frontends/systemverilog/>
Expand Down

0 comments on commit e5bfc05

Please sign in to comment.