You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cmake_minimum_required(VERSION 3.5)
project(cmMod)
set (CMAKE_CXX_STANDARD 14)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_library(cmModLib1 STATIC cmMod1.cpp)
add_library(cmModLib2 STATIC cmMod2.cpp)
# This is what is not working
target_link_libraries(cmModLib1 PUBLIC cmModLib2)
meson.build:
project('cmakeSubTest', ['c', 'cpp'])
cm = import('cmake')
sub_pro = cm.subproject('cmMod')
# require only the first one
sub_dep = sub_pro.dependency('cmModLib1', include_type: 'system')
exe1 = executable('main', ['main.cpp'], dependencies: [sub_dep])
test('test1', exe1)
The problem is that when resolving the dependencies, only targets that have IMPORTED_LOCATION or IMPORTED_IMPLIB result in an actual library dependency in meson:
Only imported targets have these, internal CMake targets have to be included via LINK_LIBRARIES / INTERFACE_LINK_LIBRARIES - in the code, these are used only for recursion.
The text was updated successfully, but these errors were encountered:
subprojects/cmMod
:meson.build
:Result:
The problem is that when resolving the dependencies, only targets that have
IMPORTED_LOCATION
orIMPORTED_IMPLIB
result in an actual library dependency inmeson
:https://github.com/mmomtchev/meson/blob/648a3ddd65a6010dbfaf42bf9de624c2ae47bccd/mesonbuild/cmake/tracetargets.py#L118
Only imported targets have these, internal
CMake
targets have to be included viaLINK_LIBRARIES
/INTERFACE_LINK_LIBRARIES
- in the code, these are used only for recursion.The text was updated successfully, but these errors were encountered: