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
No related branches found
No related tags found
No related merge requests found
...@@ -655,17 +655,21 @@ else() ...@@ -655,17 +655,21 @@ else()
foreach(LIB IN LISTS _linked_libs) foreach(LIB IN LISTS _linked_libs)
if ("${LIB}" MATCHES "^PkgConfig::") if ("${LIB}" MATCHES "^PkgConfig::")
string(REPLACE "PkgConfig::" "" PKG_NAME ${LIB}) 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$") elseif ("${LIB}" MATCHES ".so$")
get_filename_component(LIB_DIRECTORY ${LIB} DIRECTORY) get_filename_component(LIB_DIRECTORY ${LIB} DIRECTORY)
get_filename_component(LIB_NAME_WE ${LIB} NAME_WE) get_filename_component(LIB_NAME_WE ${LIB} NAME_WE)
string(REPLACE "lib" "" 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}) elseif (TARGET ${LIB})
# TODO generate cmake targets automatically get_target_property(LIB_PATH ${LIB} LOCATION)
#string(APPEND _gyp_flags " $<TARGET_FILE:${LIB}>") list(APPEND _gyp_flags " ${LIB_PATH}")
elseif ("${LIB}" MATCHES "^-")
list(APPEND _gyp_flags " ${LIB}")
else() else()
string(APPEND _gyp_flags " -l${LIB}") list(APPEND _gyp_flags " -l${LIB}")
endif() endif()
endforeach() endforeach()
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"sources": [ "jami_wrapper.cpp" ], "sources": [ "jami_wrapper.cpp" ],
'include_dirs': ['../../src/'], 'include_dirs': ['../../src/'],
"ldflags": ["-Wl,-Bsymbolic"], "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!': [ '-fno-exceptions' ],
'cflags_cc!': [ '-fno-exceptions', '-fno-rtti', '-std=gnu++1y' ], 'cflags_cc!': [ '-fno-exceptions', '-fno-rtti', '-std=gnu++1y' ],
'cflags_cc': [ '-std=gnu++17', '-frtti', '-fexceptions' ], 'cflags_cc': [ '-std=gnu++17', '-frtti', '-fexceptions' ],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment