-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve configure script so ninja can be run without a wrapper (#26379)
Improve configure script so ninja can be run without a wrapper This is done by using gn --script-executable to make Python scripts / actions use, and having the build-venv auto-activate for the current Python process when used in this way. Plus some minor improvements: - Remove special casing of the build environment directory for in-tree builds and be more helpful when running configure without arguments. - Handle VAR=VALUE arguments as environment variable assignments - Guess CXX based on whether cc appears to be gcc or clang when CC and CXX are not provided.
- Loading branch information
1 parent
991974d
commit 4194511
Showing
3 changed files
with
141 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import venvactivate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Activates the current venv as if the activate script had been sourced | ||
import collections | ||
import os | ||
import sys | ||
|
||
# Prepend the venv bin to PATH (without introducing duplicate entries) | ||
path = [os.path.join(sys.prefix, 'bin')] + os.environ['PATH'].split(':') | ||
os.environ['PATH'] = ':'.join(collections.OrderedDict.fromkeys(path).keys()) | ||
|
||
# Set VIRTUAL_ENV to the venv directory | ||
os.environ['VIRTUAL_ENV'] = sys.prefix |