Skip to content

Commit 0cec6ef

Browse files
committed
Add cross test for macos.
1 parent e6c3807 commit 0cec6ef

3 files changed

Lines changed: 41 additions & 1 deletion

File tree

src/sw/driver/target/native.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,13 +271,26 @@ void NativeCompiledTarget::activateCompiler(const TargetSetting &s, const Unreso
271271
else if (id.ppath == "org.gnu.gcc.as")
272272
c = std::make_shared<GNUASMCompiler>(getSolution().getContext());
273273
else if (id.ppath == "org.gnu.gcc" || id.ppath == "org.gnu.gpp")
274-
c = std::make_shared<GNUCompiler>(getSolution().getContext());
274+
{
275+
auto C = std::make_shared<GNUCompiler>(getSolution().getContext());
276+
c = C;
277+
/*if (getBuildSettings().TargetOS.is(OSType::Macos))
278+
{
279+
C->VisibilityHidden = false;
280+
C->VisibilityInlinesHidden = false;
281+
}*/
282+
}
275283
else if (id.ppath == "org.LLVM.clang" || id.ppath == "org.LLVM.clangpp")
276284
{
277285
auto C = std::make_shared<ClangCompiler>(getSolution().getContext());
278286
c = C;
279287
create_command();
280288
C->Target = getBuildSettings().getTargetTriplet();
289+
/*if (getBuildSettings().TargetOS.is(OSType::Macos))
290+
{
291+
C->VisibilityHidden = false;
292+
C->VisibilityInlinesHidden = false;
293+
}*/
281294
}
282295
else if (id.ppath == "org.LLVM.clangcl")
283296
{

test/build/cross/main.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#include <iostream>
2+
3+
#include <primitives/sw/main.h>
4+
5+
int main(int argc, char **argv)
6+
{
7+
try { throw 5; }
8+
catch (int) { std::cout << "int\n"; }
9+
try { throw 5.0; }
10+
catch (double) { std::cout << "double\n"; }
11+
struct X {};
12+
try { throw X{}; }
13+
catch (X) { std::cout << "struct X\n"; }
14+
15+
try { throw std::runtime_error("x"); }
16+
catch (std::runtime_error &) { std::cout << "Hello, World!\n"; }
17+
catch (std::exception &) {}
18+
19+
return 0;
20+
}

test/build/cross/sw.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
void build(Solution &s)
2+
{
3+
auto &t = s.addExecutable("test");
4+
t += cpp17;
5+
t += "main.cpp";
6+
t += "pub.egorpugin.primitives.sw.main-master"_dep;
7+
}

0 commit comments

Comments
 (0)