diff options
| author | Silvio Traversaro <pegua1@gmail.com> | 2017-08-24 21:50:51 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-08-24 21:50:51 +0100 |
| commit | b30b758efb90aaf2bc96b034c117c8f21490c54e (patch) | |
| tree | f3d8442ec4b64e6bd7dd58e41837bc7e86e05681 | |
| parent | de4a39d3c77f24c080adaba5546c75a7f4899fc1 (diff) | |
| download | dlfcn-win32-b30b758efb90aaf2bc96b034c117c8f21490c54e.tar.gz dlfcn-win32-b30b758efb90aaf2bc96b034c117c8f21490c54e.tar.bz2 dlfcn-win32-b30b758efb90aaf2bc96b034c117c8f21490c54e.zip | |
Mention the possibility of defining CMAKE_DL_LIBS
| -rw-r--r-- | README.md | 13 |
1 files changed, 13 insertions, 0 deletions
| @@ -29,6 +29,19 @@ find_package(dlfcn-win32 REQUIRED) | |||
| 29 | target_link_libraries(<target> dlfcn-win32::dl) | 29 | target_link_libraries(<target> dlfcn-win32::dl) |
| 30 | ... | 30 | ... |
| 31 | ~~~ | 31 | ~~~ |
| 32 | If you want to use this library in a cross-platform project, a convenient way | ||
| 33 | to proceed is to define the CMake variable [`CMAKE_DL_LIBS`](https://cmake.org/cmake/help/latest/variable/CMAKE_DL_LIBS.html) | ||
| 34 | (that is normally empty on Windows) and then use it for linking: | ||
| 35 | ~~~ | ||
| 36 | ... | ||
| 37 | if (WIN32) | ||
| 38 | find_package(dlfcn-win32 REQUIRED) | ||
| 39 | set(CMAKE_DL_LIBS dlfcn-win32::dl) | ||
| 40 | endif () | ||
| 41 | ... | ||
| 42 | target_link_libraries(<target> ${CMAKE_DL_LIBS}) | ||
| 43 | ... | ||
| 44 | ~~~ | ||
| 32 | 45 | ||
| 33 | ### Linking caveat | 46 | ### Linking caveat |
| 34 | This library uses the Process Status API in Windows (`psapi.lib`). If you are | 47 | This library uses the Process Status API in Windows (`psapi.lib`). If you are |
