diff options
author | John Hodge <tpg@ucc.asn.au> | 2019-10-05 08:23:41 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2019-10-05 08:23:41 +0800 |
commit | 8c6cfce9aa2fa8293c30c101b87c5298087833e5 (patch) | |
tree | 623104ce2aad55be1038dc22969474562a337df7 /src/trans/codegen_c.cpp | |
parent | 0a591f10475f29ce18a472eef363822c80443994 (diff) | |
download | mrust-8c6cfce9aa2fa8293c30c101b87c5298087833e5.tar.gz |
Codegen C - Fix dylib linking logic to ignore proc macros
Diffstat (limited to 'src/trans/codegen_c.cpp')
-rw-r--r-- | src/trans/codegen_c.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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; } } |