summaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authorAndreia Gaita <shana@spoiledcat.net>2023-11-14 13:39:44 +0100
committerAndreia Gaita <shana@spoiledcat.net>2024-01-31 16:42:42 +0100
commit7638a6c9811590a384e2126dd004e302f76d3e4a (patch)
tree5c0810dc75afcdc45187a115b92366e1347192db /misc
parent9adb7c7d130c6d4eb0e80b92d6eebd71fac3384d (diff)
downloadredot-engine-7638a6c9811590a384e2126dd004e302f76d3e4a.tar.gz
Add new VS proj generation logic that supports any platform that wants to opt in
Custom Visual Studio project generation logic that supports any platform that has a msvs.py script, so Visual Studio can be used to run scons for any platform, with the right defines per target. Invoked with `scons vsproj=yes` To generate build configuration files for all platforms+targets+arch combinations, users should call ``` scons vsproj=yes platform=XXX target=YYY [other build flags] ``` for each combination of platform+target[+arch]. This will generate the relevant vs project files but skip the build process, so that project files can be quickly generated without waiting for a command line build. This lets project files be quickly generated even if there are build errors. All possible combinations of platform+target are created in the solution file by default, but they won't do anything until each one is set up with a scons vsproj=yes command for the respective platform in the appropriate command line. This lets users only generate the combinations they need, and VS won't have to parse settings for other combos. Only platforms that opt in to vs proj generation by having a msvs.py file in the platform folder are included. Platforms with a msvs.py file will be added to the solution, but only the current active platform+target+arch will have a build configuration generated, because we only know what the right defines/includes/flags/etc are on the active build target currently being processed by scons. Platforms that don't support an editor target will have a dummy editor target that won't do anything on build, but will have the files and configuration for the windows editor target. To generate AND build from the command line, run ``` scons vsproj=yes vsproj_gen_only=no ```
Diffstat (limited to 'misc')
-rw-r--r--misc/msvs/props.template21
-rw-r--r--misc/msvs/sln.template20
-rw-r--r--misc/msvs/vcxproj.filters.template30
-rw-r--r--misc/msvs/vcxproj.template42
4 files changed, 113 insertions, 0 deletions
diff --git a/misc/msvs/props.template b/misc/msvs/props.template
new file mode 100644
index 0000000000..9ecd49a25e
--- /dev/null
+++ b/misc/msvs/props.template
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='%%VSCONF%%'">
+ <NMakeBuildCommandLine>%%BUILD%%</NMakeBuildCommandLine>
+ <NMakeReBuildCommandLine>%%REBUILD%%</NMakeReBuildCommandLine>
+ <NMakeCleanCommandLine>%%CLEAN%%</NMakeCleanCommandLine>
+ <NMakeOutput>%%OUTPUT%%</NMakeOutput>
+ <NMakePreprocessorDefinitions>%%DEFINES%%</NMakePreprocessorDefinitions>
+ <NMakeIncludeSearchPath>%%INCLUDES%%</NMakeIncludeSearchPath>
+ <NMakeForcedIncludes>$(NMakeForcedIncludes)</NMakeForcedIncludes>
+ <NMakeAssemblySearchPath>$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>
+ <NMakeForcedUsingAssemblies>$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
+ <AdditionalOptions>%%OPTIONS%%</AdditionalOptions>
+ </PropertyGroup>
+ <PropertyGroup Condition="%%CONDITION%%">
+ %%PROPERTIES%%
+ </PropertyGroup>
+ <ItemGroup Condition="%%CONDITION%%">
+ %%EXTRA_ITEMS%%
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/misc/msvs/sln.template b/misc/msvs/sln.template
new file mode 100644
index 0000000000..7d05548c6e
--- /dev/null
+++ b/misc/msvs/sln.template
@@ -0,0 +1,20 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.7.34221.43
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "%%NAME%%", "%%NAME%%.vcxproj", "{%%UUID%%}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ %%SECTION1%%
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ %%SECTION2%%
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {%%SLNUUID%%}
+ EndGlobalSection
+EndGlobal
diff --git a/misc/msvs/vcxproj.filters.template b/misc/msvs/vcxproj.filters.template
new file mode 100644
index 0000000000..d57eeee811
--- /dev/null
+++ b/misc/msvs/vcxproj.filters.template
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>%%UUID1%%</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>%%UUID2%%</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>%%UUID3%%</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Scripts">
+ <UniqueIdentifier>%%UUID4%%</UniqueIdentifier>
+ </Filter>
+ %%FILTERS%%
+ </ItemGroup>
+ <ItemGroup>
+ %%COMPILES%%
+ </ItemGroup>
+ <ItemGroup>
+ %%INCLUDES%%
+ </ItemGroup>
+ <ItemGroup>
+ %%OTHERS%%
+ </ItemGroup>
+</Project>
+<!-- CHECKSUM
+%%HASH%%
+--> \ No newline at end of file
diff --git a/misc/msvs/vcxproj.template b/misc/msvs/vcxproj.template
new file mode 100644
index 0000000000..a1cf22bfb9
--- /dev/null
+++ b/misc/msvs/vcxproj.template
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ %%CONFS%%
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{%%UUID%%}</ProjectGuid>
+ <RootNamespace>godot</RootNamespace>
+ <Keyword>MakeFileProj</Keyword>
+ <VCProjectUpgraderObjectName>NoUpgrade</VCProjectUpgraderObjectName>
+ </PropertyGroup>
+ <PropertyGroup>
+ %%PROPERTIES%%
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Label="Configuration">
+ <ConfigurationType>Makefile</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <PlatformToolset>v143</PlatformToolset>
+ <OutDir>$(SolutionDir)\bin\$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>obj\$(Platform)\$(Configuration)\</IntDir>
+ <LayoutDir>$(OutDir)\Layout</LayoutDir>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <ActiveProjectItemList></ActiveProjectItemList>
+ </PropertyGroup>
+ %%IMPORTS%%
+ <ItemGroup Condition="'$(IncludeListImported)'==''">
+ %%DEFAULT_ITEMS%%
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file