Skip to content

Commit

Permalink
fixing build script (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
masinag authored Oct 2, 2023
1 parent 292bc8a commit 184120d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build-and-run-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def main(args):

source_path = os.path.abspath('.')

if not Options.binder: Options.binder = build.install_llvm_tool('binder', source_path+'/source', source_path + '/build', Options.binder_debug, jobs=Options.jobs, gcc_install_prefix=Options.gcc_install_prefix)
if not Options.binder: Options.binder = build.install_llvm_tool('binder', source_path+'/source', source_path + '/build', Options.binder_debug, jobs=Options.jobs, gcc_install_prefix=Options.gcc_install_prefix, compiler=Options.compiler)

if not Options.pybind11: Options.pybind11 = build.install_pybind11(source_path + '/build')

Expand Down
8 changes: 4 additions & 4 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ def get_compiler_family():
return 'unknown'


def get_cmake_compiler_options():
def get_cmake_compiler_options(compiler):
''' Get cmake compiler flags from Options.compiler '''
if Platform == "linux" and Options.compiler == 'clang': return ' -DCMAKE_C_COMPILER=`which clang` -DCMAKE_CXX_COMPILER=`which clang++`'
if Platform == "linux" and Options.compiler == 'gcc': return ' -DCMAKE_C_COMPILER=`which gcc` -DCMAKE_CXX_COMPILER=`which g++`'
if Platform == "linux" and compiler == 'clang': return ' -DCMAKE_C_COMPILER=`which clang` -DCMAKE_CXX_COMPILER=`which clang++`'
if Platform == "linux" and compiler == 'gcc': return ' -DCMAKE_C_COMPILER=`which gcc` -DCMAKE_CXX_COMPILER=`which g++`'

return ''

Expand Down Expand Up @@ -175,7 +175,7 @@ def install_llvm_tool(name, source_location, prefix_root, debug, compiler, jobs,
with open(cmake_lists, 'w') as f: f.write(tool_build_line + '\n')

config = '-DCMAKE_BUILD_TYPE={build_type}'.format(build_type='Debug' if debug else 'Release')
config += get_cmake_compiler_options()
config += get_cmake_compiler_options(compiler)

if not os.path.isdir(build_dir): os.makedirs(build_dir)
execute(
Expand Down

0 comments on commit 184120d

Please sign in to comment.