mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
tools: Add VSCode setup (fixes #3906)
Add tooling to set up a Visual Studio Code development environment for CEF. See script output for usage. Run: python3 tools/setup_vscode.py
This commit is contained in:
@ -10,6 +10,7 @@ from gclient_util import *
|
||||
from gn_args import GetAllPlatformConfigs, GetConfigFileContents
|
||||
import issue_1999
|
||||
import os
|
||||
from setup_vscode import GetPreferredOutputDirectory, UpdateCompileCommandsJSON
|
||||
import sys
|
||||
|
||||
# The CEF directory is the parent directory of _this_ script.
|
||||
@ -26,7 +27,7 @@ elif sys.platform.startswith('linux'):
|
||||
platform = 'linux'
|
||||
else:
|
||||
print('Unknown operating system platform')
|
||||
sys.exit()
|
||||
sys.exit(1)
|
||||
|
||||
print("\nGenerating CEF translated files...")
|
||||
cmd = [sys.executable, 'tools/version_manager.py', '-u', '--fast-check']
|
||||
@ -134,6 +135,10 @@ if platform == 'windows':
|
||||
gn_args['windows_sdk_version'] = os.environ['SDK_VERSION']
|
||||
|
||||
configs = GetAllPlatformConfigs(gn_args)
|
||||
|
||||
# Returns the preferred output directory for VSCode, or None.
|
||||
preferred_dir = GetPreferredOutputDirectory(configs.keys())
|
||||
|
||||
for dir, config in configs.items():
|
||||
# Create out directories and write the args.gn file.
|
||||
out_path = os.path.join(src_dir, 'out', dir)
|
||||
@ -149,3 +154,7 @@ for dir, config in configs.items():
|
||||
RunAction(src_dir, cmd)
|
||||
if platform == 'windows':
|
||||
issue_1999.apply(out_path)
|
||||
|
||||
if dir == preferred_dir and not UpdateCompileCommandsJSON(
|
||||
src_dir, out_path, create=False):
|
||||
sys.exit(1)
|
||||
|
Reference in New Issue
Block a user