jerryscript-project / iotjs

Platform for Internet of Things with JavaScript http://www.iotjs.net
Other
2.58k stars 440 forks source link

Use CMAKE_DL_LIBS only when building shared library #1951

Closed alexkalmuk closed 3 years ago

alexkalmuk commented 3 years ago

Use CMAKE_DL_LIBS only if it's actually required, that is when building a shared library.

IoT.js-DCO-1.0-Signed-off-by: Alex Kalmuk alexkalmuk@gmail.com

alexkalmuk commented 3 years ago

Ah, my bad, it looks like it's actually required for uv_dlopen here in deps/libtuv/src/unix/dl.c, not for --create-shared-lib option of course. By the way, this file is commented out in deps/libtuv/cmake/option/option_unix_common.cmake, so that's why I faced this issue for a target which lacks dlopen() (and -ldl) and thought that the problem was in --create-shared-lib handling.

alexkalmuk commented 3 years ago

I had this issue when linking iotjs binary against libdl. It looks like for nuttx and tizenrt --buildlib option is used which disables iotjs binary creation, so libdl is not actually used. So maybe I have to use the same option.