summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorws <[email protected]>2020-03-23 22:19:29 +0800
committerws <[email protected]>2020-03-23 22:19:29 +0800
commit10297381b8d2efb071247d07ece52d8d418abb1d (patch)
tree770ba6defe97fbef9bee015fbef21021c21e4f03
parent44f3296096c3c18fa2825207445341410bddb428 (diff)
add qt private header for window and linux
-rw-r--r--xmake/rules/qt/load.lua40
1 files changed, 26 insertions, 14 deletions
diff --git a/xmake/rules/qt/load.lua b/xmake/rules/qt/load.lua
index 62027aaa4..e4c96e5ef 100644
--- a/xmake/rules/qt/load.lua
+++ b/xmake/rules/qt/load.lua
@@ -11,7 +11,7 @@
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
---
+--
-- Copyright (C) 2015-2020, TBOOX Open Source Group.
--
-- @author ruki
@@ -167,22 +167,34 @@ function main(target, opt)
-- translate qt frameworks
if framework:startswith("Qt") then
- -- add defines
- target:add("defines", "QT_" .. framework:sub(3):upper() .. "_LIB")
-
- -- add includedirs
- if is_plat("macosx") then
- local frameworkdir = path.join(qt.sdkdir, "lib", framework .. ".framework")
- if os.isdir(frameworkdir) then
- target:add("includedirs", path.join(frameworkdir, "Headers"))
- useframeworks = true
+ if (framework:lower():endswith("private")) then
+ -- add private includedirs
+ print("private")
+ if is_plat("macosx") then
+ print("macosx")
+ else
+ local private_dir = framework:sub(1, -string.len("private") - 1);
+ target:add("includedirs", path.join(qt.sdkdir, "include", private_dir, qt.sdkver, private_dir))
+ target:add("includedirs", path.join(qt.sdkdir, "include", private_dir, qt.sdkver))
+ end
+ else
+ -- add defines
+ target:add("defines", "QT_" .. framework:sub(3):upper() .. "_LIB")
+
+ -- add includedirs
+ if is_plat("macosx") then
+ local frameworkdir = path.join(qt.sdkdir, "lib", framework .. ".framework")
+ if os.isdir(frameworkdir) then
+ target:add("includedirs", path.join(frameworkdir, "Headers"))
+ useframeworks = true
+ else
+ target:add("syslinks", _link(framework, major))
+ target:add("includedirs", path.join(qt.sdkdir, "include", framework))
+ end
else
target:add("syslinks", _link(framework, major))
target:add("includedirs", path.join(qt.sdkdir, "include", framework))
end
- else
- target:add("syslinks", _link(framework, major))
- target:add("includedirs", path.join(qt.sdkdir, "include", framework))
end
end
end
@@ -196,7 +208,7 @@ function main(target, opt)
target:add("syslinks", syslinks_user)
end
- -- add includedirs, linkdirs
+ -- add includedirs, linkdirs
if is_plat("macosx") then
target:add("frameworks", "DiskArbitration", "IOKit", "CoreFoundation", "CoreGraphics", "OpenGL")
target:add("frameworks", "Carbon", "Foundation", "AppKit", "Security", "SystemConfiguration")