Skip to content

Commit 91777f1

Browse files
committed
win: Uses VS2015 for CI builds.
Also guards *snprintf declarations with better conditional statement.
1 parent cde6ace commit 91777f1

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

src/json.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include <stdlib.h>
3535
#include <string.h>
3636

37-
#ifdef _MSC_VER
37+
#if defined(_MSC_VER) && _MSC_VER < 1900
3838

3939
#include <stdarg.h>
4040
#define snprintf c99_snprintf

win/libsass.vcxproj

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,35 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="12.0" DefaultTargets="GitVersion;Main"
3-
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
4-
2+
<Project ToolsVersion="14.0" DefaultTargets="GitVersion;Main" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
53
<PropertyGroup>
64
<SASSC_VERSION>[NA]</SASSC_VERSION>
75
<LIBSASS_VERSION>[NA]</LIBSASS_VERSION>
86
</PropertyGroup>
9-
107
<Target Name="GitVersion">
11-
12-
<Exec Command="git -C .. describe --abbrev=4 --dirty --always --tags > libsass-version" />
13-
<Exec Command="git -C ../sassc describe --abbrev=4 --dirty --always --tags > sassc-version" />
14-
8+
<Exec Command="git -C .. describe --abbrev=4 --dirty --always --tags &gt; libsass-version" />
9+
<Exec Command="git -C ../sassc describe --abbrev=4 --dirty --always --tags &gt; sassc-version" />
1510
<ReadLinesFromFile File="sassc-version">
1611
<Output TaskParameter="Lines" PropertyName="SASSC_VERSION" />
1712
</ReadLinesFromFile>
1813
<ReadLinesFromFile File="libsass-version">
1914
<Output TaskParameter="Lines" PropertyName="LIBSASS_VERSION" />
2015
</ReadLinesFromFile>
2116
</Target>
22-
2317
<Target Name="VersionMacros">
2418
<ItemGroup>
25-
<ClCompile><PreprocessorDefinitions>%(PreprocessorDefinitions);SASSC_VERSION="$(SASSC_VERSION)"</PreprocessorDefinitions></ClCompile>
26-
<ClCompile><PreprocessorDefinitions>%(PreprocessorDefinitions);LIBSASS_VERSION="$(LIBSASS_VERSION)"</PreprocessorDefinitions></ClCompile>
19+
<ClCompile>
20+
<PreprocessorDefinitions>%(PreprocessorDefinitions);SASSC_VERSION="$(SASSC_VERSION)"</PreprocessorDefinitions>
21+
</ClCompile>
22+
<ClCompile>
23+
<PreprocessorDefinitions>%(PreprocessorDefinitions);LIBSASS_VERSION="$(LIBSASS_VERSION)"</PreprocessorDefinitions>
24+
</ClCompile>
2725
</ItemGroup>
2826
</Target>
29-
3027
<Target Name="Main">
3128
<Message Text="sassc: $(SASSC_VERSION)" />
3229
<Message Text="libsass: $(LIBSASS_VERSION)" />
3330
<CallTarget Targets="VersionMacros" />
3431
<CallTarget Targets="Build" />
3532
</Target>
36-
3733
<ItemGroup Label="ProjectConfigurations">
3834
<ProjectConfiguration Include="Debug|Win32">
3935
<Configuration>Debug</Configuration>
@@ -58,29 +54,31 @@
5854
<RootNamespace>libsass</RootNamespace>
5955
</PropertyGroup>
6056
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
57+
<PropertyGroup Condition="'$(VisualStudioVersion)' == '12.0'">
58+
<PlatformToolset>v120</PlatformToolset>
59+
</PropertyGroup>
60+
<PropertyGroup Condition="'$(VisualStudioVersion)' == '14.0'">
61+
<PlatformToolset>v140</PlatformToolset>
62+
</PropertyGroup>
6163
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
6264
<ConfigurationType>Application</ConfigurationType>
6365
<UseDebugLibraries>true</UseDebugLibraries>
64-
<PlatformToolset>v120</PlatformToolset>
6566
<CharacterSet>Unicode</CharacterSet>
6667
</PropertyGroup>
6768
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
6869
<ConfigurationType>Application</ConfigurationType>
6970
<UseDebugLibraries>true</UseDebugLibraries>
70-
<PlatformToolset>v120</PlatformToolset>
7171
<CharacterSet>Unicode</CharacterSet>
7272
</PropertyGroup>
7373
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
7474
<ConfigurationType>Application</ConfigurationType>
7575
<UseDebugLibraries>false</UseDebugLibraries>
76-
<PlatformToolset>v120</PlatformToolset>
7776
<WholeProgramOptimization>true</WholeProgramOptimization>
7877
<CharacterSet>Unicode</CharacterSet>
7978
</PropertyGroup>
8079
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
8180
<ConfigurationType>Application</ConfigurationType>
8281
<UseDebugLibraries>false</UseDebugLibraries>
83-
<PlatformToolset>v120</PlatformToolset>
8482
<WholeProgramOptimization>true</WholeProgramOptimization>
8583
<CharacterSet>Unicode</CharacterSet>
8684
</PropertyGroup>

0 commit comments

Comments
 (0)