Repository: conan-io/conan

Issue:
[bug] Premake generator does not use frameworks
<!--
  Please don't forget to update the issue title.
  Include all applicable information to help us reproduce your problem.

  To help us debug your issue please explain:
-->

### Environment Details (include every applicable attribute)
  * Operating System+version: MacOS
  * Compiler+version:
  * Conan version: 1.39.0
  * Python version:

### Steps to reproduce (Include if Applicable)

The `premake` generator does not take `frameworks` into account for MacOS. For Premake5, these need to be added as `links` with a `.framework` suffix: https://premake.github.io/docs/links#examples


### Logs (Executed commands with output) (Include/Attach if Applicable)

<!--
  Your log content should be related to the bug description, it can be:
  - Conan command output
  - Server output (Artifactory, conan_server)
-->



Discussion:
Thanks for reporting. Could I ask how often do you use the premake generator? Are you using premake in your personal/company projects or is it an open-source one? We don't receive much feedback from that generator, I think the last change was about a year ago, so I'm curious. Thanks again!
It was my first time using it yesterday. I'm just doing a hobby project (game in C with SDL2).

I'm happy to try and fix this if you want?

Resolving patch:
diff --git a/conans/client/generators/premake.py b/conans/client/generators/premake.py
--- a/conans/client/generators/premake.py
+++ b/conans/client/generators/premake.py
@@ -18,6 +18,7 @@ def __init__(self, deps_cpp_info):
         self.cflags = ", ".join('"%s"' % p for p in deps_cpp_info.cflags)
         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.frameworks = ", ".join('"%s.framework"' % p.replace('"', '\\"') for p in deps_cpp_info.frameworks)
 
         self.rootpath = "%s" % deps_cpp_info.rootpath.replace("\\", "/")
 
@@ -40,7 +41,8 @@ def content(self):
                     'conan_cxxflags{dep} = {{{deps.cxxflags}}}\n'
                     'conan_cflags{dep} = {{{deps.cflags}}}\n'
                     'conan_sharedlinkflags{dep} = {{{deps.sharedlinkflags}}}\n'
-                    'conan_exelinkflags{dep} = {{{deps.exelinkflags}}}\n')
+                    'conan_exelinkflags{dep} = {{{deps.exelinkflags}}}\n'
+                    'conan_frameworks{dep} = {{{deps.frameworks}}}\n')
 
         sections = ["#!lua"]
 
@@ -68,6 +70,7 @@ def content(self):
             "    libdirs{conan_libdirs}\n"
             "    links{conan_libs}\n"
             "    links{conan_system_libs}\n"
+            "    links{conan_frameworks}\n"
             "    defines{conan_defines}\n"
             "    bindirs{conan_bindirs}\n"
             "end\n")


Test patch:
diff --git a/conans/test/unittests/client/generators/premake_test.py b/conans/test/unittests/client/generators/premake_test.py
--- a/conans/test/unittests/client/generators/premake_test.py
+++ b/conans/test/unittests/client/generators/premake_test.py
@@ -33,6 +33,7 @@ class PremakeGeneratorTest(unittest.TestCase):
     conan_cflags = {{"-mtune=native", "-fPIC"}}
     conan_sharedlinkflags = {{"-framework AudioFoundation", "-framework \\\"Some Spaced Framework\\\"", "-framework Cocoa"}}
     conan_exelinkflags = {{"-framework VideoToolbox", "-framework \\\"Other Spaced Framework\\\"", "-framework QuartzCore"}}
+    conan_frameworks = {{"AudioUnit.framework"}}
 
     conan_includedirs_MyPkg1 = {{"{include1}"}}
     conan_libdirs_MyPkg1 = {{"{lib1}"}}
@@ -44,6 +45,7 @@ class PremakeGeneratorTest(unittest.TestCase):
     conan_cflags_MyPkg1 = {{"-fPIC"}}
     conan_sharedlinkflags_MyPkg1 = {{"-framework Cocoa"}}
     conan_exelinkflags_MyPkg1 = {{"-framework QuartzCore"}}
+    conan_frameworks_MyPkg1 = {{"AudioUnit.framework"}}
     conan_rootpath_MyPkg1 = "{root1}"
 
     conan_includedirs_MyPkg2 = {{"{include2}"}}
@@ -56,6 +58,7 @@ class PremakeGeneratorTest(unittest.TestCase):
     conan_cflags_MyPkg2 = {{"-mtune=native"}}
     conan_sharedlinkflags_MyPkg2 = {{"-framework AudioFoundation", "-framework \\\"Some Spaced Framework\\\""}}
     conan_exelinkflags_MyPkg2 = {{"-framework VideoToolbox", "-framework \\\"Other Spaced Framework\\\""}}
+    conan_frameworks_MyPkg2 = {{}}
     conan_rootpath_MyPkg2 = "{root2}"
 
     function conan_basic_setup()
@@ -65,6 +68,7 @@ class PremakeGeneratorTest(unittest.TestCase):
         libdirs{{conan_libdirs}}
         links{{conan_libs}}
         links{{conan_system_libs}}
+        links{{conan_frameworks}}
         defines{{conan_defines}}
         bindirs{{conan_bindirs}}
     end
@@ -95,6 +99,7 @@ def setUp(self):
         cpp_info.cxxflags = ['-fPIE']
         cpp_info.sharedlinkflags = ['-framework Cocoa']
         cpp_info.exelinkflags = ['-framework QuartzCore']
+        cpp_info.frameworks = ['AudioUnit']
         self.conanfile.deps_cpp_info.add(ref.name, cpp_info)
         ref = ConanFileReference.loads("MyPkg2/3.2.3@lasote/stables")
         cpp_info = CppInfo(ref.name, self.tmp_folder2)