summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/projects/c++/protobuf/xmake.lua9
-rw-r--r--xmake/modules/package/tools/cmake.lua2
2 files changed, 7 insertions, 4 deletions
diff --git a/tests/projects/c++/protobuf/xmake.lua b/tests/projects/c++/protobuf/xmake.lua
index 1468cc5e3..f3c544291 100644
--- a/tests/projects/c++/protobuf/xmake.lua
+++ b/tests/projects/c++/protobuf/xmake.lua
@@ -1,11 +1,14 @@
add_rules("mode.debug", "mode.release")
-add_requires("protobuf-cpp")
+
+add_requires("protoc", "protobuf-cpp")
+-- add_requireconfs("protoc.protobuf-cpp", {version = "1.0.0"})
target("test")
set_kind("binary")
- set_languages("c++11")
- add_packages("protobuf-cpp")
+ set_languages("c++17")
add_rules("protobuf.cpp")
add_files("src/*.cpp")
add_files("src/**.proto", {proto_rootdir = "src"})
+ add_packages("protoc", "protobuf-cpp")
+
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index 6d7f15dce..e83f254d8 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -652,7 +652,7 @@ function _get_configs_for_cross(package, configs, opt)
envs.CMAKE_CXX_COMPILER = _translate_bin_path(package:build_getenv("cxx"))
envs.CMAKE_ASM_COMPILER = _translate_bin_path(package:build_getenv("as"))
envs.CMAKE_AR = _translate_bin_path(package:build_getenv("ar"))
- if package:is_plat("windows") and is_host("linux") then
+ if package:is_plat("windows") then
envs.CMAKE_AR = path.join(path.directory(envs.CMAKE_CXX_COMPILER), "lib.exe")
end
_fix_cxx_compiler_cmake(package, envs)