Browse Source

added building of shared libs to bgfx (#1273)

* added building of shared libs to bgfx

* Update xmake.lua

Co-authored-by: ruki <[email protected]>
FranekStratovarius 3 years ago
parent
commit
8d8bb747f5
1 changed files with 7 additions and 0 deletions
  1. 7 0
      packages/b/bgfx/xmake.lua

+ 7 - 0
packages/b/bgfx/xmake.lua

@@ -40,6 +40,9 @@ package("bgfx")
         end
         end
 
 
         local args = {"--with-tools"}
         local args = {"--with-tools"}
+        if package:config("shared") then
+            table.insert(args, "--with-shared-lib")
+        end
         os.trycp(path.join("include", "bgfx"), package:installdir("include"))
         os.trycp(path.join("include", "bgfx"), package:installdir("include"))
         os.trycp(path.join(bxdir, "include", "*"), package:installdir("include"))
         os.trycp(path.join(bxdir, "include", "*"), package:installdir("include"))
         os.trycp(path.join(bimgdir, "include", "*"), package:installdir("include"))
         os.trycp(path.join(bimgdir, "include", "*"), package:installdir("include"))
@@ -65,6 +68,8 @@ package("bgfx")
             msbuild.build(package, configs)
             msbuild.build(package, configs)
 
 
             os.trycp("../../win*_vs*/bin/*.lib|*example*", package:installdir("lib"))
             os.trycp("../../win*_vs*/bin/*.lib|*example*", package:installdir("lib"))
+            os.trycp("../../win*_vs*/bin/*.dll", package:installdir("lib"))
+            os.trycp("../../win*_vs*/bin/*.lib", package:installdir("lib"))
             os.trycp("../../win*_vs*/bin/*.exe", package:installdir("bin"))
             os.trycp("../../win*_vs*/bin/*.exe", package:installdir("bin"))
         else
         else
             import("package.tools.make")
             import("package.tools.make")
@@ -94,9 +99,11 @@ package("bgfx")
 
 
             if package:is_plat("macosx") then
             if package:is_plat("macosx") then
                 os.trycp(".build/" .. target .. "/bin/*.a|*example*", package:installdir("lib"))
                 os.trycp(".build/" .. target .. "/bin/*.a|*example*", package:installdir("lib"))
+                os.trycp(".build/" .. target .. "/bin/*.so", package:installdir("lib"))
                 os.trycp(".build/" .. target .. "/bin/*|.build/*.*", package:installdir("bin"))
                 os.trycp(".build/" .. target .. "/bin/*|.build/*.*", package:installdir("bin"))
             elseif package:is_plat("linux") then
             elseif package:is_plat("linux") then
                 os.trycp(".build/" .. target .. "/bin/*.a|*example*", package:installdir("lib"))
                 os.trycp(".build/" .. target .. "/bin/*.a|*example*", package:installdir("lib"))
+                os.trycp(".build/" .. target .. "/bin/*.so", package:installdir("lib"))
                 os.trycp(".build/" .. target .. "/bin/*|.build/*.*", package:installdir("bin"))
                 os.trycp(".build/" .. target .. "/bin/*|.build/*.*", package:installdir("bin"))
             end
             end
         end
         end