- Home /
How to put comments in the smcs.rsp file for Unity?
As mentioned at this link under the Global Custom Defines section, I'm trying to use a .rsp file to set up some compiler settings for my Unity project. I can't seem to find how to add a comment to the file to help me when referring to the file later, so I know what each command is.
According to Microsoft, to comment in a .rsp file you must put a # before the comment, but this doesn't work in Unity. Does anyone know how to add a comment in this file?
Works in visual studio so it seems like unity doesn't support comments in smcs.rsp. Did you find a solution?
I'm doing this right now:
-define:commentDefinesWithCommentAreCommentedOutBecauseUnityDoesntSupportCommentsInSmcsRsp
-define:CLIENT
-define:commentSERVER
-define:DEBUG
-define:commentRELEASE
It feels so dirty. Unity devs, please add comment support in smcs.rsp.
Answer by Bystander333 · May 09, 2019 at 04:42 PM
Bit of an old question, but needed to do it myself and found the answer. # works but don't add white space after it and enclose the line in quotes
e.g.
#"https://issuetracker.unity3d.com/issues/serializedfield-fields-produce-field-is-never-assigned-to-dot-dot-dot-warning"
-nowarn:0649
Answer by goodmanyouknow · Oct 09, 2016 at 09:27 AM
hi, my friend, it seems not be suppored putting comments in rsp file, the simple solution is add a "_" in the end of you macro, like this: -define:UNITY_EDITOR_
Answer by menshikh · Nov 11, 2019 at 10:01 PM
This worked for me (Unity 2019.2):
#_This_file_contains_command_line_options_for_C#_compiler
#_Suppress_warning_CS0649:_Field_'xxx'_is_never_assigned_to,_and_will_always_have_its_default_value
#_Roslyn_compiler_team_have_implemented_DiagnosticSuppressor_API.
#_Wait_until_Unity_team_utilizes_it,_then_remove_this_compiler_option.
#_https://forum.unity.com/threads/feature-request-use-new-diagnosticsuppressor-api-to-suppress-cs0649-on-serializefield.697514
/nowarn:0649
P.S. Leading spaces were added by web formatting and unimportant.
Answer by taimur_azhar · Jan 24, 2018 at 12:14 PM
Hi is there any link about how to make and use smcs.rsp file ??