From 38ef1ce6de2e83f5bdceec3c2c15e5eae4fa04b4 Mon Sep 17 00:00:00 2001 From: Adeel Date: Sun, 11 Dec 2016 17:37:25 +0200 Subject: [PATCH 1/2] Add more configurations to static compile VCR libs Fix #199 --- win/sassc.sln | 14 +++++++- win/sassc.vcxproj | 91 +++++++++++++++++------------------------------ 2 files changed, 46 insertions(+), 59 deletions(-) diff --git a/win/sassc.sln b/win/sassc.sln index d02f415..c6bd361 100644 --- a/win/sassc.sln +++ b/win/sassc.sln @@ -1,22 +1,34 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.23107.0 +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sassc", "sassc.vcxproj", "{E4030474-AFC9-4CC6-BEB6-D846F631502B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug without static runtime|Win32 = Debug without static runtime|Win32 + Debug without static runtime|Win64 = Debug without static runtime|Win64 Debug|Win32 = Debug|Win32 Debug|Win64 = Debug|Win64 + Release without static runtime|Win32 = Release without static runtime|Win32 + Release without static runtime|Win64 = Release without static runtime|Win64 Release|Win32 = Release|Win32 Release|Win64 = Release|Win64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E4030474-AFC9-4CC6-BEB6-D846F631502B}.Debug without static runtime|Win32.ActiveCfg = Debug without static runtime|Win32 + {E4030474-AFC9-4CC6-BEB6-D846F631502B}.Debug without static runtime|Win32.Build.0 = Debug without static runtime|Win32 + {E4030474-AFC9-4CC6-BEB6-D846F631502B}.Debug without static runtime|Win64.ActiveCfg = Debug without static runtime|x64 + {E4030474-AFC9-4CC6-BEB6-D846F631502B}.Debug without static runtime|Win64.Build.0 = Debug without static runtime|x64 {E4030474-AFC9-4CC6-BEB6-D846F631502B}.Debug|Win32.ActiveCfg = Debug|Win32 {E4030474-AFC9-4CC6-BEB6-D846F631502B}.Debug|Win32.Build.0 = Debug|Win32 {E4030474-AFC9-4CC6-BEB6-D846F631502B}.Debug|Win64.ActiveCfg = Debug|x64 {E4030474-AFC9-4CC6-BEB6-D846F631502B}.Debug|Win64.Build.0 = Debug|x64 + {E4030474-AFC9-4CC6-BEB6-D846F631502B}.Release without static runtime|Win32.ActiveCfg = Release without static runtime|Win32 + {E4030474-AFC9-4CC6-BEB6-D846F631502B}.Release without static runtime|Win32.Build.0 = Release without static runtime|Win32 + {E4030474-AFC9-4CC6-BEB6-D846F631502B}.Release without static runtime|Win64.ActiveCfg = Release without static runtime|x64 + {E4030474-AFC9-4CC6-BEB6-D846F631502B}.Release without static runtime|Win64.Build.0 = Release without static runtime|x64 {E4030474-AFC9-4CC6-BEB6-D846F631502B}.Release|Win32.ActiveCfg = Release|Win32 {E4030474-AFC9-4CC6-BEB6-D846F631502B}.Release|Win32.Build.0 = Release|Win32 {E4030474-AFC9-4CC6-BEB6-D846F631502B}.Release|Win64.ActiveCfg = Release|x64 diff --git a/win/sassc.vcxproj b/win/sassc.vcxproj index ea3032e..9be0abe 100644 --- a/win/sassc.vcxproj +++ b/win/sassc.vcxproj @@ -41,6 +41,14 @@ Debug x64 + + Debug without static runtime + Win32 + + + Debug without static runtime + x64 + Release Win32 @@ -49,6 +57,14 @@ Release x64 + + Release without static runtime + Win32 + + + Release without static runtime + x64 + @@ -69,34 +85,21 @@ v140 - - true - - - false - true - - - - - - - - - - - + - + true + true - + false + false + true @@ -106,58 +109,30 @@ $(IntDir)/%(RelativeDir)/ - + - - Level3 + Disabled - WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) + WIN64;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) + MultiThreadedDebug Console true - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) - - - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) - - - Console - true - true - true - - - + Level3 - - + MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) + WIN32;_CONSOLE;_LIB;%(PreprocessorDefinitions) + WIN64;_CONSOLE;_LIB;%(PreprocessorDefinitions) + MultiThreadedDebug Console @@ -177,4 +152,4 @@ - \ No newline at end of file + From 5ad492f76dad77ad60dca1dee6a34c0706e440c0 Mon Sep 17 00:00:00 2001 From: Adeel Date: Sun, 11 Dec 2016 18:10:10 +0200 Subject: [PATCH 2/2] Update win docs with static runtime instructions Also added docs and other repo files in `.SolutionItems` (to make them visible in VS' Solution Explorer) --- docs/building/unix-instructions.md | 2 +- docs/building/windows-instructions.md | 24 ++++++++++----------- win/sassc.sln | 31 +++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 13 deletions(-) diff --git a/docs/building/unix-instructions.md b/docs/building/unix-instructions.md index c7929c2..a3d9066 100644 --- a/docs/building/unix-instructions.md +++ b/docs/building/unix-instructions.md @@ -24,7 +24,7 @@ The executable will be in the bin folder. To run it, simply try something like ```bash script/bootstrap ``` -Alternately, if you already have libsass cloned or installed, you can edit your .bash_profile to include libsass directory: +Alternately, if you already have libsass cloned or installed, you can edit your `.bash_profile` to include libsass directory: ```bash export SASS_LIBSASS_PATH=/Users/you/path/libsass ``` diff --git a/docs/building/windows-instructions.md b/docs/building/windows-instructions.md index d7d3c87..b906364 100644 --- a/docs/building/windows-instructions.md +++ b/docs/building/windows-instructions.md @@ -7,6 +7,8 @@ To build SassC, the following pre-requisites must be met: Additionally, it is recommended to have `git` installed and available in `PATH`, so to deduce the `libsass` and `sassc` version information. For instance, if GitHub for Windows (https://windows.github.com/) is installed, the `PATH` will have an entry resembling: `X:\Users\\AppData\Local\GitHub\PortableGit_\cmd\` (where `X` is the drive letter of system drive). If `git` is not available, inquiring the LibSass and SassC versions will result in `[NA]`. +> Note that with `Debug` or `Release` we statically compile VC runtime libraries (e.g. `MSVCP140.dll`) in sassc.exe which result in self-dependent / portable binary that is comparatively large in size. There are separate build configurations for shared runtime: `Debug without static runtime` and `Release without static runtime`, which produce the binary dependent on [VS2015 Redistributable package](https://www.microsoft.com/en-gb/download/details.aspx?id=48145) on the target system. If your target system (where you want to execute sassc.exe) already has VCR (via redistributable pack or Visual Studio itself), it is highly recommended to use this shared configuration. This way when the shared runtime libs receive an updated (performance improvements or bug fixes), the statically compiled image will not be able to take advantage of such updates. + ## Obtaining the Sources: If `git` in available in `PATH`, open `cmd` or `PowerShell` and run: @@ -40,17 +42,17 @@ Notice that in the following commands: * If the platform is 32-bit Windows, replace `ProgramFiles(x86)` with `ProgramFiles`. * To build with Visual Studio 2015, replace `12.0` with `14.0` in the aforementioned command. +* To build 32-bit binary, add `/p:Platform=Win32`. +* To build 64-bit binary, add `/p:platform=Win64`. -In `cmd`, run: +For example, in `cmd`, run: ```cmd cd projects\libsass\sassc -:: debug build: -"%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild" win\sassc.sln - -:: or release build: -"%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild" win\sassc.sln /p:Configuration=Release +:: 32-bit debug build with statically compiled runtime libs: +"%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild" win\sassc.sln ^ +/p:Configuration=Debug /p:Platform=Win32 ``` In `PowerShell`, the above variant would be: @@ -58,14 +60,12 @@ In `PowerShell`, the above variant would be: ```powershell cd projects\libsass\sassc -# debug build: -&"${env:ProgramFiles(x86)}\MSBuild\12.0\Bin\MSBuild" win\sassc.sln - -# or release build: -&"${env:ProgramFiles(x86)}\MSBuild\12.0\Bin\MSBuild" win\sassc.sln /p:Configuration=Release +# 64-bit release build without statically compiled runtime libs: +&"${env:ProgramFiles(x86)}\MSBuild\12.0\Bin\MSBuild" win\sassc.sln ` +/p:Configuration='Release without static runtime' /p:Platform=Win64 ``` -You can also override the `LIBSASS_DIR` path by agumenting msbuild properties, such as: `/p:LIBSASS_DIR=../../some/path/leading/to/libsass;Configuration=Release`. +You can also override the `LIBSASS_DIR` path by augmenting msbuild properties, such as: `/p:LIBSASS_DIR=../../some/path/leading/to/libsass;Configuration=Release`. The executable will be in the bin folder under sassc (`sassc\bin\sassc.exe`). To run it, simply try something like diff --git a/win/sassc.sln b/win/sassc.sln index c6bd361..e726b2d 100644 --- a/win/sassc.sln +++ b/win/sassc.sln @@ -5,6 +5,32 @@ VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sassc", "sassc.vcxproj", "{E4030474-AFC9-4CC6-BEB6-D846F631502B}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".SolutionItems", ".SolutionItems", "{66CDE359-E53F-46E9-9B1E-EC30B50D30AF}" + ProjectSection(SolutionItems) = preProject + ..\.editorconfig = ..\.editorconfig + ..\.gitignore = ..\.gitignore + ..\.travis.yml = ..\.travis.yml + ..\appveyor.yml = ..\appveyor.yml + ..\LICENSE = ..\LICENSE + ..\Readme.md = ..\Readme.md + ..\sassc_version.h.in = ..\sassc_version.h.in + ..\version.sh = ..\version.sh + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{5CDEB969-5B7C-4653-BD2D-51D0222BD53D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "building", "building", "{1B7DFCCC-9806-43B5-8739-5E2D9C55CE42}" + ProjectSection(SolutionItems) = preProject + ..\docs\building\unix-instructions.md = ..\docs\building\unix-instructions.md + ..\docs\building\windows-instructions.md = ..\docs\building\windows-instructions.md + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "testing", "testing", "{4F8D4A73-7FE3-4602-8B46-68FEC98BD69E}" + ProjectSection(SolutionItems) = preProject + ..\docs\testing\unix-instructions.md = ..\docs\testing\unix-instructions.md + ..\docs\testing\windows-instructions.md = ..\docs\testing\windows-instructions.md + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug without static runtime|Win32 = Debug without static runtime|Win32 @@ -37,4 +63,9 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {5CDEB969-5B7C-4653-BD2D-51D0222BD53D} = {66CDE359-E53F-46E9-9B1E-EC30B50D30AF} + {1B7DFCCC-9806-43B5-8739-5E2D9C55CE42} = {5CDEB969-5B7C-4653-BD2D-51D0222BD53D} + {4F8D4A73-7FE3-4602-8B46-68FEC98BD69E} = {5CDEB969-5B7C-4653-BD2D-51D0222BD53D} + EndGlobalSection EndGlobal