Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions mesonbuild/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1047,8 +1047,11 @@ def process_compilers_late(self) -> None:
for lang in target_langs:
# Rust is always linked through a C-ABI target, so do not add
# the compiler here
if lang != 'rust' and lang in link_langs and lang not in self.compilers:
self.compilers[lang] = t.all_compilers[lang]
if lang != 'rust' and lang in link_langs:
if lang not in self.all_compilers:
self.all_compilers[lang] = t.all_compilers[lang]
if lang not in self.compilers:
self.compilers[lang] = t.all_compilers[lang]

if not self.compilers:
# No source files or parent targets, target consists of only object
Expand Down Expand Up @@ -1116,6 +1119,8 @@ def process_compilers(self) -> T.List[Language]:
# dealing with compiled C code.
if comp.language == 'vala':
continue
if comp.language not in self.all_compilers:
self.all_compilers[comp.language] = comp
if comp.language not in self.compilers:
self.compilers[comp.language] = comp
if sources:
Expand Down
15 changes: 15 additions & 0 deletions test cases/common/289 subproject with foreign lang/intlib.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include <cstdio>

#if defined _WIN32

extern "C" int __declspec(dllimport) pcre2_function(void);

#else

extern "C" int pcre2_function(void);

#endif

int internal_function(void) {
return pcre2_function();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
project('depfallback', 'cpp')

subp = subproject('pcre2')

lib = static_library('intlib', 'intlib.cpp',
link_with: subp.get_variable('pcre2_lib'))

executable('p2test', 'p2test.cpp',
link_with: lib)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include<cstdio>

int internal_function(void);

int main() {
return internal_function();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
project('pcre2', 'c')

pcre2_lib = shared_library('pcre2', 'pcre.c')
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include<stdlib.h>

#ifdef _WIN32

int __declspec(dllexport) pcre2_function(void);

#else

int pcre2_function(void);

#endif

int pcre2_function(void) {
return 0;
}
Loading