Skip to content

Commit

Permalink
fix windows...
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiayang committed Jul 6, 2019
1 parent 09376f4 commit aaff811
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ static void compile(std::string in, std::string out)

timer t;

platform::compiler::performSelfDlOpen();

fir::Module* module = frontend::generateFIRModule(&state, dtree);
module->finaliseGlobalConstructors();
Expand Down Expand Up @@ -157,6 +156,7 @@ static void compile(std::string in, std::string out)
int main(int argc, char** argv)
{
platform::setupTerminalIfNecessary();
platform::compiler::performSelfDlOpen();

auto [ input_file, output_file ] = frontend::parseCmdLineOpts(argc, argv);
compile(input_file, output_file);
Expand Down
3 changes: 3 additions & 0 deletions source/platform/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,9 @@ namespace compiler
{
#if OS_WINDOWS
currentModule = GetModuleHandle(nullptr);

otherModules.push_back(LoadLibrary("ucrtbase.dll"));
otherModules.push_back(LoadLibrary("vcruntime140.dll"));
#else
currentModule = dlopen(nullptr, RTLD_LAZY);
#endif
Expand Down

0 comments on commit aaff811

Please sign in to comment.