bat/tests/syntax-tests/source/Batch/build.bat
Martin Nordholts 68d525cd8b Don't add artificial newline to last line if --style=plain
This fixes #1438.

Note however, that using a pager such as less will add a newline itself.
So to actually not print a newline for such files, you need to either
disable paging:

  bat --style=plain --paging=never no-newline-at-end-of-file.txt

or use a "pager" that does not add a newline:

  bat --style=plain --pager=cat no-newline-at-end-of-file.txt

Note that we also update syntax tests file since a bunch of them had
missing newlines on the last lines.
2020-12-19 10:32:50 +01:00

60 lines
1.4 KiB
Batchfile

@echo off
:: Change to your LLVM installation
set "LLVMPath=C:\Program Files\LLVM"
:: Change to your Visual Studio 2017 installation
set "VSPath=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community"
set "VSVersion=14.10.25017"
:: Change to your Windows Kit version & installation
set "WinSDKVersion=10.0.15063.0"
set "WinSDKPath=C:\Program Files (x86)\Windows Kits\10"
:: Change this to your resulting exe
set "OUTPUT=test.exe"
:: Setup
set "VSBasePath=%VSPath%\VC\Tools\MSVC\%VSVersion%"
set "PATH=%PATH%;%LLVMPath%\bin;%VSBasePath%\bin\HostX64\x64"
:: Compiler Flags
set CFLAGS= ^
-std=c++14 -Wall -Wextra
set CPPFLAGS= ^
-I "%VSBasePath%\include" ^
-I "%WinSDKPath%\Include\%WinSDKVersion%\shared" ^
-I "%WinSDKPath%\Include\%WinSDKVersion%\ucrt" ^
-I "%WinSDKPath%\Include\%WinSDKVersion%\um"
:: Linker Libs
set LDFLAGS= ^
-machine:x64 ^
-nodefaultlib ^
-subsystem:console
set LDLIBS= ^
-libpath:"%VSBasePath%\lib\x64" ^
-libpath:"%WinSDKPath%\Lib\%WinSDKVersion%\ucrt\x64" ^
-libpath:"%WinSDKPath%\Lib\%WinSDKVersion%\um\x64" ^
libucrt.lib libvcruntime.lib libcmt.lib libcpmt.lib ^
legacy_stdio_definitions.lib oldnames.lib ^
legacy_stdio_wide_specifiers.lib ^
kernel32.lib User32.lib
:: Compiling
@echo on
@for %%f in (*.cc) do (
clang++.exe "%%~f" -o "%%~nf.o" -c %CFLAGS%
)
:: Linking
@set "LINK_FILES="
@for %%f in (*.o) do (
@set "LINK_FILES=%LINK_FILES% %%~f"
)
lld-link.exe %LINK_FILES% -out:"%OUTPUT%" %LDFLAGS% %LDLIBS%