summaryrefslogtreecommitdiffstatshomepage
path: root/scripts/src/osd/modules.lua
diff options
context:
space:
mode:
author ImJezze <jezze@gmx.net>2015-05-02 19:41:03 +0200
committer ImJezze <jezze@gmx.net>2015-05-02 19:41:03 +0200
commitcc3b682e52bf097d31db78032aad01d6a0b12e94 (patch)
tree860c97ca011b64c31a5ad277f5cea2b1d86eeaf0 /scripts/src/osd/modules.lua
parent7df6a23ba2ae1c1df94ed8cc2398f2546f339997 (diff)
parenta649a95488e1fc85813dda747dc74c596496bd1c (diff)
Merge pull request #1 from mamedev/master
Sync to master
Diffstat (limited to 'scripts/src/osd/modules.lua')
-rw-r--r--scripts/src/osd/modules.lua44
1 files changed, 36 insertions, 8 deletions
diff --git a/scripts/src/osd/modules.lua b/scripts/src/osd/modules.lua
index dd2e9a1cf8d..9bfdfb201c1 100644
--- a/scripts/src/osd/modules.lua
+++ b/scripts/src/osd/modules.lua
@@ -1,3 +1,29 @@
+function string.starts(String,Start)
+ return string.sub(String,1,string.len(Start))==Start
+end
+
+function addlibfromstring(str)
+ if (str==nil) then return end
+ for w in str:gmatch("%S+") do
+ if string.starts(w,"-l")==true then
+ links {
+ string.sub(w,3)
+ }
+ end
+ end
+end
+
+function addoptionsfromstring(str)
+ if (str==nil) then return end
+ for w in str:gmatch("%S+") do
+ if string.starts(w,"-l")==false then
+ linkoptions {
+ w
+ }
+ end
+ end
+end
+
function osdmodulesbuild()
removeflags {
@@ -191,9 +217,9 @@ function osdmodulestargetconf()
if _OPTIONS["NO_USE_MIDI"]~="1" then
if _OPTIONS["targetos"]=="linux" then
- linkoptions {
- backtick("pkg-config --libs alsa"),
- }
+ local str = backtick("pkg-config --libs alsa")
+ addlibfromstring(str)
+ addoptionsfromstring(str)
elseif _OPTIONS["targetos"]=="macosx" then
links {
"CoreMIDI.framework",
@@ -223,13 +249,15 @@ function osdmodulestargetconf()
if _OPTIONS["QT_HOME"]~=nil then
linkoptions {
"-L" .. backtick(_OPTIONS["QT_HOME"] .. "/bin/qmake -query QT_INSTALL_LIBS"),
- "-lQtGui",
- "-lQtCore",
}
- else
- linkoptions {
- backtick("pkg-config --libs QtGui"),
+ links {
+ "QtGui",
+ "QtCore",
}
+ else
+ local str = backtick("pkg-config --libs QtGui")
+ addlibfromstring(str)
+ addoptionsfromstring(str)
end
end
end