Skip to content
Permalink
Browse files

Add cross test for macos.

  • Loading branch information...
egorpugin committed Aug 11, 2019
1 parent e6c3807 commit 0cec6efabe42d0239db1a580787fff07ccf4bcf2
Showing with 41 additions and 1 deletion.
  1. +14 −1 src/sw/driver/target/native.cpp
  2. +20 −0 test/build/cross/main.cpp
  3. +7 −0 test/build/cross/sw.cpp
@@ -271,13 +271,26 @@ void NativeCompiledTarget::activateCompiler(const TargetSetting &s, const Unreso
else if (id.ppath == "org.gnu.gcc.as")
c = std::make_shared<GNUASMCompiler>(getSolution().getContext());
else if (id.ppath == "org.gnu.gcc" || id.ppath == "org.gnu.gpp")
c = std::make_shared<GNUCompiler>(getSolution().getContext());
{
auto C = std::make_shared<GNUCompiler>(getSolution().getContext());
c = C;
/*if (getBuildSettings().TargetOS.is(OSType::Macos))
{
C->VisibilityHidden = false;
C->VisibilityInlinesHidden = false;
}*/
}
else if (id.ppath == "org.LLVM.clang" || id.ppath == "org.LLVM.clangpp")
{
auto C = std::make_shared<ClangCompiler>(getSolution().getContext());
c = C;
create_command();
C->Target = getBuildSettings().getTargetTriplet();
/*if (getBuildSettings().TargetOS.is(OSType::Macos))
{
C->VisibilityHidden = false;
C->VisibilityInlinesHidden = false;
}*/
}
else if (id.ppath == "org.LLVM.clangcl")
{
@@ -0,0 +1,20 @@
#include <iostream>

#include <primitives/sw/main.h>

int main(int argc, char **argv)
{
try { throw 5; }
catch (int) { std::cout << "int\n"; }
try { throw 5.0; }
catch (double) { std::cout << "double\n"; }
struct X {};
try { throw X{}; }
catch (X) { std::cout << "struct X\n"; }

try { throw std::runtime_error("x"); }
catch (std::runtime_error &) { std::cout << "Hello, World!\n"; }
catch (std::exception &) {}

return 0;
}
@@ -0,0 +1,7 @@
void build(Solution &s)
{
auto &t = s.addExecutable("test");
t += cpp17;
t += "main.cpp";
t += "pub.egorpugin.primitives.sw.main-master"_dep;
}

0 comments on commit 0cec6ef

Please sign in to comment.
You can’t perform that action at this time.