mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
LDC/mingw: use dmd as the host compiler but when compiling dmd
This commit is contained in:
parent
e03db103bd
commit
363a8cc524
3 changed files with 15 additions and 22 deletions
|
@ -48,13 +48,6 @@ msbuild /target:dmd /p:Configuration=%CONFIGURATION% /p:Platform=%PLATFORM% %LDC
|
||||||
%DMD% --version
|
%DMD% --version
|
||||||
grep --version
|
grep --version
|
||||||
|
|
||||||
rem compile run.d before changing the LIB environment variable
|
|
||||||
if "%D_COMPILER%" == "ldc" set HOST_DMD=%LDC_DIR%\bin\ldmd2.exe
|
|
||||||
if "%D_COMPILER%" == "dmd" set HOST_DMD=%DMD_DIR%\dmd2\windows\bin\dmd.exe
|
|
||||||
|
|
||||||
cd "%DMD_DIR%\test"
|
|
||||||
"%HOST_DMD%" -m%MODEL% -i run.d || exit /B 6
|
|
||||||
|
|
||||||
set DRUNTIME_TESTS=test_all
|
set DRUNTIME_TESTS=test_all
|
||||||
cd "%DMD_DIR%"
|
cd "%DMD_DIR%"
|
||||||
if not "%C_RUNTIME%" == "mingw" goto not_mingw
|
if not "%C_RUNTIME%" == "mingw" goto not_mingw
|
||||||
|
@ -73,7 +66,7 @@ if not "%C_RUNTIME%" == "mingw" goto not_mingw
|
||||||
set LIB=%DMD_DIR%\mingw\dmd2\windows\lib%MODEL%\mingw
|
set LIB=%DMD_DIR%\mingw\dmd2\windows\lib%MODEL%\mingw
|
||||||
set REQUIRED_ARGS=-mscrtlib=msvcrt120 "-L/LIBPATH:%DMD_DIR%\mingw\dmd2\windows\lib%MODEL%\mingw"
|
set REQUIRED_ARGS=-mscrtlib=msvcrt120 "-L/LIBPATH:%DMD_DIR%\mingw\dmd2\windows\lib%MODEL%\mingw"
|
||||||
rem delete C++ ABI tests
|
rem delete C++ ABI tests
|
||||||
for /F "tokens=* USEBACKQ" %%F IN (`grep -l EXTRA_CPP_SOURCES test\runnable\*.d`) DO del %%F
|
for /F "tokens=* USEBACKQ" %%F IN (`grep -l EXTRA_CPP_SOURCES test/runnable/*.d`) DO rm %%F
|
||||||
rem FIXME: debug info incomplete when linking through lld-link
|
rem FIXME: debug info incomplete when linking through lld-link
|
||||||
del test\runnable\testpdb.d
|
del test\runnable\testpdb.d
|
||||||
|
|
||||||
|
@ -91,28 +84,26 @@ REM Check: build phobos
|
||||||
cd "%DMD_DIR%\..\phobos"
|
cd "%DMD_DIR%\..\phobos"
|
||||||
"%DM_MAKE%" -f win64.mak MODEL=%MODEL% "DMD=%DMD%" "VCDIR=%VCINSTALLDIR%." "CC=%MSVC_CC%" "AR=%MSVC_AR%" "MAKE=%DM_MAKE%" || exit /B 5
|
"%DM_MAKE%" -f win64.mak MODEL=%MODEL% "DMD=%DMD%" "VCDIR=%VCINSTALLDIR%." "CC=%MSVC_CC%" "AR=%MSVC_AR%" "MAKE=%DM_MAKE%" || exit /B 5
|
||||||
|
|
||||||
REM FIXME: skip testsuite for mingw, ldc needed to build tools, but doesn't work without LIB
|
|
||||||
if "%C_RUNTIME%" == "mingw" goto skip_testsuite
|
|
||||||
|
|
||||||
REM Run DMD testsuite
|
REM Run DMD testsuite
|
||||||
cd "%DMD_DIR%\test"
|
cd "%DMD_DIR%\test"
|
||||||
cp %DMD_DIR%\..\phobos\phobos%MODEL%.lib .
|
|
||||||
set ARGS=-O -inline -g
|
set ARGS=-O -inline -g
|
||||||
set OS=windows
|
set OS=windows
|
||||||
set CC=cl.exe
|
set CC=cl.exe
|
||||||
set DMD_MODEL=%PLATFORM%
|
set DMD_MODEL=%PLATFORM%
|
||||||
set BUILD=%CONFIGURATION%
|
set BUILD=%CONFIGURATION%
|
||||||
run.exe || exit /B 6
|
set HOST_DMD=%DMD_DIR%\dmd2\windows\bin\dmd.exe
|
||||||
|
del phobos%MODEL%.lib
|
||||||
|
|
||||||
:skip_testsuite
|
"%HOST_DMD%" -m%MODEL% -i run.d || exit /B 6
|
||||||
|
run.exe || exit /B 6
|
||||||
|
|
||||||
rem FIXME: lld-link fails to link phobos unittests ("error: relocation against symbol in discarded section: __TMP2427")
|
rem FIXME: lld-link fails to link phobos unittests ("error: relocation against symbol in discarded section: __TMP2427")
|
||||||
if "%C_RUNTIME%" == "mingw" exit /B 0
|
if "%C_RUNTIME%" == "mingw" exit /B 0
|
||||||
|
|
||||||
cd "%DMD_DIR%\..\phobos"
|
cd "%DMD_DIR%\..\phobos"
|
||||||
REM Check: build phobos unittests
|
REM Check: build phobos unittests
|
||||||
if "%D_COMPILER%_%MODEL%" == "ldc_64" cp %LDC_DIR%\lib64\libcurl.dll .
|
if "%D_COMPILER%_%MODEL%" == "ldc_64" copy %LDC_DIR%\lib64\libcurl.dll .
|
||||||
if "%D_COMPILER%_%MODEL%" == "ldc_32mscoff" cp %LDC_DIR%\lib32\libcurl.dll .
|
if "%D_COMPILER%_%MODEL%" == "ldc_32mscoff" copy %LDC_DIR%\lib32\libcurl.dll .
|
||||||
if "%D_COMPILER%_%MODEL%" == "dmd_64" cp %DMD_DIR%\dmd2\windows\bin64\libcurl.dll .
|
if "%D_COMPILER%_%MODEL%" == "dmd_64" copy %DMD_DIR%\dmd2\windows\bin64\libcurl.dll .
|
||||||
if "%D_COMPILER%_%MODEL%" == "dmd_32mscoff" cp %DMD_DIR%\dmd2\windows\bin\libcurl.dll .
|
if "%D_COMPILER%_%MODEL%" == "dmd_32mscoff" copy %DMD_DIR%\dmd2\windows\bin\libcurl.dll .
|
||||||
"%DM_MAKE%" -f win64.mak unittest MODEL=%MODEL% "DMD=%DMD%" "VCDIR=%VCINSTALLDIR%." "CC=%MSVC_CC%" "MAKE=%DM_MAKE%"
|
"%DM_MAKE%" -f win64.mak unittest MODEL=%MODEL% "DMD=%DMD%" "VCDIR=%VCINSTALLDIR%." "CC=%MSVC_CC%" "MAKE=%DM_MAKE%"
|
||||||
|
|
|
@ -53,10 +53,9 @@ dm_make() {
|
||||||
cp "$DMC" "$DM_MAKE" "dm/path"
|
cp "$DMC" "$DM_MAKE" "dm/path"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ "$D_COMPILER" == "dmd" ]; then
|
echo "[STEP]: Downloading DMD"
|
||||||
echo "[STEP]: Downloading DMD"
|
install_host_dmd
|
||||||
install_host_dmd
|
if [ "$D_COMPILER" == "ldc" ]; then
|
||||||
elif [ "$D_COMPILER" == "ldc" ]; then
|
|
||||||
echo "[STEP]: Downloading LDC"
|
echo "[STEP]: Downloading LDC"
|
||||||
ldc
|
ldc
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -40,6 +40,7 @@ jobs:
|
||||||
vmImage: 'vs2017-win2016'
|
vmImage: 'vs2017-win2016'
|
||||||
variables:
|
variables:
|
||||||
VSINSTALLDIR: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\
|
VSINSTALLDIR: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\
|
||||||
|
HOST_DMD_VERSION: 2.090.0
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
win32-ldc:
|
win32-ldc:
|
||||||
|
@ -58,6 +59,7 @@ jobs:
|
||||||
vmImage: 'vs2017-win2016'
|
vmImage: 'vs2017-win2016'
|
||||||
variables:
|
variables:
|
||||||
VSINSTALLDIR: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\
|
VSINSTALLDIR: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\
|
||||||
|
HOST_DMD_VERSION: 2.090.0
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
x64-debug-ldc:
|
x64-debug-ldc:
|
||||||
|
@ -77,6 +79,7 @@ jobs:
|
||||||
vmImage: 'vs2017-win2016'
|
vmImage: 'vs2017-win2016'
|
||||||
variables:
|
variables:
|
||||||
VSINSTALLDIR: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\
|
VSINSTALLDIR: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\
|
||||||
|
HOST_DMD_VERSION: 2.090.0
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
win32-ldc:
|
win32-ldc:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue