mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 07:43:03 +04:00
Merge branch 4.x
This commit is contained in:
@@ -139,6 +139,8 @@ class ABI:
|
||||
return "%s (%s)" % (self.name, self.toolchain)
|
||||
def haveIPP(self):
|
||||
return self.name == "x86" or self.name == "x86_64"
|
||||
def haveKleidiCV(self):
|
||||
return self.name == "arm64-v8a"
|
||||
|
||||
#===================================================================================================
|
||||
|
||||
@@ -380,6 +382,39 @@ def get_ndk_dir():
|
||||
return android_sdk_ndk_bundle
|
||||
return None
|
||||
|
||||
def check_cmake_flag_enabled(cmake_file, flag_name, strict=True):
|
||||
print(f"Checking build flag '{flag_name}' in: {cmake_file}")
|
||||
|
||||
if not os.path.isfile(cmake_file):
|
||||
msg = f"ERROR: File {cmake_file} does not exist."
|
||||
if strict:
|
||||
print(msg)
|
||||
sys.exit(1)
|
||||
else:
|
||||
print("WARNING:", msg)
|
||||
return
|
||||
|
||||
with open(cmake_file, 'r') as file:
|
||||
for line in file:
|
||||
if line.strip().startswith(f"{flag_name}="):
|
||||
value = line.strip().split('=')[1]
|
||||
if value == '1' or value == 'ON':
|
||||
print(f"{flag_name}=1 found. Support is enabled.")
|
||||
return
|
||||
else:
|
||||
msg = f"ERROR: {flag_name} is set to {value}, expected 1."
|
||||
if strict:
|
||||
print(msg)
|
||||
sys.exit(1)
|
||||
else:
|
||||
print("WARNING:", msg)
|
||||
return
|
||||
msg = f"ERROR: {flag_name} not found in {os.path.basename(cmake_file)}."
|
||||
if strict:
|
||||
print(msg)
|
||||
sys.exit(1)
|
||||
else:
|
||||
print("WARNING:", msg)
|
||||
|
||||
#===================================================================================================
|
||||
|
||||
@@ -407,6 +442,7 @@ if __name__ == "__main__":
|
||||
parser.add_argument('--no_media_ndk', action="store_true", help="Do not link Media NDK (required for video I/O support)")
|
||||
parser.add_argument('--hwasan', action="store_true", help="Enable Hardware Address Sanitizer on ARM64")
|
||||
parser.add_argument('--disable', metavar='FEATURE', default=[], action='append', help='OpenCV features to disable (add WITH_*=OFF). To disable multiple, specify this flag again, e.g. "--disable TBB --disable OPENMP"')
|
||||
parser.add_argument('--no-strict-dependencies',action='store_false',dest='strict_dependencies',help='Disable strict dependency checking (default: strict mode ON)')
|
||||
args = parser.parse_args()
|
||||
|
||||
log.basicConfig(format='%(message)s', level=log.DEBUG)
|
||||
@@ -486,6 +522,16 @@ if __name__ == "__main__":
|
||||
builder.clean_library_build_dir()
|
||||
builder.build_library(abi, do_install, args.no_media_ndk)
|
||||
|
||||
#Check HAVE_IPP x86 / x86_64
|
||||
if abi.haveIPP():
|
||||
log.info("Checking HAVE_IPP for ABI: %s", abi.name)
|
||||
check_cmake_flag_enabled(os.path.join(builder.libdest,"CMakeVars.txt"), "HAVE_IPP", strict=args.strict_dependencies)
|
||||
|
||||
#Check HAVE_KLEIDICV for armv8
|
||||
if abi.haveKleidiCV():
|
||||
log.info("Checking HAVE_KLEIDICV for ABI: %s", abi.name)
|
||||
check_cmake_flag_enabled(os.path.join(builder.libdest,"CMakeVars.txt"), "HAVE_KLEIDICV", strict=args.strict_dependencies)
|
||||
|
||||
builder.gather_results()
|
||||
|
||||
if args.build_doc:
|
||||
|
||||
Reference in New Issue
Block a user