summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChan Lee <[email protected]>2025-05-14 19:10:57 +0800
committerChan Lee <[email protected]>2025-05-14 19:28:15 +0800
commite2dafa09e52622995afe22ed32206ecf38c9a9d0 (patch)
treeca480e7e5f2420ad1b03051961e64ace569050fd
parenta68eff4a47e81b8ea430ee4f4a86d1fd8ccc7df9 (diff)
package(install): prepend comment to generated .pc files to better distinguish
-rw-r--r--xmake/modules/private/action/require/impl/actions/install.lua1
-rw-r--r--xmake/modules/target/action/install/pkgconfig_importfiles.lua1
2 files changed, 2 insertions, 0 deletions
diff --git a/xmake/modules/private/action/require/impl/actions/install.lua b/xmake/modules/private/action/require/impl/actions/install.lua
index 5e0c2c542..d30c9364f 100644
--- a/xmake/modules/private/action/require/impl/actions/install.lua
+++ b/xmake/modules/private/action/require/impl/actions/install.lua
@@ -91,6 +91,7 @@ function _patch_pkgconfig(package)
-- patch a *.pc file
local file = io.open(pcfile, 'w')
if file then
+ file:print("# Generated by Xmake")
file:print("prefix=%s", installdir:gsub("\\", "/"))
file:print("exec_prefix=${prefix}")
file:print("libdir=${exec_prefix}/lib")
diff --git a/xmake/modules/target/action/install/pkgconfig_importfiles.lua b/xmake/modules/target/action/install/pkgconfig_importfiles.lua
index 65da32085..88d545310 100644
--- a/xmake/modules/target/action/install/pkgconfig_importfiles.lua
+++ b/xmake/modules/target/action/install/pkgconfig_importfiles.lua
@@ -70,6 +70,7 @@ function main(target, opt)
-- generate a *.pc file
local file = io.open(pcfile, 'w')
if file then
+ file:print("# Generated by Xmake")
file:print("prefix=%s", installdir:gsub("\\", "/"))
file:print("exec_prefix=${prefix}")
file:print("libdir=${exec_prefix}/lib")