We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
UnboundLocalError when using VisualStudioBuildEnvironment
I keep getting the following python error when using `VisualStudioBuildEnvironment` with conan 1.3.1.
```python
env_build = VisualStudioBuildEnvironment(self)
UnboundLocalError: local variable 'flags' referenced before assignment
```
I think I found the problem in [conans/client/build/compiler_flags.py Line 99](https://github.com/conan-io/conan/blob/develop/conans/client/build/compiler_flags.py#L99)

It looks like 
```python
elif not vs_toolset:
```
should just be an `else` or `flags` should be initialized to something in the 
```python 
if str(compiler) == 'Visual Studio':
``` 
block.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `conans/client/build/compiler_flags.py`
Content:
```
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 
4 """
5     # Visual Studio cl options reference:
6     #   https://msdn.microsoft.com/en-us/library/610ecb4h.aspx
7     #       "Options are specified by either a forward slash (/) or a dash (–)."
8     #   Here we use "-" better than "/" that produces invalid escaped chars using AutoTools.
9     #   -LIBPATH, -D, -I, -ZI and so on.
10 
11 """
12 
13 from conans.tools import unix_path
14 
15 
16 def rpath_flags(os_build, compiler, lib_paths):
17     if not os_build:
18         return []
19     if compiler in ("clang", "apple-clang", "gcc"):
20         rpath_separator = "," if os_build in ["Macos", "iOS", "watchOS", "tvOS"] else "="
21         return ['-Wl,-rpath%s"%s"' % (rpath_separator, x.replace("\\", "/"))
22                 for x in lib_paths if x]
23     return []
24 
25 
26 def architecture_flag(compiler, arch):
27     """
28     returns flags specific to the target architecture and compiler
29     """
30     if not compiler or not arch:
31         return ""
32 
33     if str(compiler) in ['gcc', 'apple-clang', 'clang', 'sun-cc']:
34         if str(arch) in ['x86_64', 'sparcv9']:
35             return '-m64'
36         elif str(arch) in ['x86', 'sparc']:
37             return '-m32'
38     return ""
39 
40 
41 def libcxx_define(compiler, libcxx):
42 
43     if not compiler or not libcxx:
44         return ""
45 
46     if str(compiler) in ['gcc', 'clang', 'apple-clang']:
47         if str(libcxx) == 'libstdc++':
48             return '_GLIBCXX_USE_CXX11_ABI=0'
49         elif str(libcxx) == 'libstdc++11':
50             return '_GLIBCXX_USE_CXX11_ABI=1'
51     return ""
52 
53 
54 def libcxx_flag(compiler, libcxx):
55     """
56     returns flag specific to the target C++ standard library
57     """
58     if not compiler or not libcxx:
59         return ""
60     if str(compiler) in ['clang', 'apple-clang']:
61         if str(libcxx) in ['libstdc++', 'libstdc++11']:
62             return '-stdlib=libstdc++'
63         elif str(libcxx) == 'libc++':
64             return '-stdlib=libc++'
65     elif str(compiler) == 'sun-cc':
66         return ({"libCstd": "-library=Cstd",
67                             "libstdcxx": "-library=stdcxx4",
68                             "libstlport": "-library=stlport4",
69                             "libstdc++": "-library=stdcpp"}.get(libcxx, ""))
70     return ""
71 
72 
73 def pic_flag(compiler=None):
74     """
75     returns PIC (position independent code) flags, such as -fPIC
76     """
77     if not compiler or compiler == 'Visual Studio':
78         return ""
79     return '-fPIC'
80 
81 
82 def build_type_flags(compiler, build_type, vs_toolset=None):
83     """
84     returns flags specific to the build type (Debug, Release, etc.)
85     (-s, -g, /Zi, etc.)
86     """
87     if not compiler or not build_type:
88         return ""
89 
90     # https://github.com/Kitware/CMake/blob/d7af8a34b67026feaee558433db3a835d6007e06/
91     # Modules/Platform/Windows-MSVC.cmake
92     if str(compiler) == 'Visual Studio':
93         if vs_toolset and "clang" in str(vs_toolset):
94             flags = {"Debug": ["-gline-tables-only", "-fno-inline", "-O0"],
95                      "Release": ["-O2"],
96                      "RelWithDebInfo": ["-gline-tables-only", "-O2", "-fno-inline"],
97                      "MinSizeRel": []
98                      }.get(build_type, ["-O2", "-Ob2"])
99         elif not vs_toolset:
100             flags = {"Debug": ["-Zi", "-Ob0", "-Od"],
101                      "Release": ["-O2", "-Ob2"],
102                      "RelWithDebInfo": ["-Zi", "-O2", "-Ob1"],
103                      "MinSizeRel": ["-O1", "-Ob1"],
104                      }.get(build_type, [])
105         return flags
106     else:
107         # https://github.com/Kitware/CMake/blob/f3bbb37b253a1f4a26809d6f132b3996aa2e16fc/
108         # Modules/Compiler/GNU.cmake
109         # clang include the gnu (overriding some things, but not build type) and apple clang
110         # overrides clang but it doesn't touch clang either
111         if str(compiler) in ["clang", "gcc", "apple-clang"]:
112             # FIXME: It is not clear that the "-s" is something related with the build type
113             # cmake is not adjusting it
114             # -s: Remove all symbol table and relocation information from the executable.
115             flags = {"Debug": ["-g"],
116                      "Release": ["-O3", "-s"] if str(compiler) == "gcc" else ["-O3"],
117                      "RelWithDebInfo": ["-O2", "-g"],
118                      "MinSizeRel": ["-Os"],
119                      }.get(build_type, [])
120             return flags
121         elif str(compiler) == "sun-cc":
122             # https://github.com/Kitware/CMake/blob/f3bbb37b253a1f4a26809d6f132b3996aa2e16fc/
123             # Modules/Compiler/SunPro-CXX.cmake
124             flags = {"Debug": ["-g"],
125                      "Release": ["-xO3"],
126                      "RelWithDebInfo": ["-xO2", "-g"],
127                      "MinSizeRel": ["-xO2", "-xspace"],
128                      }.get(build_type, [])
129             return flags
130 
131     return ""
132 
133 
134 def build_type_define(build_type=None):
135     """
136     returns definitions specific to the build type (Debug, Release, etc.)
137     like DEBUG, _DEBUG, NDEBUG
138     """
139     return 'NDEBUG' if build_type == 'Release' else ""
140 
141 
142 def adjust_path(path, win_bash=False, subsystem=None, compiler=None):
143     """
144     adjusts path to be safely passed to the compiler command line
145     for Windows bash, ensures path is in format according to the subsystem
146     for path with spaces, places double quotes around it
147     converts slashes to backslashes, or vice versa
148     """
149     if str(compiler) == 'Visual Studio':
150         path = path.replace('/', '\\')
151     else:
152         path = path.replace('\\', '/')
153     if win_bash:
154         path = unix_path(path, subsystem)
155     return '"%s"' % path if ' ' in path else path
156 
157 
158 def sysroot_flag(sysroot, win_bash=False, subsystem=None, compiler=None):
159     if str(compiler) != 'Visual Studio' and sysroot:
160         sysroot = adjust_path(sysroot, win_bash=win_bash, subsystem=subsystem, compiler=compiler)
161         return '--sysroot=%s' % sysroot
162     return ""
163 
164 
165 def visual_runtime(runtime):
166     if runtime:
167         return "-%s" % runtime
168     return ""
169 
170 
171 def format_defines(defines):
172     return ["-D%s" % define for define in defines if define]
173 
174 
175 include_path_option = "-I"
176 visual_linker_option_separator = "-link"  # Further options will apply to the linker
177 
178 
179 def format_include_paths(include_paths, win_bash=False, subsystem=None, compiler=None):
180     return ["%s%s" % (include_path_option, adjust_path(include_path, win_bash=win_bash,
181                                                        subsystem=subsystem, compiler=compiler))
182             for include_path in include_paths if include_path]
183 
184 
185 def format_library_paths(library_paths, win_bash=False, subsystem=None, compiler=None):
186     pattern = "-LIBPATH:%s" if str(compiler) == 'Visual Studio' else "-L%s"
187     return [pattern % adjust_path(library_path, win_bash=win_bash,
188                                   subsystem=subsystem, compiler=compiler)
189             for library_path in library_paths if library_path]
190 
191 
192 def format_libraries(libraries, compiler=None):
193     pattern = "%s.lib" if str(compiler) == 'Visual Studio' else "-l%s"
194     return [pattern % library for library in libraries if library]
195
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/conans/client/build/compiler_flags.py b/conans/client/build/compiler_flags.py
--- a/conans/client/build/compiler_flags.py
+++ b/conans/client/build/compiler_flags.py
@@ -96,7 +96,7 @@
                      "RelWithDebInfo": ["-gline-tables-only", "-O2", "-fno-inline"],
                      "MinSizeRel": []
                      }.get(build_type, ["-O2", "-Ob2"])
-        elif not vs_toolset:
+        else:
             flags = {"Debug": ["-Zi", "-Ob0", "-Od"],
                      "Release": ["-O2", "-Ob2"],
                      "RelWithDebInfo": ["-Zi", "-O2", "-Ob1"],

{"golden_diff": "diff --git a/conans/client/build/compiler_flags.py b/conans/client/build/compiler_flags.py\n--- a/conans/client/build/compiler_flags.py\n+++ b/conans/client/build/compiler_flags.py\n@@ -96,7 +96,7 @@\n                      \"RelWithDebInfo\": [\"-gline-tables-only\", \"-O2\", \"-fno-inline\"],\n                      \"MinSizeRel\": []\n                      }.get(build_type, [\"-O2\", \"-Ob2\"])\n-        elif not vs_toolset:\n+        else:\n             flags = {\"Debug\": [\"-Zi\", \"-Ob0\", \"-Od\"],\n                      \"Release\": [\"-O2\", \"-Ob2\"],\n                      \"RelWithDebInfo\": [\"-Zi\", \"-O2\", \"-Ob1\"],\n", "issue": "UnboundLocalError when using VisualStudioBuildEnvironment\nI keep getting the following python error when using `VisualStudioBuildEnvironment` with conan 1.3.1.\r\n```python\r\nenv_build = VisualStudioBuildEnvironment(self)\r\nUnboundLocalError: local variable 'flags' referenced before assignment\r\n```\r\nI think I found the problem in [conans/client/build/compiler_flags.py Line 99](https://github.com/conan-io/conan/blob/develop/conans/client/build/compiler_flags.py#L99)\r\n\r\nIt looks like \r\n```python\r\nelif not vs_toolset:\r\n```\r\nshould just be an `else` or `flags` should be initialized to something in the \r\n```python \r\nif str(compiler) == 'Visual Studio':\r\n``` \r\nblock.\r\n\n", "before_files": [{"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\n    # Visual Studio cl options reference:\n    #   https://msdn.microsoft.com/en-us/library/610ecb4h.aspx\n    #       \"Options are specified by either a forward slash (/) or a dash (\u2013).\"\n    #   Here we use \"-\" better than \"/\" that produces invalid escaped chars using AutoTools.\n    #   -LIBPATH, -D, -I, -ZI and so on.\n\n\"\"\"\n\nfrom conans.tools import unix_path\n\n\ndef rpath_flags(os_build, compiler, lib_paths):\n    if not os_build:\n        return []\n    if compiler in (\"clang\", \"apple-clang\", \"gcc\"):\n        rpath_separator = \",\" if os_build in [\"Macos\", \"iOS\", \"watchOS\", \"tvOS\"] else \"=\"\n        return ['-Wl,-rpath%s\"%s\"' % (rpath_separator, x.replace(\"\\\\\", \"/\"))\n                for x in lib_paths if x]\n    return []\n\n\ndef architecture_flag(compiler, arch):\n    \"\"\"\n    returns flags specific to the target architecture and compiler\n    \"\"\"\n    if not compiler or not arch:\n        return \"\"\n\n    if str(compiler) in ['gcc', 'apple-clang', 'clang', 'sun-cc']:\n        if str(arch) in ['x86_64', 'sparcv9']:\n            return '-m64'\n        elif str(arch) in ['x86', 'sparc']:\n            return '-m32'\n    return \"\"\n\n\ndef libcxx_define(compiler, libcxx):\n\n    if not compiler or not libcxx:\n        return \"\"\n\n    if str(compiler) in ['gcc', 'clang', 'apple-clang']:\n        if str(libcxx) == 'libstdc++':\n            return '_GLIBCXX_USE_CXX11_ABI=0'\n        elif str(libcxx) == 'libstdc++11':\n            return '_GLIBCXX_USE_CXX11_ABI=1'\n    return \"\"\n\n\ndef libcxx_flag(compiler, libcxx):\n    \"\"\"\n    returns flag specific to the target C++ standard library\n    \"\"\"\n    if not compiler or not libcxx:\n        return \"\"\n    if str(compiler) in ['clang', 'apple-clang']:\n        if str(libcxx) in ['libstdc++', 'libstdc++11']:\n            return '-stdlib=libstdc++'\n        elif str(libcxx) == 'libc++':\n            return '-stdlib=libc++'\n    elif str(compiler) == 'sun-cc':\n        return ({\"libCstd\": \"-library=Cstd\",\n                            \"libstdcxx\": \"-library=stdcxx4\",\n                            \"libstlport\": \"-library=stlport4\",\n                            \"libstdc++\": \"-library=stdcpp\"}.get(libcxx, \"\"))\n    return \"\"\n\n\ndef pic_flag(compiler=None):\n    \"\"\"\n    returns PIC (position independent code) flags, such as -fPIC\n    \"\"\"\n    if not compiler or compiler == 'Visual Studio':\n        return \"\"\n    return '-fPIC'\n\n\ndef build_type_flags(compiler, build_type, vs_toolset=None):\n    \"\"\"\n    returns flags specific to the build type (Debug, Release, etc.)\n    (-s, -g, /Zi, etc.)\n    \"\"\"\n    if not compiler or not build_type:\n        return \"\"\n\n    # https://github.com/Kitware/CMake/blob/d7af8a34b67026feaee558433db3a835d6007e06/\n    # Modules/Platform/Windows-MSVC.cmake\n    if str(compiler) == 'Visual Studio':\n        if vs_toolset and \"clang\" in str(vs_toolset):\n            flags = {\"Debug\": [\"-gline-tables-only\", \"-fno-inline\", \"-O0\"],\n                     \"Release\": [\"-O2\"],\n                     \"RelWithDebInfo\": [\"-gline-tables-only\", \"-O2\", \"-fno-inline\"],\n                     \"MinSizeRel\": []\n                     }.get(build_type, [\"-O2\", \"-Ob2\"])\n        elif not vs_toolset:\n            flags = {\"Debug\": [\"-Zi\", \"-Ob0\", \"-Od\"],\n                     \"Release\": [\"-O2\", \"-Ob2\"],\n                     \"RelWithDebInfo\": [\"-Zi\", \"-O2\", \"-Ob1\"],\n                     \"MinSizeRel\": [\"-O1\", \"-Ob1\"],\n                     }.get(build_type, [])\n        return flags\n    else:\n        # https://github.com/Kitware/CMake/blob/f3bbb37b253a1f4a26809d6f132b3996aa2e16fc/\n        # Modules/Compiler/GNU.cmake\n        # clang include the gnu (overriding some things, but not build type) and apple clang\n        # overrides clang but it doesn't touch clang either\n        if str(compiler) in [\"clang\", \"gcc\", \"apple-clang\"]:\n            # FIXME: It is not clear that the \"-s\" is something related with the build type\n            # cmake is not adjusting it\n            # -s: Remove all symbol table and relocation information from the executable.\n            flags = {\"Debug\": [\"-g\"],\n                     \"Release\": [\"-O3\", \"-s\"] if str(compiler) == \"gcc\" else [\"-O3\"],\n                     \"RelWithDebInfo\": [\"-O2\", \"-g\"],\n                     \"MinSizeRel\": [\"-Os\"],\n                     }.get(build_type, [])\n            return flags\n        elif str(compiler) == \"sun-cc\":\n            # https://github.com/Kitware/CMake/blob/f3bbb37b253a1f4a26809d6f132b3996aa2e16fc/\n            # Modules/Compiler/SunPro-CXX.cmake\n            flags = {\"Debug\": [\"-g\"],\n                     \"Release\": [\"-xO3\"],\n                     \"RelWithDebInfo\": [\"-xO2\", \"-g\"],\n                     \"MinSizeRel\": [\"-xO2\", \"-xspace\"],\n                     }.get(build_type, [])\n            return flags\n\n    return \"\"\n\n\ndef build_type_define(build_type=None):\n    \"\"\"\n    returns definitions specific to the build type (Debug, Release, etc.)\n    like DEBUG, _DEBUG, NDEBUG\n    \"\"\"\n    return 'NDEBUG' if build_type == 'Release' else \"\"\n\n\ndef adjust_path(path, win_bash=False, subsystem=None, compiler=None):\n    \"\"\"\n    adjusts path to be safely passed to the compiler command line\n    for Windows bash, ensures path is in format according to the subsystem\n    for path with spaces, places double quotes around it\n    converts slashes to backslashes, or vice versa\n    \"\"\"\n    if str(compiler) == 'Visual Studio':\n        path = path.replace('/', '\\\\')\n    else:\n        path = path.replace('\\\\', '/')\n    if win_bash:\n        path = unix_path(path, subsystem)\n    return '\"%s\"' % path if ' ' in path else path\n\n\ndef sysroot_flag(sysroot, win_bash=False, subsystem=None, compiler=None):\n    if str(compiler) != 'Visual Studio' and sysroot:\n        sysroot = adjust_path(sysroot, win_bash=win_bash, subsystem=subsystem, compiler=compiler)\n        return '--sysroot=%s' % sysroot\n    return \"\"\n\n\ndef visual_runtime(runtime):\n    if runtime:\n        return \"-%s\" % runtime\n    return \"\"\n\n\ndef format_defines(defines):\n    return [\"-D%s\" % define for define in defines if define]\n\n\ninclude_path_option = \"-I\"\nvisual_linker_option_separator = \"-link\"  # Further options will apply to the linker\n\n\ndef format_include_paths(include_paths, win_bash=False, subsystem=None, compiler=None):\n    return [\"%s%s\" % (include_path_option, adjust_path(include_path, win_bash=win_bash,\n                                                       subsystem=subsystem, compiler=compiler))\n            for include_path in include_paths if include_path]\n\n\ndef format_library_paths(library_paths, win_bash=False, subsystem=None, compiler=None):\n    pattern = \"-LIBPATH:%s\" if str(compiler) == 'Visual Studio' else \"-L%s\"\n    return [pattern % adjust_path(library_path, win_bash=win_bash,\n                                  subsystem=subsystem, compiler=compiler)\n            for library_path in library_paths if library_path]\n\n\ndef format_libraries(libraries, compiler=None):\n    pattern = \"%s.lib\" if str(compiler) == 'Visual Studio' else \"-l%s\"\n    return [pattern % library for library in libraries if library]\n", "path": "conans/client/build/compiler_flags.py"}], "after_files": [{"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\n    # Visual Studio cl options reference:\n    #   https://msdn.microsoft.com/en-us/library/610ecb4h.aspx\n    #       \"Options are specified by either a forward slash (/) or a dash (\u2013).\"\n    #   Here we use \"-\" better than \"/\" that produces invalid escaped chars using AutoTools.\n    #   -LIBPATH, -D, -I, -ZI and so on.\n\n\"\"\"\n\nfrom conans.tools import unix_path\n\n\ndef rpath_flags(os_build, compiler, lib_paths):\n    if not os_build:\n        return []\n    if compiler in (\"clang\", \"apple-clang\", \"gcc\"):\n        rpath_separator = \",\" if os_build in [\"Macos\", \"iOS\", \"watchOS\", \"tvOS\"] else \"=\"\n        return ['-Wl,-rpath%s\"%s\"' % (rpath_separator, x.replace(\"\\\\\", \"/\"))\n                for x in lib_paths if x]\n    return []\n\n\ndef architecture_flag(compiler, arch):\n    \"\"\"\n    returns flags specific to the target architecture and compiler\n    \"\"\"\n    if not compiler or not arch:\n        return \"\"\n\n    if str(compiler) in ['gcc', 'apple-clang', 'clang', 'sun-cc']:\n        if str(arch) in ['x86_64', 'sparcv9']:\n            return '-m64'\n        elif str(arch) in ['x86', 'sparc']:\n            return '-m32'\n    return \"\"\n\n\ndef libcxx_define(compiler, libcxx):\n\n    if not compiler or not libcxx:\n        return \"\"\n\n    if str(compiler) in ['gcc', 'clang', 'apple-clang']:\n        if str(libcxx) == 'libstdc++':\n            return '_GLIBCXX_USE_CXX11_ABI=0'\n        elif str(libcxx) == 'libstdc++11':\n            return '_GLIBCXX_USE_CXX11_ABI=1'\n    return \"\"\n\n\ndef libcxx_flag(compiler, libcxx):\n    \"\"\"\n    returns flag specific to the target C++ standard library\n    \"\"\"\n    if not compiler or not libcxx:\n        return \"\"\n    if str(compiler) in ['clang', 'apple-clang']:\n        if str(libcxx) in ['libstdc++', 'libstdc++11']:\n            return '-stdlib=libstdc++'\n        elif str(libcxx) == 'libc++':\n            return '-stdlib=libc++'\n    elif str(compiler) == 'sun-cc':\n        return ({\"libCstd\": \"-library=Cstd\",\n                            \"libstdcxx\": \"-library=stdcxx4\",\n                            \"libstlport\": \"-library=stlport4\",\n                            \"libstdc++\": \"-library=stdcpp\"}.get(libcxx, \"\"))\n    return \"\"\n\n\ndef pic_flag(compiler=None):\n    \"\"\"\n    returns PIC (position independent code) flags, such as -fPIC\n    \"\"\"\n    if not compiler or compiler == 'Visual Studio':\n        return \"\"\n    return '-fPIC'\n\n\ndef build_type_flags(compiler, build_type, vs_toolset=None):\n    \"\"\"\n    returns flags specific to the build type (Debug, Release, etc.)\n    (-s, -g, /Zi, etc.)\n    \"\"\"\n    if not compiler or not build_type:\n        return \"\"\n\n    # https://github.com/Kitware/CMake/blob/d7af8a34b67026feaee558433db3a835d6007e06/\n    # Modules/Platform/Windows-MSVC.cmake\n    if str(compiler) == 'Visual Studio':\n        if vs_toolset and \"clang\" in str(vs_toolset):\n            flags = {\"Debug\": [\"-gline-tables-only\", \"-fno-inline\", \"-O0\"],\n                     \"Release\": [\"-O2\"],\n                     \"RelWithDebInfo\": [\"-gline-tables-only\", \"-O2\", \"-fno-inline\"],\n                     \"MinSizeRel\": []\n                     }.get(build_type, [\"-O2\", \"-Ob2\"])\n        else:\n            flags = {\"Debug\": [\"-Zi\", \"-Ob0\", \"-Od\"],\n                     \"Release\": [\"-O2\", \"-Ob2\"],\n                     \"RelWithDebInfo\": [\"-Zi\", \"-O2\", \"-Ob1\"],\n                     \"MinSizeRel\": [\"-O1\", \"-Ob1\"],\n                     }.get(build_type, [])\n        return flags\n    else:\n        # https://github.com/Kitware/CMake/blob/f3bbb37b253a1f4a26809d6f132b3996aa2e16fc/\n        # Modules/Compiler/GNU.cmake\n        # clang include the gnu (overriding some things, but not build type) and apple clang\n        # overrides clang but it doesn't touch clang either\n        if str(compiler) in [\"clang\", \"gcc\", \"apple-clang\"]:\n            # FIXME: It is not clear that the \"-s\" is something related with the build type\n            # cmake is not adjusting it\n            # -s: Remove all symbol table and relocation information from the executable.\n            flags = {\"Debug\": [\"-g\"],\n                     \"Release\": [\"-O3\", \"-s\"] if str(compiler) == \"gcc\" else [\"-O3\"],\n                     \"RelWithDebInfo\": [\"-O2\", \"-g\"],\n                     \"MinSizeRel\": [\"-Os\"],\n                     }.get(build_type, [])\n            return flags\n        elif str(compiler) == \"sun-cc\":\n            # https://github.com/Kitware/CMake/blob/f3bbb37b253a1f4a26809d6f132b3996aa2e16fc/\n            # Modules/Compiler/SunPro-CXX.cmake\n            flags = {\"Debug\": [\"-g\"],\n                     \"Release\": [\"-xO3\"],\n                     \"RelWithDebInfo\": [\"-xO2\", \"-g\"],\n                     \"MinSizeRel\": [\"-xO2\", \"-xspace\"],\n                     }.get(build_type, [])\n            return flags\n\n    return \"\"\n\n\ndef build_type_define(build_type=None):\n    \"\"\"\n    returns definitions specific to the build type (Debug, Release, etc.)\n    like DEBUG, _DEBUG, NDEBUG\n    \"\"\"\n    return 'NDEBUG' if build_type == 'Release' else \"\"\n\n\ndef adjust_path(path, win_bash=False, subsystem=None, compiler=None):\n    \"\"\"\n    adjusts path to be safely passed to the compiler command line\n    for Windows bash, ensures path is in format according to the subsystem\n    for path with spaces, places double quotes around it\n    converts slashes to backslashes, or vice versa\n    \"\"\"\n    if str(compiler) == 'Visual Studio':\n        path = path.replace('/', '\\\\')\n    else:\n        path = path.replace('\\\\', '/')\n    if win_bash:\n        path = unix_path(path, subsystem)\n    return '\"%s\"' % path if ' ' in path else path\n\n\ndef sysroot_flag(sysroot, win_bash=False, subsystem=None, compiler=None):\n    if str(compiler) != 'Visual Studio' and sysroot:\n        sysroot = adjust_path(sysroot, win_bash=win_bash, subsystem=subsystem, compiler=compiler)\n        return '--sysroot=%s' % sysroot\n    return \"\"\n\n\ndef visual_runtime(runtime):\n    if runtime:\n        return \"-%s\" % runtime\n    return \"\"\n\n\ndef format_defines(defines):\n    return [\"-D%s\" % define for define in defines if define]\n\n\ninclude_path_option = \"-I\"\nvisual_linker_option_separator = \"-link\"  # Further options will apply to the linker\n\n\ndef format_include_paths(include_paths, win_bash=False, subsystem=None, compiler=None):\n    return [\"%s%s\" % (include_path_option, adjust_path(include_path, win_bash=win_bash,\n                                                       subsystem=subsystem, compiler=compiler))\n            for include_path in include_paths if include_path]\n\n\ndef format_library_paths(library_paths, win_bash=False, subsystem=None, compiler=None):\n    pattern = \"-LIBPATH:%s\" if str(compiler) == 'Visual Studio' else \"-L%s\"\n    return [pattern % adjust_path(library_path, win_bash=win_bash,\n                                  subsystem=subsystem, compiler=compiler)\n            for library_path in library_paths if library_path]\n\n\ndef format_libraries(libraries, compiler=None):\n    pattern = \"%s.lib\" if str(compiler) == 'Visual Studio' else \"-l%s\"\n    return [pattern % library for library in libraries if library]\n", "path": "conans/client/build/compiler_flags.py"}]}