Compiler-Version

Überblick

Mit der Erweiterung für die Compiler-Version können Sie die zugeordneten Compiler-Versionen anzeigen und eine neue Compiler-Version festlegen, indem Sie das Skript ausführen.

Script Engine-Beispiel

# Enable the new python 3 print syntax
from __future__ import print_function
 
# The path to the project
project_path = r"D:\PythonProjects\GetCompilerVersion.project"
 
# Clean up any open Project:
if projects.primary:
    projects.primary.close()
 
# Load the project
proj = projects.open(project_path); 
 
print("All compiler versions")
# Get all compiler versions (filtered)
compiler_versions = compiler_settings.get_all_compiler_versions()
 
# Print all compiler versions (filtered)
for version in compiler_versions:
    print (" - OEM mapped version: " + version)
 
# Get active compiler version
compiler_version = compiler_settings.active_compiler_version
print("Current compiler version:" + compiler_version)
 
# Set new compiler version
compiler_settings.active_compiler_version = "4.2.0.0"
print("New compiler version: " +
compiler_settings.active_compiler_version)
 
# Save project
projects.primary.save()