Add a new runtime option for target SDK version
SDK version can be set through VMRuntime, but we also need a way
of setting it in dex2oat.
Bug: 64382372
Test: make test-art-host
Change-Id: I82b9360be59a8bc1984006379d8011d50a0199c3
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 377e0a3..007d361 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -250,7 +250,7 @@
preinitialization_transactions_(),
verify_(verifier::VerifyMode::kNone),
allow_dex_file_fallback_(true),
- target_sdk_version_(0),
+ target_sdk_version_(kUnsetSdkVersion),
implicit_null_checks_(false),
implicit_so_checks_(false),
implicit_suspend_checks_(false),
@@ -1166,6 +1166,8 @@
verify_ = runtime_options.GetOrDefault(Opt::Verify);
allow_dex_file_fallback_ = !runtime_options.Exists(Opt::NoDexFileFallback);
+ target_sdk_version_ = runtime_options.GetOrDefault(Opt::TargetSdkVersion);
+
no_sig_chain_ = runtime_options.Exists(Opt::NoSigChain);
force_native_bridge_ = runtime_options.Exists(Opt::ForceNativeBridge);