Take CC and CXX from environment
authorNikolai Merinov <n.merinov@samsung.com>
Fri, 8 Feb 2019 13:50:54 +0000 (16:50 +0300)
committerNikolai Merinov <n.merinov@samsung.com>
Fri, 15 Feb 2019 09:33:47 +0000 (12:33 +0300)
build_common/SConscript
build_common/thread.scons

index 8612220baeff2c8385b3576fd177e7e4c296ecdf..91662b77ad214a9fd659fe043a6625a2673c9075 100644 (file)
@@ -166,7 +166,9 @@ else:
        env = Environment(variables = help_vars, tools = ['default', 'textfile'],
                        TARGET_ARCH = target_arch, TARGET_OS = target_os,
                        PREFIX = GetOption('prefix'),
-                       LIB_INSTALL_DIR = ARGUMENTS.get('LIB_INSTALL_DIR') #for 64bit build
+                       LIB_INSTALL_DIR = ARGUMENTS.get('LIB_INSTALL_DIR'), #for 64bit build
+                       CC = os.environ.get('CC') or 'gcc',
+                       CXX = os.environ.get('CXX') or 'g++'
                        )
 Help(help_vars.GenerateHelpText(env))
 
index 2b07db5148dbe956c7369faa55246294f2d768d5..0d074d533e1e12d2b8a5d6bdeb9e03a9c1288664 100644 (file)
@@ -8,7 +8,7 @@ target_os = thread_env.get('TARGET_OS')
 
 # Export flags once for all
 compiler = thread_env.get('CC')
-if 'gcc' in compiler:
+if 'gcc' in compiler or 'clang' in compiler:
     thread_env.AppendUnique(CFLAGS = ['-Wall'])
     if target_os not in ['android','tizenrt']:
         thread_env.AppendUnique(CFLAGS = ['-pthread'])