Add option to remove CLSCompliance attribute
diff --git a/src/ProtoGen/FieldGeneratorBase.cs b/src/ProtoGen/FieldGeneratorBase.cs
index a4ffb73..1c273b1 100644
--- a/src/ProtoGen/FieldGeneratorBase.cs
+++ b/src/ProtoGen/FieldGeneratorBase.cs
@@ -132,7 +132,7 @@
}
protected void AddClsComplianceCheck(TextGenerator writer) {
- if (!Descriptor.IsCLSCompliant) {
+ if (!Descriptor.IsCLSCompliant && Descriptor.File.CSharpOptions.ClsCompliance) {
writer.WriteLine("[global::System.CLSCompliant(false)]");
}
}