2012-08-01 23:50:35 -04:00
|
|
|
import os
|
|
|
|
|
|
|
|
flags = [
|
|
|
|
'-Wall',
|
|
|
|
'-Wextra',
|
|
|
|
'-Werror',
|
|
|
|
'-Wc++98-compat',
|
|
|
|
'-Wno-long-long',
|
|
|
|
'-Wno-variadic-macros',
|
2012-08-11 22:46:22 -04:00
|
|
|
'-fexceptions',
|
2012-08-01 23:50:35 -04:00
|
|
|
'-DNDEBUG',
|
2012-08-05 15:55:03 -04:00
|
|
|
# THIS IS IMPORTANT! Without a "-std=<something>" flag, clang won't know which
|
|
|
|
# language to use when compiling headers. So it will guess. Badly. So C++
|
|
|
|
# headers will be compiled as C headers. You don't want that so ALWAYS specify
|
|
|
|
# a "-std=<something>"
|
|
|
|
'-std=c++11',
|
2012-08-11 22:46:22 -04:00
|
|
|
# ...and the same thing goes for the magic -x option which specifies the
|
|
|
|
# language that the files to be compiled are written in. This is mostly
|
|
|
|
# relevant for c++ headers.
|
|
|
|
'-x',
|
|
|
|
'c++',
|
2012-08-01 23:50:35 -04:00
|
|
|
'-isystem',
|
|
|
|
'../BoostParts',
|
|
|
|
'-isystem',
|
|
|
|
# This path will only work on OS X, but extra paths that don't exist are not
|
|
|
|
# harmful
|
|
|
|
'/System/Library/Frameworks/Python.framework/Headers',
|
|
|
|
'-isystem',
|
|
|
|
'../llvm/include',
|
|
|
|
'-isystem',
|
|
|
|
'../llvm/tools/clang/include',
|
|
|
|
'-I',
|
|
|
|
'.',
|
|
|
|
'-isystem',
|
|
|
|
'./tests/gmock/gtest',
|
|
|
|
'-isystem',
|
|
|
|
'./tests/gmock/gtest/include',
|
|
|
|
'-isystem',
|
|
|
|
'./tests/gmock',
|
|
|
|
'-isystem',
|
|
|
|
'./tests/gmock/include'
|
|
|
|
]
|
|
|
|
|
|
|
|
def DirectoryOfThisScript():
|
|
|
|
return os.path.dirname( os.path.abspath( __file__ ) )
|
|
|
|
|
|
|
|
|
|
|
|
def MakeAbsoluteIfRelativePath( path ):
|
|
|
|
if not path.startswith( '.' ):
|
|
|
|
return path
|
|
|
|
|
|
|
|
full_path = os.path.join( DirectoryOfThisScript(), path )
|
|
|
|
return os.path.normpath( full_path )
|
|
|
|
|
|
|
|
|
|
|
|
def FlagsForFile( filename ):
|
2012-08-03 13:26:11 -04:00
|
|
|
return {
|
|
|
|
'flags': [ MakeAbsoluteIfRelativePath( x ) for x in flags ],
|
|
|
|
'do_cache': True
|
|
|
|
}
|