summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-12-12 14:39:50 +0800
committerGitHub <[email protected]>2024-12-12 14:39:50 +0800
commit3c99013d8f3f465616918f21e0e2e6deb701f9f3 (patch)
treebba02bdf5479f27992dc8391ae5996cb9d0aba0a
parentf2c9a6c2669c90e275753e1c1628dad7fca595da (diff)
parent6896aad2e8f997ceca4a76dbe8180514ca1ffab8 (diff)
Merge pull request #5955 from star-hengxing/protobuf-cross
Improve protobuf test
-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)