From 9a5c2708e5278162e12b44e393c800c75461c175 Mon Sep 17 00:00:00 2001 From: "Bryan W. Weber" Date: Wed, 12 Jun 2019 12:30:49 -0400 Subject: [PATCH] Replace the compiler variables during conda build The build compilers should not be specified into the sample templates --- samples/cxx/SConscript | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/samples/cxx/SConscript b/samples/cxx/SConscript index 7265787e1..0717d85fa 100644 --- a/samples/cxx/SConscript +++ b/samples/cxx/SConscript @@ -74,6 +74,13 @@ set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}) env_args.append('MSVC_VERSION={0!r}'.format(localenv['MSVC_VERSION'])) localenv['tmpl_env_args'] = ', '.join(env_args) + # If this is a conda build on macOS, we do not want to specify the conda + # compilers from the build environment, because those won't be installed + # on the user's system. + if env['OS'] == 'Darwin' and os.environ.get('CONDA_BUILD', False): + localenv['CXX'] = 'clang++' + localenv['CC'] = 'clang' + sconstruct = localenv.SubstFile(pjoin(subdir, 'SConstruct'), 'SConstruct.in') install(pjoin('$inst_sampledir', 'cxx', subdir), sconstruct)