From 9b453cfc518bdaa7e2ff590526c4883457fd6065 Mon Sep 17 00:00:00 2001 From: Jon Wiswall Date: Thu, 17 Aug 2023 15:51:08 -0700 Subject: [PATCH] Enable faster dev cycle in Visual Studio (#1340) * Enable faster dev cycle in Visual Studio * Oops, remove one more run * Fix linux build temporarily - see also #1341 --------- Co-authored-by: Jon Wiswall --- .github/workflows/ci.yml | 4 +- README.md | 10 +- build_test_all.cmd | 1 - cppwinrt.sln | 12 ++- test/test_component/test_component.vcxproj | 107 ++------------------- 5 files changed, 28 insertions(+), 106 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f96dfad4..aa568e50 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -483,7 +483,7 @@ jobs: - name: Test run (build projection using Windows.winmd) run: | - curl -o Windows.winmd -L https://github.com/microsoft/windows-rs/raw/master/crates/libs/metadata/default/Windows.winmd + curl -o Windows.winmd -L https://github.com/microsoft/windows-rs/raw/master/crates/libs/bindgen/default/Windows.winmd install/bin/cppwinrt -in Windows.winmd -out /tmp/cppwinrt -verbose - id: setup-llvm @@ -575,7 +575,7 @@ jobs: - name: Test run (build projection using Windows.winmd) run: | - curl -o Windows.winmd -L https://github.com/microsoft/windows-rs/raw/master/crates/libs/metadata/default/Windows.winmd + curl -o Windows.winmd -L https://github.com/microsoft/windows-rs/raw/master/crates/libs/bindgen/default/Windows.winmd install/bin/cppwinrt -in Windows.winmd -out build/out -verbose build-msvc-natvis: diff --git a/README.md b/README.md index 7e69fd97..691809d3 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,13 @@ If you really want to build it yourself, the simplest way to do so is to run the * Open a dev command prompt pointing at the root of the repo. * Open the `cppwinrt.sln` solution. -* Rebuild the x64 Release configuration of the `cppwinrt` project only. Do not attempt to build anything else just yet. -* Run `build_projection.cmd` in the dev command prompt. -* Switch to the x64 Debug configuration in Visual Studio and build all projects as needed. +* Choose a configuration (x64, x86, Release, Debug) and build projects as needed. + +If you are working on an ARM64 or ARM specific issue from an x64 or x86 host, you will need to instead: + +* Open the `cppwinrt.sln` solution +* Build the x86 version of the "cppwinrt" project first +* Switch to your preferred configuration and build the test binaries and run them in your test environment ## Comparing Outputs diff --git a/build_test_all.cmd b/build_test_all.cmd index 681f8c68..18585bab 100644 --- a/build_test_all.cmd +++ b/build_test_all.cmd @@ -26,7 +26,6 @@ call msbuild /p:Configuration=%target_configuration%,Platform=%target_platform%, if "%target_platform%"=="arm64" goto :eof call msbuild /m /p:Configuration=%target_configuration%,Platform=%target_platform%,CppWinRTBuildVersion=%target_version% cppwinrt.sln /t:cppwinrt -_build\%target_platform%\%target_configuration%\cppwinrt.exe -in local -out _build\%target_platform%\%target_configuration% -verbose call msbuild /p:Configuration=%target_configuration%,Platform=%target_platform%,CppWinRTBuildVersion=%target_version% test\nuget\NugetTest.sln diff --git a/cppwinrt.sln b/cppwinrt.sln index 8b162344..e08c2d1c 100644 --- a/cppwinrt.sln +++ b/cppwinrt.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.28606.126 +# Visual Studio Version 17 +VisualStudioVersion = 17.6.33829.357 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cppwinrt", "cppwinrt\cppwinrt.vcxproj", "{D613FB39-5035-4043-91E2-BAB323908AF4}" ProjectSection(ProjectDependencies) = postProject @@ -24,6 +24,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Component", "test\old_tests EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Composable", "test\old_tests\Composable\Composable.vcxproj", "{152E4C6E-9A9D-4D5A-B38D-4905D173649A}" ProjectSection(ProjectDependencies) = postProject + {A91B8BF3-28E4-4D9E-8DBA-64B70E4F0270} = {A91B8BF3-28E4-4D9E-8DBA-64B70E4F0270} {D613FB39-5035-4043-91E2-BAB323908AF4} = {D613FB39-5035-4043-91E2-BAB323908AF4} EndProjectSection EndProject @@ -41,16 +42,19 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test", "test\test\test.vcxp EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_component_folders", "test\test_component_folders\test_component_folders.vcxproj", "{85695954-3800-4558-9857-966E69E9F9EC}" ProjectSection(ProjectDependencies) = postProject + {A91B8BF3-28E4-4D9E-8DBA-64B70E4F0270} = {A91B8BF3-28E4-4D9E-8DBA-64B70E4F0270} {D613FB39-5035-4043-91E2-BAB323908AF4} = {D613FB39-5035-4043-91E2-BAB323908AF4} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_component_no_pch", "test\test_component_no_pch\test_component_no_pch.vcxproj", "{F1C915B3-2C64-4992-AFB7-7F035B1A7607}" ProjectSection(ProjectDependencies) = postProject + {A91B8BF3-28E4-4D9E-8DBA-64B70E4F0270} = {A91B8BF3-28E4-4D9E-8DBA-64B70E4F0270} {D613FB39-5035-4043-91E2-BAB323908AF4} = {D613FB39-5035-4043-91E2-BAB323908AF4} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_component_base", "test\test_component_base\test_component_base.vcxproj", "{13333A6F-6A4A-48CD-865C-0F65135EB018}" ProjectSection(ProjectDependencies) = postProject + {A91B8BF3-28E4-4D9E-8DBA-64B70E4F0270} = {A91B8BF3-28E4-4D9E-8DBA-64B70E4F0270} {D613FB39-5035-4043-91E2-BAB323908AF4} = {D613FB39-5035-4043-91E2-BAB323908AF4} EndProjectSection EndProject @@ -61,6 +65,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_component_derived", "t EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_component_fast", "test\test_component_fast\test_component_fast.vcxproj", "{0E0ACA62-A92F-44CF-BD41-AEB541946DF8}" ProjectSection(ProjectDependencies) = postProject + {A91B8BF3-28E4-4D9E-8DBA-64B70E4F0270} = {A91B8BF3-28E4-4D9E-8DBA-64B70E4F0270} {D613FB39-5035-4043-91E2-BAB323908AF4} = {D613FB39-5035-4043-91E2-BAB323908AF4} EndProjectSection EndProject @@ -93,6 +98,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_module_lock_none", "te EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_module_lock_custom", "test\test_module_lock_custom\test_module_lock_custom.vcxproj", "{08C40663-B6A3-481E-8755-AE32BAD99501}" ProjectSection(ProjectDependencies) = postProject + {A91B8BF3-28E4-4D9E-8DBA-64B70E4F0270} = {A91B8BF3-28E4-4D9E-8DBA-64B70E4F0270} {D613FB39-5035-4043-91E2-BAB323908AF4} = {D613FB39-5035-4043-91E2-BAB323908AF4} EndProjectSection EndProject @@ -107,11 +113,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_win7", "test\test_win7 EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_cpp20", "test\test_cpp20\test_cpp20.vcxproj", "{5FF6CD6C-515A-4D55-97B6-62AD9BCB77EA}" ProjectSection(ProjectDependencies) = postProject + {A91B8BF3-28E4-4D9E-8DBA-64B70E4F0270} = {A91B8BF3-28E4-4D9E-8DBA-64B70E4F0270} {D613FB39-5035-4043-91E2-BAB323908AF4} = {D613FB39-5035-4043-91E2-BAB323908AF4} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_cpp20_no_sourcelocation", "test\test_cpp20_no_sourcelocation\test_cpp20_no_sourcelocation.vcxproj", "{D4C8F881-84D5-4A7B-8BDE-AB4E34A05374}" ProjectSection(ProjectDependencies) = postProject + {A91B8BF3-28E4-4D9E-8DBA-64B70E4F0270} = {A91B8BF3-28E4-4D9E-8DBA-64B70E4F0270} {D613FB39-5035-4043-91E2-BAB323908AF4} = {D613FB39-5035-4043-91E2-BAB323908AF4} EndProjectSection EndProject diff --git a/test/test_component/test_component.vcxproj b/test/test_component/test_component.vcxproj index d1f66850..15aa2444 100644 --- a/test/test_component/test_component.vcxproj +++ b/test/test_component/test_component.vcxproj @@ -182,18 +182,6 @@ C:\Windows\System32\WinMetadata true - - $(CppWinRTDir)cppwinrt -input $(OutputPath)test_component.winmd -comp "$(ProjectDir)Generated Files" -out "$(ProjectDir)Generated Files" -include test_component -ref sdk -verbose -prefix -opt -lib test -fastabi -overwrite -name test_component - - - - - - Generated Files\module.g.cpp - - - $(OutputPath)test_component.winmd - @@ -243,19 +231,6 @@ C:\Windows\System32\WinMetadata true - - $(CppWinRTDir)cppwinrt -input $(OutputPath)test_component.winmd -comp "$(ProjectDir)Generated Files" -out "$(ProjectDir)Generated Files" -include test_component -ref sdk -verbose -prefix -opt -lib test -fastabi -overwrite -name test_component - - - - - - - Generated Files\module.g.cpp - - - $(OutputPath)test_component.winmd - @@ -305,19 +280,6 @@ C:\Windows\System32\WinMetadata true - - $(CppWinRTDir)cppwinrt -input $(OutputPath)test_component.winmd -comp "$(ProjectDir)Generated Files" -out "$(ProjectDir)Generated Files" -include test_component -ref sdk -verbose -prefix -opt -lib test -fastabi -overwrite -name test_component - - - - - - - Generated Files\module.g.cpp - - - $(OutputPath)test_component.winmd - @@ -354,18 +316,6 @@ C:\Windows\System32\WinMetadata true - - $(CppWinRTDir)cppwinrt -input $(OutputPath)test_component.winmd -comp "$(ProjectDir)Generated Files" -out "$(ProjectDir)Generated Files" -include test_component -ref sdk -verbose -prefix -opt -lib test -fastabi -overwrite -name test_component - - - - - - Generated Files\module.g.cpp - - - $(OutputPath)test_component.winmd - @@ -406,18 +356,6 @@ C:\Windows\System32\WinMetadata true - - $(CppWinRTDir)cppwinrt -input $(OutputPath)test_component.winmd -comp "$(ProjectDir)Generated Files" -out "$(ProjectDir)Generated Files" -include test_component -ref sdk -verbose -prefix -opt -lib test -fastabi -overwrite -name test_component - - - - - - Generated Files\module.g.cpp - - - $(OutputPath)test_component.winmd - @@ -471,19 +409,6 @@ C:\Windows\System32\WinMetadata true - - $(CppWinRTDir)cppwinrt -input $(OutputPath)test_component.winmd -comp "$(ProjectDir)Generated Files" -out "$(ProjectDir)Generated Files" -include test_component -ref sdk -verbose -prefix -opt -lib test -fastabi -overwrite -name test_component - - - - - - - Generated Files\module.g.cpp - - - $(OutputPath)test_component.winmd - @@ -537,19 +462,6 @@ C:\Windows\System32\WinMetadata true - - $(CppWinRTDir)cppwinrt -input $(OutputPath)test_component.winmd -comp "$(ProjectDir)Generated Files" -out "$(ProjectDir)Generated Files" -include test_component -ref sdk -verbose -prefix -opt -lib test -fastabi -overwrite -name test_component - - - - - - - Generated Files\module.g.cpp - - - $(OutputPath)test_component.winmd - @@ -590,17 +502,16 @@ C:\Windows\System32\WinMetadata true + + - $(CppWinRTDir)cppwinrt -input $(OutputPath)test_component.winmd -comp "$(ProjectDir)Generated Files" -out "$(ProjectDir)Generated Files" -include test_component -ref sdk -verbose -prefix -opt -lib test -fastabi -overwrite -name test_component - - - - - - Generated Files\module.g.cpp - - - $(OutputPath)test_component.winmd + + $(CppWinRTDir)cppwinrt -in local -out $(OutputPath) -verbose + $(CppWinRTDir)cppwinrt -input $(OutputPath)test_component.winmd -comp "$(ProjectDir)Generated Files" -out "$(ProjectDir)Generated Files" -include test_component -ref sdk -verbose -prefix -opt -lib test -fastabi -overwrite -name test_component + + Projecting Windows and component metadata into $(OutputPath) + $(OutputPath)\winrt\base.h;Generated Files\module.g.cpp + $(CppWinRTDir)cppwinrt.exe;$(OutputPath)test_component.winmd