Skip to content

Commit

Permalink
Update to latest trieste version
Browse files Browse the repository at this point in the history
This reduces the compile time by around 20% as the latest Trieste does
not include CPP::CLI in the main header.
  • Loading branch information
mjp41 committed Nov 27, 2023
1 parent d8d30ed commit 3c68a38
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 17 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set(TRIESTE_BUILD_SAMPLES OFF)
FetchContent_Declare(
trieste
GIT_REPOSITORY https://github.com/microsoft/trieste
GIT_TAG main
GIT_TAG e8bf084a1f9275580db77624df031e500c910f10
GIT_SHALLOW TRUE
)

Expand Down
12 changes: 3 additions & 9 deletions src/lang.cc
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,9 @@ namespace verona
return opts;
}

Driver& driver()
std::vector<Pass> passes()
{
static Driver d(
"Verona",
&options(),
parser(),
{
return {
modules(), structure(), reference(), conditionals(),
lambda(), autocreate(), defaultargs(), typenames(),
typeview(), typefunc(), typealg(), typeflat(),
Expand All @@ -283,8 +279,6 @@ namespace verona
localvar(), assignment(), autofields(), autorhs(),
partialapp(), traitisect(), nlrcheck(), anf(),
defbeforeuse(), drop(), validtypeargs(), // typeinfer(),
});

return d;
};
}
}
9 changes: 3 additions & 6 deletions src/lang.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: MIT
#pragma once

#include <trieste/driver.h>
#include <trieste/trieste.h>

namespace verona
{
Expand Down Expand Up @@ -271,12 +271,9 @@ namespace verona
{
bool no_std = false;

void configure(CLI::App& cli) override
{
cli.add_flag("--no-std", no_std, "Don't import the standard library.");
}
void configure(CLI::App& cli) override;
};

Options& options();
Driver& driver();
std::vector<Pass> passes();
}
17 changes: 16 additions & 1 deletion src/main.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
// Copyright Microsoft and Project Verona Contributors.
// SPDX-License-Identifier: MIT
#include "lang.h"
#include "trieste/driver.h"

namespace verona
{
void Options::configure(CLI::App& cli)
{
cli.add_flag("--no-std", no_std, "Don't import the standard library.");
}
}

int main(int argc, char** argv)
{
return verona::driver().run(argc, argv);
trieste::Driver d(
"Verona",
&verona::options(),
verona::parser(),
verona::passes());

return d.run(argc, argv);
}

0 comments on commit 3c68a38

Please sign in to comment.