티스토리 뷰


DMD repository presents a Visual Studio (VS) environment for building the compiler. As building D programs in Visual Studio basically depends on Visual D, DMD compiler written in D also depends on Visual D in the VS solution environment. Thus we can see the property page of 'dmd' project as follows.






Note 'Output Path' is set as "../../generated/Windows/$(ConfigurationName)/$(PlatformName)", which means the compiled program is created in a subdirectory of <DMD_REPOSITORY>/generated. In my case, for example, the 'dmd.exe' file is located in "D:/repos/dmd/generated/Windows/Release/x64".



The default debugger for D in Visual D is Mago, which also enhances D programming on Windows together with Visual D.




As building DMD compiler requires compiling C/C++ sources, we can also find 'C/C++ Compiler Cmd' in the compiler options as follows.


$(CC) -c -cpp -Isrc;src/backend;src/tk;src/root -DMARS -e -wx -DTARGET_WINDOS=1 -DDM_TARGET_CPU_X86=1





The compiler options are those of DMC, which are translated to those of MSVC. The mapping rule is defined in msvc-dmc.d.


 DMC

MSVC 

Description 

 -c

 /c

 Skip the link, do compile only

 -cpp

 /TP

 Source files are C++

 -e

 /E

 Show results of preprocessor

 -I<path>

 /I<path>

 '#include' file search path

 -wx

 /WX

 Treat warnings as errors


In addition, there are other options for building dmd. The followings are the examples, where we can see some options for code generation and command line. Interestingly, the stack size is defined as 8388608 bytes (8 MiB).







댓글