@@ -724,7 +724,10 @@ function _get_configs_for_install(package, configs, opt)
724
724
end
725
725
726
726
function _get_default_flags (package , configs , buildtype , opt )
727
- local cmake_default_flags = _g .cmake_default_flags and _g .cmake_default_flags [buildtype ]
727
+ -- The default flags are different for different platforms
728
+ -- @see https://github.com/xmake-io/xmake-repo/pull/4038#issuecomment-2116489448
729
+ local cachekey = buildtype .. package :plat () .. package :arch ()
730
+ local cmake_default_flags = _g .cmake_default_flags and _g .cmake_default_flags [cachekey ]
728
731
if not cmake_default_flags then
729
732
local tmpdir = path .join (os .tmpdir () .. " .dir" , package :name (), package :mode ())
730
733
local dummy_cmakelist = path .join (tmpdir , " CMakeLists.txt" )
@@ -764,7 +767,7 @@ function _get_default_flags(package, configs, buildtype, opt)
764
767
cmake_default_flags .arflags = cmake_default_flags .arflags .. " " .. outdata :match (format (" CMAKE_STATIC_LINKER_FLAGS_%s is (.-)\n " , buildtype ))
765
768
766
769
_g .cmake_default_flags = _g .cmake_default_flags or {}
767
- _g .cmake_default_flags [buildtype ] = cmake_default_flags
770
+ _g .cmake_default_flags [cachekey ] = cmake_default_flags
768
771
end
769
772
os .rm (tmpdir )
770
773
end
@@ -822,7 +825,7 @@ function _get_envs_for_runtime_flags(package, configs, opt)
822
825
end
823
826
return envs
824
827
end
825
- -- get configs
828
+
826
829
function _get_configs (package , configs , opt )
827
830
configs = configs or {}
828
831
opt ._configs_str = string .serialize (configs , {indent = false , strip = true })
0 commit comments