summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2018-04-23 22:45:44 +0800
committerruki <[email protected]>2018-04-23 10:34:29 +0800
commitef0cf64971eaa9a0b4331f7fa1518bf79dbf6178 (patch)
tree351e53c3750a0b2e7d192fd47cd3e8e264ea91e6
parentd1de6e6006a786f46016d30db4a8f90037039143 (diff)
add qt support for msvc and mingw
-rw-r--r--xmake/modules/core/tools/cl.lua4
-rw-r--r--xmake/modules/detect/sdks/find_qt.lua9
-rw-r--r--xmake/rules/qt/load.lua12
3 files changed, 22 insertions, 3 deletions
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua
index c0f4b369c..8b5ffcbd6 100644
--- a/xmake/modules/core/tools/cl.lua
+++ b/xmake/modules/core/tools/cl.lua
@@ -192,8 +192,8 @@ function nf_language(self, stdname)
-- the stdc++ maps
local cxxmaps =
{
- cxx11 = "-std=c++11"
- , gnuxx11 = "-std=c++11"
+ cxx11 = "-std:c++11"
+ , gnuxx11 = "-std:c++11"
, cxx14 = "-std:c++14"
, gnuxx14 = "-std:c++14"
, cxx17 = "-std:c++17"
diff --git a/xmake/modules/detect/sdks/find_qt.lua b/xmake/modules/detect/sdks/find_qt.lua
index 1becbdfc5..28a517444 100644
--- a/xmake/modules/detect/sdks/find_qt.lua
+++ b/xmake/modules/detect/sdks/find_qt.lua
@@ -41,6 +41,15 @@ function _find_sdkdir(sdkdir, sdkver)
targetdir = is_arch("x86_64") and "gcc_64" or "gcc_32"
elseif is_plat("macosx") then
targetdir = is_arch("x86_64") and "clang_64" or "clang_32"
+ elseif is_plat("windows") then
+ local vs = config.get("vs")
+ if vs then
+ targetdir = is_arch("x64") and "msvc" .. vs .. "_64" or "msvc" .. vs .. "_32"
+ else
+ targetdir = is_arch("x64") and "msvc*_64" or "msvc*_32"
+ end
+ elseif is_plat("mingw") then
+ targetdir = is_arch("x64") and "mingw*_64" or "mingw*_32"
elseif is_plat("android") then
targetdir = "android_*" -- TODO android_armv7 and ..?
end
diff --git a/xmake/rules/qt/load.lua b/xmake/rules/qt/load.lua
index 2847f2b52..73c23d5e8 100644
--- a/xmake/rules/qt/load.lua
+++ b/xmake/rules/qt/load.lua
@@ -90,7 +90,7 @@ function main(target, opt)
-- add includedirs
if is_plat("macosx") then
target:add("includedirs", path.join(qt.sdkdir, "lib/" .. framework .. ".framework/Headers"))
- elseif is_plat("linux") then
+ else
target:add("links", _link(framework, major))
target:add("includedirs", path.join(qt.sdkdir, "include/" .. framework))
end
@@ -110,6 +110,16 @@ function main(target, opt)
target:add("includedirs", path.join(qt.sdkdir, "mkspecs/linux-g++"))
target:add("rpathdirs", qt.linkdirs)
target:add("linkdirs", qt.linkdirs)
+ elseif is_plat("windows") then
+ target:set("frameworks", nil)
+ target:add("includedirs", path.join(qt.sdkdir, "include"))
+ target:add("includedirs", path.join(qt.sdkdir, "mkspecs/win32-msvc"))
+ target:add("linkdirs", qt.linkdirs)
+ elseif is_plat("mingw") then
+ target:set("frameworks", nil)
+ target:add("includedirs", path.join(qt.sdkdir, "include"))
+ target:add("includedirs", path.join(qt.sdkdir, "mkspecs/win32-g++"))
+ target:add("linkdirs", qt.linkdirs)
end
end