Skip to content
Permalink
Browse files

build: add a --clang option to build Mesh with clang

  • Loading branch information...
bpowers committed Sep 23, 2019
1 parent 773b3f2 commit 3dd51b27c50b797ad52a1ede27dfa8d1b9b748df
Showing with 11 additions and 5 deletions.
  1. +8 −5 configure
  2. +3 −0 support/config.py
@@ -111,14 +111,17 @@ c.append('libs', '-ldl')
c.append('cxxflags', '-std=c++14 -I src')
c.append('cxxflags', '$(CFLAGS)')

# for development work, clang has much, much nicer error messages
# c.prefer('cc', 'clang')
# c.prefer('cxx', 'clang++')
if c.clang:
# for development work, clang has much, much nicer error messages
c.prefer('cc', 'clang')
c.prefer('cxx', 'clang++')

# c.prefer('ar', 'llvm-ar')
# c.prefer('ranlib', 'llvm-ranlib')
c.prefer('ar', 'llvm-ar')
c.prefer('ranlib', 'llvm-ranlib')

if not 'cc' in c.env or c.env['cc'] != 'clang':
c.append('cflags', '-Wa,--noexecstack')
else:
c.append('ldflags', '-fuse-ld=lld')

c.generate()
@@ -79,13 +79,16 @@ def __init__(self):
help='disable meshing')
parser.add_argument('--suffix', action='store_true', default=False,
help='always suffix the mesh binary with randomization + meshing info')
parser.add_argument('--clang', action='store_true', default=False,
help='build with clang')

args = parser.parse_args()

self.debug_build = args.debug
self.gcov_build = args.gcov
self.clangcov_build = args.clangcov
self.optimize_build = args.optimize
self.clang = args.clang

self.pkg_config = 'pkg-config'

0 comments on commit 3dd51b2

Please sign in to comment.
You can’t perform that action at this time.