From a5eba3423a525584bab21d0f82e1d78789f3909c Mon Sep 17 00:00:00 2001 From: Sam Surtees Date: Wed, 5 Oct 2022 02:35:09 +1000 Subject: [PATCH] Android projects use IncludePath instead of ExternalIncludePath --- .../android/tests/test_android_project.lua | 19 +++++++++++++++++++ modules/android/vsandroid_vcxproj.lua | 15 +++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/modules/android/tests/test_android_project.lua b/modules/android/tests/test_android_project.lua index 43ef82b0..74537f0b 100644 --- a/modules/android/tests/test_android_project.lua +++ b/modules/android/tests/test_android_project.lua @@ -26,6 +26,11 @@ vc2010.globals(prj) end + local function prepareOutputProperties() + local cfg = test.getconfig(prj, "Debug") + vc2010.outputProperties(cfg) + end + function suite.minVisualStudioVersion_14() prepareGlobals() test.capture [[ @@ -148,3 +153,17 @@ c++1z ]] end + + function suite.externalIncludeDirs() + externalincludedirs { "externalincludedirs" } + prepareOutputProperties() + test.capture [[ + + true + obj\Debug\ + MyProject + + + externalincludedirs;$(IncludePath) +]] + end diff --git a/modules/android/vsandroid_vcxproj.lua b/modules/android/vsandroid_vcxproj.lua index 79485d05..91ff972b 100644 --- a/modules/android/vsandroid_vcxproj.lua +++ b/modules/android/vsandroid_vcxproj.lua @@ -640,3 +640,18 @@ end) return oldfn(cfg) end end) + +-- +-- Disable usage of ExternalIncludePath, Android project format ignores it. +-- + + p.override(vc2010, "includePath", function(oldfn, cfg) + if cfg.system == p.ANDROID then + local dirs = vstudio.path(cfg, cfg.externalincludedirs) + if #dirs > 0 then + vc2010.element("IncludePath", nil, "%s;$(IncludePath)", table.concat(dirs, ";")) + end + else + oldfn(cfg) + end + end)