Skip to content
Snippets Groups Projects
Commit 4b8946fb authored by Adrien Béraud's avatar Adrien Béraud
Browse files

cmake/nodejs: improve dependency lookup

Change-Id: Iaa92e035fe4ac6a09e1586e7f4d681ecf1b053f4
parent 58758918
Branches
No related tags found
No related merge requests found
......@@ -655,17 +655,21 @@ else()
foreach(LIB IN LISTS _linked_libs)
if ("${LIB}" MATCHES "^PkgConfig::")
string(REPLACE "PkgConfig::" "" PKG_NAME ${LIB})
string(APPEND _gyp_flags " ${${PKG_NAME}_LDFLAGS}")
set (PKG_FLAGS ${${PKG_NAME}_LDFLAGS})
string(REPLACE "-framework;" "-framework " PKG_FLAGS "${PKG_FLAGS}")
list(APPEND _gyp_flags " ${PKG_FLAGS}")
elseif ("${LIB}" MATCHES ".so$")
get_filename_component(LIB_DIRECTORY ${LIB} DIRECTORY)
get_filename_component(LIB_NAME_WE ${LIB} NAME_WE)
string(REPLACE "lib" "" LIB_NAME_WE ${LIB_NAME_WE})
string(APPEND _gyp_flags " -L${LIB_DIRECTORY} -l${LIB_NAME_WE}")
list(APPEND _gyp_flags " -L${LIB_DIRECTORY} -l${LIB_NAME_WE}")
elseif (TARGET ${LIB})
# TODO generate cmake targets automatically
#string(APPEND _gyp_flags " $<TARGET_FILE:${LIB}>")
get_target_property(LIB_PATH ${LIB} LOCATION)
list(APPEND _gyp_flags " ${LIB_PATH}")
elseif ("${LIB}" MATCHES "^-")
list(APPEND _gyp_flags " ${LIB}")
else()
string(APPEND _gyp_flags " -l${LIB}")
list(APPEND _gyp_flags " -l${LIB}")
endif()
endforeach()
......
......@@ -5,7 +5,7 @@
"sources": [ "jami_wrapper.cpp" ],
'include_dirs': ['../../src/'],
"ldflags": ["-Wl,-Bsymbolic"],
'libraries': ['-L@JAMI_LINK_DIRECTORIES@', '-ljami-core', '-lyaml-cpp', @JAMI_LINK_LIBRARIES@],
'libraries': ['-L@JAMI_LINK_DIRECTORIES@', '-ljami-core', @JAMI_LINK_LIBRARIES@],
'cflags!': [ '-fno-exceptions' ],
'cflags_cc!': [ '-fno-exceptions', '-fno-rtti', '-std=gnu++1y' ],
'cflags_cc': [ '-std=gnu++17', '-frtti', '-fexceptions' ],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment