ldc/driver/ldmd.d
Johan Engelen 72b5ab7642 Instead of using the C++-linker, use the D compiler to link LDC2 and LDMD.
This removes the need for the CMake logic to figure out what linker flags to pass the C++linker to link D code (50 lines of flaky cmake script).
2016-03-25 12:31:01 +01:00

30 lines
963 B
D
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//===-- driver/ldmd.d - General LLVM codegen helpers ----------*- D -*-===//
//
// LDC the LLVM D compiler
//
// This file is distributed under the BSD-style LDC license. See the LICENSE
// file for details.
//
//===----------------------------------------------------------------------===//
//
// Startup code for driver/ldmd.cpp
//
//===----------------------------------------------------------------------===//
// In driver/ldmd.cpp
extern(C++) int cppmain(int argc, char **argv);
/+ Having a main() in D-source solves a few issues with building/linking with
+ DMD on Windows, with the extra benefit of implicitly initializing the D runtime.
+/
int main()
{
// For now, even just the frontend does not work with GC enabled, so we need
// to disable it entirely.
import core.memory;
GC.disable();
import core.runtime;
auto args = Runtime.cArgs();
return cppmain(args.argc, cast(char**)args.argv);
}