History

Add pre-build step in VS2015 projects to generate config.h from VERSION

Vlad Vissoultchev committed 9 years ago

Commit 910a6bc1 parent 5efa75d3 files · +61 −0Browse files

Unified · Split

3 files
  1. win32/vs2015/PreBuild.bat +9 −0
  2. win32/vs2015/libtcc.vcxproj +30 −0
  3. win32/vs2015/tcc.vcxproj +22 −0
win32/vs2015/PreBuild.bat+9−0
@@ -0,0 +1,9 @@
1+set /p VERSION= < %~dp0..\..\VERSION
2+
3+:config.h
4+echo> .\config.h #define TCC_VERSION "%VERSION%"
5+echo>> .\config.h #ifdef TCC_TARGET_X86_64
6+echo>> .\config.h #define CONFIG_TCC_LIBPATHS "{B}/lib/64;{B}/lib"
7+echo>> .\config.h #else
8+echo>> .\config.h #define CONFIG_TCC_LIBPATHS "{B}/lib/32;{B}/lib"
9+echo>> .\config.h #endif
win32/vs2015/libtcc.vcxproj+30−0
@@ -71,15 +71,19 @@ · 70 unmodified lines
7171 <PropertyGroup Label="UserMacros" />
7272 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
7373 <LinkIncremental>true</LinkIncremental>
74+ <IncludePath>$(ProjectDir);$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
7475 </PropertyGroup>
7576 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
7677 <LinkIncremental>true</LinkIncremental>
78+ <IncludePath>$(ProjectDir);$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
7779 </PropertyGroup>
7880 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
7981 <LinkIncremental>false</LinkIncremental>
82+ <IncludePath>$(ProjectDir);$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
8083 </PropertyGroup>
8184 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
8285 <LinkIncremental>false</LinkIncremental>
86+ <IncludePath>$(ProjectDir);$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
8387 </PropertyGroup>
8488 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
8589 <ClCompile>
@@ -88,6 +92,7 @@ · 2 unmodified lines
8892 <WarningLevel>Level3</WarningLevel>
8993 <Optimization>Disabled</Optimization>
9094 <PreprocessorDefinitions>ONE_SOURCE;LIBTCC_AS_DLL;TCC_TARGET_PE;TCC_TARGET_I386;WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBTCC_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
95+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
9196 </ClCompile>
9297 <Link>
9398 <SubSystem>Windows</SubSystem>
@@ -96,6 +101,12 @@ · 2 unmodified lines
96101 <PostBuildEvent>
97102 <Command>copy $(TargetPath) $(SolutionDir)..</Command>
98103 </PostBuildEvent>
104+ <PreBuildEvent>
105+ <Command>$(ProjectDir)PreBuild.bat</Command>
106+ </PreBuildEvent>
107+ <PreBuildEvent>
108+ <Message>Generate config.h</Message>
109+ </PreBuildEvent>
99110 </ItemDefinitionGroup>
100111 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
101112 <ClCompile>
@@ -104,6 +115,7 @@ · 2 unmodified lines
104115 <WarningLevel>Level3</WarningLevel>
105116 <Optimization>Disabled</Optimization>
106117 <PreprocessorDefinitions>ONE_SOURCE;LIBTCC_AS_DLL;TCC_TARGET_PE;TCC_TARGET_X86_64;_DEBUG;_WINDOWS;_USRDLL;LIBTCC_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
118+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
107119 </ClCompile>
108120 <Link>
109121 <SubSystem>Windows</SubSystem>
@@ -112,6 +124,12 @@ · 2 unmodified lines
112124 <PostBuildEvent>
113125 <Command>copy $(TargetPath) $(SolutionDir)..</Command>
114126 </PostBuildEvent>
127+ <PreBuildEvent>
128+ <Command>$(ProjectDir)PreBuild.bat</Command>
129+ </PreBuildEvent>
130+ <PreBuildEvent>
131+ <Message>Generate config.h</Message>
132+ </PreBuildEvent>
115133 </ItemDefinitionGroup>
116134 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
117135 <ClCompile>
@@ -132,6 +150,12 @@ · 14 unmodified lines
132150 <PostBuildEvent>
133151 <Command>copy $(TargetPath) $(SolutionDir)..</Command>
134152 </PostBuildEvent>
153+ <PreBuildEvent>
154+ <Command>$(ProjectDir)PreBuild.bat</Command>
155+ </PreBuildEvent>
156+ <PreBuildEvent>
157+ <Message>Generate config.h</Message>
158+ </PreBuildEvent>
135159 </ItemDefinitionGroup>
136160 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
137161 <ClCompile>
@@ -152,6 +176,12 @@ · 14 unmodified lines
152176 <PostBuildEvent>
153177 <Command>copy $(TargetPath) $(SolutionDir)..</Command>
154178 </PostBuildEvent>
179+ <PreBuildEvent>
180+ <Command>$(ProjectDir)PreBuild.bat</Command>
181+ </PreBuildEvent>
182+ <PreBuildEvent>
183+ <Message>Generate config.h</Message>
184+ </PreBuildEvent>
155185 </ItemDefinitionGroup>
156186 <ItemGroup>
157187 <ClCompile Include="..\..\libtcc.c" />
win32/vs2015/tcc.vcxproj+22−0
@@ -71,15 +71,19 @@ · 70 unmodified lines
7171 <PropertyGroup Label="UserMacros" />
7272 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
7373 <LinkIncremental>true</LinkIncremental>
74+ <IncludePath>$(ProjectDir);$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
7475 </PropertyGroup>
7576 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
7677 <LinkIncremental>true</LinkIncremental>
78+ <IncludePath>$(ProjectDir);$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
7779 </PropertyGroup>
7880 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
7981 <LinkIncremental>false</LinkIncremental>
82+ <IncludePath>$(ProjectDir);$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
8083 </PropertyGroup>
8184 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
8285 <LinkIncremental>false</LinkIncremental>
86+ <IncludePath>$(ProjectDir);$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
8387 </PropertyGroup>
8488 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
8589 <ClCompile>
@@ -88,6 +92,7 @@ · 2 unmodified lines
8892 <WarningLevel>Level3</WarningLevel>
8993 <Optimization>Disabled</Optimization>
9094 <PreprocessorDefinitions>TCC_TARGET_PE;TCC_TARGET_I386;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
95+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
9196 </ClCompile>
9297 <Link>
9398 <SubSystem>Console</SubSystem>
@@ -98,6 +103,10 @@ · 4 unmodified lines
98103 <PostBuildEvent>
99104 <Command>copy $(TargetPath) $(SolutionDir)..</Command>
100105 </PostBuildEvent>
106+ <PreBuildEvent>
107+ <Command>$(ProjectDir)PreBuild.bat</Command>
108+ <Message>Generate config.h</Message>
109+ </PreBuildEvent>
101110 </ItemDefinitionGroup>
102111 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
103112 <ClCompile>
@@ -106,6 +115,7 @@ · 2 unmodified lines
106115 <WarningLevel>Level3</WarningLevel>
107116 <Optimization>Disabled</Optimization>
108117 <PreprocessorDefinitions>TCC_TARGET_PE;TCC_TARGET_X86_64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
118+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
109119 </ClCompile>
110120 <Link>
111121 <SubSystem>Console</SubSystem>
@@ -116,6 +126,10 @@ · 4 unmodified lines
116126 <PostBuildEvent>
117127 <Command>copy $(TargetPath) $(SolutionDir)..</Command>
118128 </PostBuildEvent>
129+ <PreBuildEvent>
130+ <Command>$(ProjectDir)PreBuild.bat</Command>
131+ <Message>Generate config.h</Message>
132+ </PreBuildEvent>
119133 </ItemDefinitionGroup>
120134 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
121135 <ClCompile>
@@ -138,6 +152,10 @@ · 16 unmodified lines
138152 <PostBuildEvent>
139153 <Command>copy $(TargetPath) $(SolutionDir)..</Command>
140154 </PostBuildEvent>
155+ <PreBuildEvent>
156+ <Command>$(ProjectDir)PreBuild.bat</Command>
157+ <Message>Generate config.h</Message>
158+ </PreBuildEvent>
141159 </ItemDefinitionGroup>
142160 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
143161 <ClCompile>
@@ -160,6 +178,10 @@ · 16 unmodified lines
160178 <PostBuildEvent>
161179 <Command>copy $(TargetPath) $(SolutionDir)..</Command>
162180 </PostBuildEvent>
181+ <PreBuildEvent>
182+ <Command>$(ProjectDir)PreBuild.bat</Command>
183+ <Message>Generate config.h</Message>
184+ </PreBuildEvent>
163185 </ItemDefinitionGroup>
164186 <ItemGroup>
165187 <ClCompile Include="..\..\tcc.c" />

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t