From d83354a8dd4887690535b649189e9bb1d98093ae Mon Sep 17 00:00:00 2001 From: Evgeny Vrublevsky Date: Sat, 23 Sep 2023 14:16:21 +0300 Subject: [PATCH 1/3] Fix default VS project settings. --- src/cc65.props | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cc65.props b/src/cc65.props index ef5a37fea..19fb0b646 100644 --- a/src/cc65.props +++ b/src/cc65.props @@ -21,6 +21,7 @@ true _CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_WIN32_WINNT=0x0601;WINVER=0x0601;NTDDI_VERSION=0x06010000;%(PreprocessorDefinitions) common + /utf-8 %(AdditionalOptions) $(IntDir)..\..\common\$(Configuration)\common.lib @@ -42,13 +43,13 @@ false - true MultiThreaded true MaxSpeed + true false false @@ -57,6 +58,7 @@ true true UseLinkTimeCodeGeneration + /EMITTOOLVERSIONINFO:NO /NOVCFEATURE /NOCOFFGRPINFO %(AdditionalOptions) From 9b9e955eb11e0e86b4dfc73a81005d61905b773a Mon Sep 17 00:00:00 2001 From: Evgeny Vrublevsky Date: Sat, 23 Sep 2023 14:16:50 +0300 Subject: [PATCH 2/3] Add basic .editorconfig. --- .editorconfig | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..3920829e6 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +root = true + +[*] +charset = utf-8 +end_of_line = crlf +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true +insert_final_newline = true +guidelines = 80, 120 + +[*.{c,h}] +cpp_new_line_before_open_brace_block=same_line +cpp_new_line_before_open_brace_function=new_line +cpp_space_before_function_open_parenthesis=insert +cpp_new_line_before_else=false From 148942ff1dce082928f66e3a510b33def4817b44 Mon Sep 17 00:00:00 2001 From: Evgeny Vrublevsky Date: Sat, 23 Sep 2023 14:25:22 +0300 Subject: [PATCH 3/3] Don't use hardcoded Visual Studio installation path in msbuild.cmd. --- src/msbuild.cmd | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/msbuild.cmd b/src/msbuild.cmd index 2e1821f0a..092bfb578 100644 --- a/src/msbuild.cmd +++ b/src/msbuild.cmd @@ -1,18 +1,23 @@ @echo off +setlocal -if exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\VsDevCmd.bat" goto vs2017 -if exist "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat" goto vs2019 +where msbuild.exe 1>nul 2>&1 && goto :ready -echo Error: VsDevCmd.bat not found! -goto:eof +set VSWHERE_PATH=%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe +if not exist "%VSWHERE_PATH%" set VSWHERE_PATH=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe +if not exist "%VSWHERE_PATH%" goto :error +for /f "usebackq delims=#" %%a in (`"%VSWHERE_PATH%" -latest -property installationPath`) do set VSDEVCMD_PATH=%%a\Common7\Tools\VsDevCmd.bat +if not exist "%VSDEVCMD_PATH%" goto :error +set VSCMD_SKIP_SENDTELEMETRY=1 +call "%VSDEVCMD_PATH%" -no_logo -startdir=none -:vs2017 -call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\VsDevCmd.bat" -goto run +where msbuild.exe 1>nul 2>&1 && goto :ready -:vs2019 -call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat" -goto run +:error + +echo Error: Can't find MSBuild. +exit /b 1 + +:ready -:run msbuild.exe %*