summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2019-02-14 12:15:18 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-10-04 10:20:53 +0200
commit238e81ff331c53c49eecb4cf95e65e4a3aceb31d (patch)
treecadeb77da151674e5316f6f291b389476dfa0507
parent6c9d68192626bd051e9d43a86ec050c45072eabe (diff)
downloadqtwebengine-chromium-238e81ff331c53c49eecb4cf95e65e4a3aceb31d.tar.gz
Add command line parameters for cc,cxx,ld,ar in gn
Change-Id: I122070cdf1dc9a54f7dfdf39c86bd8aadbd8a14c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rwxr-xr-xgn/build/gen.py54
1 files changed, 37 insertions, 17 deletions
diff --git a/gn/build/gen.py b/gn/build/gen.py
index 13c09c9a270..767a444ec8d 100755
--- a/gn/build/gen.py
+++ b/gn/build/gen.py
@@ -129,6 +129,15 @@ def main(argv):
'library, or \'-l<name>\' on POSIX systems. Can be ' +
'used multiple times. Useful to link custom malloc ' +
'or cpu profiling libraries.'))
+ parser.add_option('--cc',
+ help='The path to cc compiler.')
+ parser.add_option('--cxx',
+ help='The path to cxx compiler.')
+ parser.add_option('--ld',
+ help='The path to ld.')
+ parser.add_option('--ar',
+ help='The path to ar.')
+
options, args = parser.parse_args(argv)
if args:
@@ -294,24 +303,24 @@ def WriteGenericNinja(path, static_libraries, executables,
def WriteGNNinja(path, platform, host, options):
- if platform.is_msvc():
- cxx = os.environ.get('CXX', 'cl.exe')
- ld = os.environ.get('LD', 'link.exe')
- ar = os.environ.get('AR', 'lib.exe')
- elif platform.is_aix():
- cxx = os.environ.get('CXX', 'g++')
- ld = os.environ.get('LD', 'g++')
- ar = os.environ.get('AR', 'ar -X64')
- elif platform.is_msys() or platform.is_mingw():
- cxx = os.environ.get('CXX', 'g++')
- ld = os.environ.get('LD', 'g++')
- ar = os.environ.get('AR', 'ar')
- else:
- cxx = os.environ.get('CXX', 'c++')
- ld = cxx
- ar = os.environ.get('AR', 'ar')
-
# QTBUG-64759
+ # if platform.is_msvc():
+ # cxx = os.environ.get('CXX', 'cl.exe')
+ # ld = os.environ.get('LD', 'link.exe')
+ # ar = os.environ.get('AR', 'lib.exe')
+ #elif platform.is_aix():
+ # cxx = os.environ.get('CXX', 'g++')
+ # ld = os.environ.get('LD', 'g++')
+ # ar = os.environ.get('AR', 'ar -X64')
+ #elif platform.is_msys() or platform.is_mingw():
+ # cxx = os.environ.get('CXX', 'g++')
+ # ld = os.environ.get('LD', 'g++')
+ # ar = os.environ.get('AR', 'ar')
+ #else:
+ # cxx = os.environ.get('CXX', 'c++')
+ # ld = cxx
+ # ar = os.environ.get('AR', 'ar')
+
# cflags = os.environ.get('CFLAGS', '').split()
# cflags += os.environ.get('CXXFLAGS', '').split()
# ldflags = os.environ.get('LDFLAGS', '').split()
@@ -322,6 +331,17 @@ def WriteGNNinja(path, platform, host, options):
ldflags = []
libflags = []
+ cc = options.cc
+ cxx = options.cxx
+ ld = options.ld
+ ar = options.ar
+
+ if not ar:
+ if platform.is_msvc():
+ ar = os.environ.get('AR', 'lib.exe')
+ else:
+ ar = os.environ.get('AR', 'ar')
+
include_dirs = [
os.path.relpath(os.path.join(REPO_ROOT, 'src'), os.path.dirname(path)),
'.',