Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions cppwinrt/component_writers.h
Original file line number Diff line number Diff line change
Expand Up @@ -988,9 +988,24 @@ namespace winrt::@::implementation
static void write_generated_static_assert(writer& w)
{
auto format = R"(
// Note: Remove this static_assert after copying these generated source files to your project.
// This assertion exists to avoid compiling these generated source files directly.
static_assert(false, "Do not compile generated C++/WinRT source files directly");
// WARNING: This file is automatically generated by a tool. Do not directly
// add this file to your project, as any changes you make will be lost.
// This file is a stub you can use as a starting point for your implementation.
//
// To add a copy of this file to your project:
// 1. Copy this file from its original location to the location where you store
// your other source files (e.g. the project root).
// 2. Add the copied file to your project. In Visual Studio, you can use
// Project -> Add Existing Item.
// 3. Delete this comment and the 'static_assert' (below) from the copied file.
// Do not modify the original file.
//
// To update an existing file in your project:
// 1. Copy the relevant changes from this file and merge them into the copy
// you made previously.
//
// This assertion helps prevent accidental modification of generated files.
static_assert(false, "This file is generated by a tool and will be overwritten. Open this error and view the comment for assistance.");
)";

w.write(format);
Expand Down Expand Up @@ -1206,4 +1221,4 @@ namespace winrt::@::implementation
slot);
}
}
}
}