Skip to content

Commit

Permalink
[cmake] Fix building on OpenBSD
Browse files Browse the repository at this point in the history
OpenBSD does not have libdl. CMake provides a variable
which determines whether libdl is necessary or not called
CMAKE_DL_LIBS.
  • Loading branch information
brad0 committed Dec 19, 2024
1 parent 22da087 commit 0c6deb4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -360,11 +360,8 @@ target_link_libraries(libneko ${GC_LIBRARIES})
target_link_libraries(nekovm libneko)

if(UNIX)
if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
set(DL_LIB "dl")
endif()
find_package(Threads)
target_link_libraries(libneko ${DL_LIB} m ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(libneko ${CMAKE_DL_LIBS} m ${CMAKE_THREAD_LIBS_INIT})
endif()

set_target_properties(nekovm libneko
Expand Down

0 comments on commit 0c6deb4

Please sign in to comment.