Skip to content
This repository has been archived by the owner on Aug 12, 2018. It is now read-only.

Commit

Permalink
Update to MSVC 2017.
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Aug 6, 2017
1 parent 06f5999 commit 17cd1b8
Show file tree
Hide file tree
Showing 12 changed files with 89 additions and 85 deletions.
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@
* <kbd>Ctrl+Alt+Shift+F2</kbd> Expand selection to previous match.
* <kbd>Ctrl+Shift+Enter</kbd> New line with toggled auto indent option.

You can use MSVC 2015 to build Notepad2-mod.
You can use MSVC 2017 to build Notepad2-mod.
19 changes: 12 additions & 7 deletions build/build_vs2015.bat → build/build_vs2017.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,14 @@ rem * Batch file used to build Notepad2 with MSVC2015
rem *
rem * See License.txt for details about distribution and modification.
rem *
rem * (c) XhmikosR 2010-2015
rem * (c) XhmikosR 2010-2015, 2017
rem * https://github.com/XhmikosR/notepad2-mod
rem *
rem ******************************************************************************

SETLOCAL ENABLEEXTENSIONS
CD /D %~dp0

rem Check the building environment
IF NOT DEFINED VS140COMNTOOLS CALL :SUBMSG "ERROR" "Visual Studio 2015 wasn't found!"


rem Check for the help switches
IF /I "%~1" == "help" GOTO SHOWHELP
IF /I "%~1" == "/help" GOTO SHOWHELP
Expand Down Expand Up @@ -103,20 +99,23 @@ IF "%~3" == "" (


:START
CALL :SubVSPath
IF NOT EXIST "%VS_PATH%" CALL :SUBMSG "ERROR" "Visual Studio 2017 NOT FOUND!"

IF /I "%ARCH%" == "x64" GOTO x64
IF /I "%ARCH%" == "x86" GOTO x86


:x86
CALL "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x86
CALL "%VS_PATH%\Common7\Tools\vsdevcmd" -no_logo -arch=x86

IF /I "%CONFIG%" == "all" (CALL :SUBMSVC %BUILDTYPE% Debug Win32 && CALL :SUBMSVC %BUILDTYPE% Release Win32) ELSE (CALL :SUBMSVC %BUILDTYPE% %CONFIG% Win32)

IF /I "%ARCH%" == "x86" GOTO END


:x64
CALL "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x86_amd64
CALL "%VS_PATH%\Common7\Tools\vsdevcmd" -no_logo -arch=amd64

IF /I "%CONFIG%" == "all" (CALL :SUBMSVC %BUILDTYPE% Debug x64 && CALL :SUBMSVC %BUILDTYPE% Release x64) ELSE (CALL :SUBMSVC %BUILDTYPE% %CONFIG% x64)

Expand All @@ -127,6 +126,12 @@ ENDLOCAL
EXIT /B


:SubVSPath
rem Check the building environment
FOR /f "delims=" %%A IN ('"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -property installationPath -latest -requires Microsoft.Component.MSBuild Microsoft.VisualStudio.Component.VC.ATLMFC Microsoft.VisualStudio.Component.VC.Tools.x86.x64') DO SET "VS_PATH=%%A"
EXIT /B


:SUBMSVC
ECHO.
TITLE Building Notepad2-mod with MSVC2015 - %~1 "%~2|%~3"...
Expand Down
18 changes: 10 additions & 8 deletions build/coverity.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ rem * Originally taken and adapted from https://github.com/mpc-hc/mpc-hc
rem *
rem * See License.txt for details about distribution and modification.
rem *
rem * (c) XhmikosR 2013-2015
rem * (c) XhmikosR 2013-2015, 2017
rem * https://github.com/XhmikosR/notepad2-mod
rem *
rem ******************************************************************************
Expand All @@ -27,22 +27,19 @@ IF DEFINED COVDIR IF NOT EXIST "%COVDIR%" (
)


CALL "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x86
IF %ERRORLEVEL% NEQ 0 (
ECHO vcvarsall.bat call failed.
GOTO End
)
CALL :SubVSPath
IF NOT EXIST "%VS_PATH%" CALL :SUBMSG "ERROR" "Visual Studio 2017 NOT FOUND!"


:Cleanup
IF EXIST "cov-int" RD /q /s "cov-int"
IF EXIST "cov-int" RD /q /s "cov-int"
IF EXIST "Notepad2-mod.lzma" DEL "Notepad2-mod.lzma"
IF EXIST "Notepad2-mod.tar" DEL "Notepad2-mod.tar"
IF EXIST "Notepad2-mod.tgz" DEL "Notepad2-mod.tgz"


:Main
"%COVDIR%\bin\cov-build.exe" --dir cov-int "build_vs2015.bat" Rebuild All Release
"%COVDIR%\bin\cov-build.exe" --dir cov-int "build_vs2017.bat" Rebuild All Release


:tar
Expand Down Expand Up @@ -77,6 +74,11 @@ FOR /F "tokens=2*" %%A IN (
EXIT /B


:SubVSPath
FOR /f "delims=" %%A IN ('"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -property installationPath -latest -requires Microsoft.Component.MSBuild Microsoft.VisualStudio.Component.VC.ATLMFC Microsoft.VisualStudio.Component.VC.Tools.x86.x64') DO SET "VS_PATH=%%A"
EXIT /B


:End
POPD
ECHO. & ECHO Press any key to close this window...
Expand Down
8 changes: 4 additions & 4 deletions build/make_all_vs2015.bat → build/make_all_vs2017.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ rem * and creating the installer/zip packages
rem *
rem * See License.txt for details about distribution and modification.
rem *
rem * (c) XhmikosR 2010-2015
rem * (c) XhmikosR 2010-2015, 2017
rem * https://github.com/XhmikosR/notepad2-mod
rem *
rem ******************************************************************************

SETLOCAL
CD /D %~dp0

CALL "build_vs2015.bat" %1
CALL "make_installer.bat" vs2015
CALL "make_zip.bat" vs2015
CALL "build_vs2017.bat" %1
CALL "make_installer.bat" vs2017
CALL "make_zip.bat" vs2017


:END
Expand Down
16 changes: 8 additions & 8 deletions build/make_installer.bat
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ CALL :SubDetectInnoSetup

rem Check for the first switch
IF "%~1" == "" (
SET "COMPILER=VS2015"
SET "COMPILER=VS2017"
) ELSE (
IF /I "%~1" == "VS2015" SET "COMPILER=VS2015" & GOTO START
IF /I "%~1" == "/VS2015" SET "COMPILER=VS2015" & GOTO START
IF /I "%~1" == "-VS2015" SET "COMPILER=VS2015" & GOTO START
IF /I "%~1" == "--VS2015" SET "COMPILER=VS2015" & GOTO START
IF /I "%~1" == "VS2017" SET "COMPILER=VS2017" & GOTO START
IF /I "%~1" == "/VS2017" SET "COMPILER=VS2017" & GOTO START
IF /I "%~1" == "-VS2017" SET "COMPILER=VS2017" & GOTO START
IF /I "%~1" == "--VS2017" SET "COMPILER=VS2017" & GOTO START

ECHO.
ECHO Unsupported commandline switch!
Expand All @@ -53,7 +53,7 @@ IF EXIST "%~dp0..\signinfo.txt" SET "SIGN=True"

SET INPUTDIRx86=bin\%COMPILER%\Release_x86
SET INPUTDIRx64=bin\%COMPILER%\Release_x64
IF /I NOT "%COMPILER%" == "VS2015" SET SUFFIX=_%COMPILER%
IF /I NOT "%COMPILER%" == "VS2017" SET SUFFIX=_%COMPILER%
SET "TEMP_NAME=temp_zip%SUFFIX%"

IF NOT EXIST "..\%INPUTDIRx86%\Notepad2.exe" CALL :SUBMSG "ERROR" "Compile Notepad2 x86 first!"
Expand Down Expand Up @@ -125,7 +125,7 @@ EXIT /B
:SHOWHELP
TITLE %~nx0 %1
ECHO. & ECHO.
ECHO Usage: %~nx0 [VS2015]
ECHO Usage: %~nx0 [VS2017]
ECHO.
ECHO Notes: You can also prefix the commands with "-", "--" or "/".
ECHO The arguments are not case sensitive.
Expand All @@ -134,7 +134,7 @@ ECHO You can use another Inno Setup location by defining %%InnoSetupPath
ECHO This is usefull if you have the Unicode build installed
ECHO and you want to use the ANSI one.
ECHO. & ECHO.
ECHO Executing %~nx0 without any arguments is equivalent to "%~nx0 VS2015"
ECHO Executing %~nx0 without any arguments is equivalent to "%~nx0 VS2017"
ECHO.
ENDLOCAL
EXIT /B
Expand Down
16 changes: 8 additions & 8 deletions build/make_zip.bat
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ IF /I "%~1" == "/?" GOTO SHOWHELP

rem Check for the first switch
IF "%~1" == "" (
SET "COMPILER=VS2015"
SET "COMPILER=VS2017"
) ELSE (
IF /I "%~1" == "VS2015" (SET "COMPILER=VS2015" & GOTO START)
IF /I "%~1" == "/VS2015" (SET "COMPILER=VS2015" & GOTO START)
IF /I "%~1" == "-VS2015" (SET "COMPILER=VS2015" & GOTO START)
IF /I "%~1" == "--VS2015" (SET "COMPILER=VS2015" & GOTO START)
IF /I "%~1" == "VS2017" (SET "COMPILER=VS2017" & GOTO START)
IF /I "%~1" == "/VS2017" (SET "COMPILER=VS2017" & GOTO START)
IF /I "%~1" == "-VS2017" (SET "COMPILER=VS2017" & GOTO START)
IF /I "%~1" == "--VS2017" (SET "COMPILER=VS2017" & GOTO START)

ECHO.
ECHO Unsupported commandline switch!
Expand All @@ -46,7 +46,7 @@ IF EXIST "%~dp0..\signinfo.txt" SET "SIGN=True"

SET INPUTDIRx86=bin\%COMPILER%\Release_x86
SET INPUTDIRx64=bin\%COMPILER%\Release_x64
IF /I NOT "%COMPILER%" == "VS2015" SET SUFFIX=_%COMPILER%
IF /I NOT "%COMPILER%" == "VS2017" SET SUFFIX=_%COMPILER%
SET "TEMP_NAME=temp_zip%SUFFIX%"

IF NOT EXIST "..\%INPUTDIRx86%\Notepad2.exe" CALL :SUBMSG "ERROR" "Compile Notepad2 x86 first!"
Expand Down Expand Up @@ -164,12 +164,12 @@ EXIT /B
:SHOWHELP
TITLE %~nx0 %1
ECHO. & ECHO.
ECHO Usage: %~nx0 [VS2015]
ECHO Usage: %~nx0 [VS2017]
ECHO.
ECHO Notes: You can also prefix the commands with "-", "--" or "/".
ECHO The arguments are not case sensitive.
ECHO. & ECHO.
ECHO Executing %~nx0 without any arguments is equivalent to "%~nx0 VS2015"
ECHO Executing %~nx0 without any arguments is equivalent to "%~nx0 VS2017"
ECHO.
ENDLOCAL
EXIT /B
Expand Down
17 changes: 10 additions & 7 deletions build/sign.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ rem * Originally taken and adapted from https://github.com/mpc-hc/mpc-hc
rem *
rem * See License.txt for details about distribution and modification.
rem *
rem * (c) XhmikosR 2013-2015
rem * (c) XhmikosR 2013-2015, 2017
rem * https://github.com/XhmikosR/notepad2-mod
rem *
rem ******************************************************************************
Expand All @@ -24,19 +24,18 @@ IF "%~1" == "" (
GOTO END
)

IF NOT DEFINED VS140COMNTOOLS (
ECHO %~nx0: Visual Studio 2015 does not seem to be installed...
SET SIGN_ERROR=True
GOTO END
)
CALL :SubVSPath
IF NOT EXIST "%VS_PATH%" CALL :SUBMSG "ERROR" "Visual Studio 2017 NOT FOUND!"

IF NOT EXIST "%FILE_DIR%..\signinfo.txt" (
ECHO %~nx0: %FILE_DIR%..\signinfo.txt is not present!
SET SIGN_ERROR=True
GOTO END
)

signtool /? 2>NUL || CALL "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" 2>NUL
SET "TOOLSET=%VS_PATH%\Common7\Tools\vsdevcmd"

signtool /? 2>NUL || CALL "%TOOLSET%" 2>NUL
IF %ERRORLEVEL% NEQ 0 (
ECHO vcvarsall.bat call failed.
GOTO End
Expand All @@ -55,6 +54,10 @@ IF /I "%SIGN_ERROR%" == "True" (
ENDLOCAL
EXIT /B

:SubVSPath
FOR /f "delims=" %%A IN ('"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -property installationPath -latest -requires Microsoft.Component.MSBuild Microsoft.VisualStudio.Component.VC.ATLMFC Microsoft.VisualStudio.Component.VC.Tools.x86.x64') DO SET "VS_PATH=%%A"
EXIT /B

:START_SIGN
IF /I "%SIGN_ERROR%" == "True" EXIT /B
REM %1 is name of the file to sign
Expand Down
14 changes: 7 additions & 7 deletions distrib/notepad2_setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
; Inno Setup: http://www.jrsoftware.org/isdl.php


#define VS2015
#define VS2017

; Preprocessor related stuff
#if VER < EncodeVer(5,5,9)
#error Update your Inno Setup version (5.5.9 or newer)
#endif

#if !defined(VS2015)
#error You need to define the compiler used; VS2015
#if !defined(VS2017)
#error You need to define the compiler used; VS2017
#endif

#if defined(VS2015)
#define compiler "VS2015"
#if defined(VS2017)
#define compiler "VS2017"
#endif

#define bindir "..\bin\" + compiler
Expand Down Expand Up @@ -60,15 +60,15 @@ AppContact=https://github.com/XhmikosR/notepad2-mod
AppCopyright={#app_copyright}
VersionInfoVersion={#app_version}
UninstallDisplayIcon={app}\Notepad2.exe
#if defined(VS2015)
#if defined(VS2017)
UninstallDisplayName={#app_name} {#app_version}
#else
UninstallDisplayName={#app_name} {#app_version} ({#compiler})
#endif
DefaultDirName={pf}\Notepad2
LicenseFile=license.txt
OutputDir=.
#if defined(VS2015)
#if defined(VS2017)
OutputBaseFilename={#app_name}.{#app_version}
#else
OutputBaseFilename={#app_name}.{#app_version}_{#compiler}
Expand Down
26 changes: 13 additions & 13 deletions scintilla/Scintilla.vcxproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
Expand Down Expand Up @@ -28,23 +28,23 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<CharacterSet>Unicode</CharacterSet>
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v140_xp</PlatformToolset>
<PlatformToolset>v141_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<CharacterSet>Unicode</CharacterSet>
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v140_xp</PlatformToolset>
<PlatformToolset>v141_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<CharacterSet>Unicode</CharacterSet>
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v140_xp</PlatformToolset>
<PlatformToolset>v141_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<CharacterSet>Unicode</CharacterSet>
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v140_xp</PlatformToolset>
<PlatformToolset>v141_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
Expand All @@ -65,14 +65,14 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\bin\VS2015\$(Configuration)_x86\obj\scintilla\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\bin\VS2015\$(Configuration)_x64\obj\scintilla\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\bin\VS2015\$(Configuration)_x86\obj\scintilla\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\bin\VS2015\$(Configuration)_x64\obj\scintilla\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\bin\VS2015\$(Configuration)_x86\obj\scintilla\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\bin\VS2015\$(Configuration)_x64\obj\scintilla\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\bin\VS2015\$(Configuration)_x86\obj\scintilla\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\bin\VS2015\$(Configuration)_x64\obj\scintilla\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\bin\VS2017\$(Configuration)_x86\obj\scintilla\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\bin\VS2017\$(Configuration)_x64\obj\scintilla\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\bin\VS2017\$(Configuration)_x86\obj\scintilla\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\bin\VS2017\$(Configuration)_x64\obj\scintilla\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\bin\VS2017\$(Configuration)_x86\obj\scintilla\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\bin\VS2017\$(Configuration)_x64\obj\scintilla\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\bin\VS2017\$(Configuration)_x86\obj\scintilla\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\bin\VS2017\$(Configuration)_x64\obj\scintilla\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
</PropertyGroup>
Expand Down
3 changes: 0 additions & 3 deletions scintilla/Scintilla.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,6 @@
<ClInclude Include="src\XPM.h">
<Filter>src</Filter>
</ClInclude>
<ClInclude Include="win32\HanjaDic.h">
<Filter>win32</Filter>
</ClInclude>
<ClInclude Include="win32\PlatWin.h">
<Filter>win32</Filter>
</ClInclude>
Expand Down
Loading

0 comments on commit 17cd1b8

Please sign in to comment.