Pārlūkot izejas kodu

gperftools: don't use build folder (#7445)

* gperftools: don't use build folder

build folder will conflict with the BUILD file on non case-sensitive filesystem (common on Windows)

* fix link

---------

Co-authored-by: star9029 <[email protected]>
Jérôme Leclercq 2 mēneši atpakaļ
vecāks
revīzija
37a8334b36
1 mainītis faili ar 12 papildinājumiem un 8 dzēšanām
  1. 12 8
      packages/g/gperftools/xmake.lua

+ 12 - 8
packages/g/gperftools/xmake.lua

@@ -1,5 +1,4 @@
 package("gperftools")
-
     set_homepage("https://github.com/gperftools/gperftools")
     set_description("gperftools is a collection of a high-performance multi-threaded malloc() implementation, plus some pretty nifty performance analysis tools.")
     set_license("BSD-3-Clause")
@@ -53,6 +52,10 @@ package("gperftools")
             package:add("deps", "libunwind")
         end
 
+        if not package:config("shared") then
+            package:add("defines", "PERFTOOLS_DLL_DECL=")
+        end
+
         if package:config("tcmalloc") then
             local libsuffix = package:config("minimal") and "_minimal" or ""
             libsuffix = package:is_debug() and libsuffix .. "_debug" or libsuffix
@@ -62,6 +65,7 @@ package("gperftools")
         if package:config("profiler") then
             package:add("links", "profiler")
         end
+        package:add("links", "stacktrace", "common")
     end)
 
     on_install("windows|!arm64", "macosx", "linux", "mingw", function (package)
@@ -79,14 +83,14 @@ package("gperftools")
         if package:version():le("2.15") then
             import("package.tools.cmake").install(package, configs)
         else 
-            import("package.tools.cmake").build(package, configs, {buildir = "build"})
+            import("package.tools.cmake").build(package, configs, {buildir = "xmakebuild"})
 
-            os.trycp("build/gperftools", package:installdir("include"))
-            os.trycp("build/**.a", package:installdir("lib"))
-            os.trycp("build/**.dylib", package:installdir("lib"))
-            os.trycp("build/**.so", package:installdir("lib"))
-            os.trycp("build/**.lib", package:installdir("lib"))
-            os.trycp("build/**.dll", package:installdir("bin"))
+            os.trycp("xmakebuild/gperftools", package:installdir("include"))
+            os.trycp("xmakebuild/**.a", package:installdir("lib"))
+            os.trycp("xmakebuild/**.dylib", package:installdir("lib"))
+            os.trycp("xmakebuild/**.so", package:installdir("lib"))
+            os.trycp("xmakebuild/**.lib", package:installdir("lib"))
+            os.trycp("xmakebuild/**.dll", package:installdir("bin"))
         end
     end)