Skip to content

Commit

Permalink
cmake: Use ${CMAKE_DL_LIBS} instead of hardcoding "dl"
Browse files Browse the repository at this point in the history
Some systems ship the dlopen() family of functions in a separate "libdl"
library, some others include them in the system libc, and others may use
a different name altogether.

Instead of hardcoding "dl" as the library name, pick the needed library
from the ${CMAKE_DL_LIBS}, which has been available since CMake 3.0 at
least:

  https://cmake.org/cmake/help/v3.0/variable/CMAKE_DL_LIBS.html
  • Loading branch information
aperezdc committed Nov 7, 2019
1 parent 08db7c2 commit 4d79a50
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ set(WPE_INCLUDE_DIRECTORIES
)

set(WPE_LIBRARIES
dl
${CMAKE_DL_LIBS}
XkbCommon::libxkbcommon
)

Expand Down Expand Up @@ -163,4 +163,4 @@ IF(BUILD_DOCS)
ELSE()
MESSAGE(FATAL_ERROR "Hotdoc C extension not found... can't build the documentation.")
ENDIF()
ENDIF()
ENDIF()

0 comments on commit 4d79a50

Please sign in to comment.