Repository: conan-io/conan (Python)

Issue:
Quoted defines are not correctly generated in Conan premake
To help us debug your issue please explain:

- [X] I've read the [CONTRIBUTING guide](https://github.com/conan-io/conan/blob/develop/.github/CONTRIBUTING.md).
- [X] I've specified the Conan version, operating system version and any tool that can be relevant.
- [X] I've explained the steps to reproduce the error or the motivation/use case of the question/suggestion.

Conan version 1.14.4
macOs : 10.14.3

When including libraries or flags containing quote, the generated conanbuildinfo.premake.lua contains invalid data.

For example, if a recipe includes : 
```self.cpp_info.exelinkflags.extend([ '-framework "Chromium Embedded Framework"'])```
the following code is generated : 
```"-framework "Chromium Embedded Framework"" ```

I have a fix located at firefalcom/conan@01dd9849630fd9e8884ea15ff8e9c262514baa0d

It simply escapes the '''"''', generating 
```"-framework \"Chromium Embedded Framework\"" ```

I can make a pull request if the fix is ok for you


Discussion:
Hi @crazyjul 

Yes, please, a PR with those changes would be welcome, as it already has a unittest, it looks good. Thanks for willing to contribute it.



Thanks for fast response and the great work!!



Patch:
diff --git a/conans/client/generators/premake.py b/conans/client/generators/premake.py
index 7722a2d8b6a..c6a84800eda 100644
--- a/conans/client/generators/premake.py
+++ b/conans/client/generators/premake.py
@@ -11,12 +11,12 @@ def __init__(self, deps_cpp_info):
                                     for p in deps_cpp_info.lib_paths)
         self.bin_paths = ",\n".join('"%s"' % p.replace("\\", "/")
                                     for p in deps_cpp_info.bin_paths)
-        self.libs = ", ".join('"%s"' % p for p in deps_cpp_info.libs)
+        self.libs = ", ".join('"%s"' % p.replace('"', '\\"') for p in deps_cpp_info.libs)
         self.defines = ", ".join('"%s"' % p for p in deps_cpp_info.defines)
         self.cxxflags = ", ".join('"%s"' % p for p in deps_cpp_info.cxxflags)
         self.cflags = ", ".join('"%s"' % p for p in deps_cpp_info.cflags)
-        self.sharedlinkflags = ", ".join('"%s"' % p for p in deps_cpp_info.sharedlinkflags)
-        self.exelinkflags = ", ".join('"%s"' % p for p in deps_cpp_info.exelinkflags)
+        self.sharedlinkflags = ", ".join('"%s"' % p.replace('"', '\\"') for p in deps_cpp_info.sharedlinkflags)
+        self.exelinkflags = ", ".join('"%s"' % p.replace('"', '\\"') for p in deps_cpp_info.exelinkflags)
 
         self.rootpath = "%s" % deps_cpp_info.rootpath.replace("\\", "/")
 
@@ -41,7 +41,7 @@ def content(self):
                     'conan_exelinkflags{dep} = {{{deps.exelinkflags}}}\n')
 
         sections = ["#!lua"]
-        
+
         sections.extend(
                 ['conan_build_type = "{0}"'.format(str(self.settings.get_safe("build_type"))),
                  'conan_arch = "{0}"'.format(str(self.settings.get_safe("arch"))),


Test patch:
diff --git a/conans/test/unittests/client/generators/premake_test.py b/conans/test/unittests/client/generators/premake_test.py
index a7fc6372bcb..220258f2feb 100644
--- a/conans/test/unittests/client/generators/premake_test.py
+++ b/conans/test/unittests/client/generators/premake_test.py
@@ -29,8 +29,8 @@ class PremakeGeneratorTest(unittest.TestCase):
     conan_defines = {{"MYDEFINE2", "MYDEFINE1"}}
     conan_cxxflags = {{"-march=native", "-fPIE"}}
     conan_cflags = {{"-mtune=native", "-fPIC"}}
-    conan_sharedlinkflags = {{"-framework AudioFoundation", "-framework Cocoa"}}
-    conan_exelinkflags = {{"-framework VideoToolbox", "-framework QuartzCore"}}
+    conan_sharedlinkflags = {{"-framework AudioFoundation", "-framework \\\"Some Spaced Framework\\\"", "-framework Cocoa"}}
+    conan_exelinkflags = {{"-framework VideoToolbox", "-framework \\\"Other Spaced Framework\\\"", "-framework QuartzCore"}}
 
     conan_includedirs_MyPkg1 = {{"{include1}"}}
     conan_libdirs_MyPkg1 = {{"{lib1}"}}
@@ -50,8 +50,8 @@ class PremakeGeneratorTest(unittest.TestCase):
     conan_defines_MyPkg2 = {{"MYDEFINE2"}}
     conan_cxxflags_MyPkg2 = {{"-march=native"}}
     conan_cflags_MyPkg2 = {{"-mtune=native"}}
-    conan_sharedlinkflags_MyPkg2 = {{"-framework AudioFoundation"}}
-    conan_exelinkflags_MyPkg2 = {{"-framework VideoToolbox"}}
+    conan_sharedlinkflags_MyPkg2 = {{"-framework AudioFoundation", "-framework \\\"Some Spaced Framework\\\""}}
+    conan_exelinkflags_MyPkg2 = {{"-framework VideoToolbox", "-framework \\\"Other Spaced Framework\\\""}}
     conan_rootpath_MyPkg2 = "{root2}"
 
     function conan_basic_setup()
@@ -100,8 +100,8 @@ def setUp(self):
         cpp_info.version = "3.2.3"
         cpp_info.cflags = ['-mtune=native']
         cpp_info.cxxflags = ['-march=native']
-        cpp_info.sharedlinkflags = ['-framework AudioFoundation']
-        cpp_info.exelinkflags = ['-framework VideoToolbox']
+        cpp_info.sharedlinkflags = ['-framework AudioFoundation', '-framework "Some Spaced Framework"']
+        cpp_info.exelinkflags = ['-framework VideoToolbox', '-framework "Other Spaced Framework"']
         self.conanfile.deps_cpp_info.update(cpp_info, ref.name)
 
     def test_variables_content(self):