From 8c6cfce9aa2fa8293c30c101b87c5298087833e5 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sat, 5 Oct 2019 08:23:41 +0800 Subject: Codegen C - Fix dylib linking logic to ignore proc macros --- src/trans/codegen_c.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/trans/codegen_c.cpp b/src/trans/codegen_c.cpp index 8198230b..81a1a68c 100644 --- a/src/trans/codegen_c.cpp +++ b/src/trans/codegen_c.cpp @@ -829,12 +829,15 @@ namespace { for( const auto& crate2 : m_crate.m_ext_crates ) { // TODO: Better rule than this - bool is_dylib = (crate2.second.m_path.compare(crate2.second.m_path.size() - 5, 5, ".rlib") != 0); + bool is_dylib = false; + is_dylib |= (crate2.second.m_path.compare(crate2.second.m_path.size() - 3, 3, ".so") == 0); + is_dylib |= (crate2.second.m_path.compare(crate2.second.m_path.size() - 4, 4, ".dll") == 0); if( is_dylib ) { for(const auto& subcrate : crate2.second.m_data->m_ext_crates) { if( subcrate.second.m_path == crate.second.m_path ) { + DEBUG(crate.first << " referenced by dylib " << crate2.first); is_in_dylib = true; } } -- cgit v1.2.3