Skip to content

Commit

Permalink
[SCons] Eliminate CT_HAS_PYTHON define from config.h
Browse files Browse the repository at this point in the history
This speeds up some incremental builds when switching between configurations
with and without the Python module, as done during Conda packaging.
  • Loading branch information
speth authored and ischoegl committed Jun 27, 2023
1 parent d717e8b commit f97402b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion SConstruct
Expand Up @@ -2135,7 +2135,6 @@ cdefine("CT_USE_SYSTEM_EIGEN", "system_eigen")
cdefine("CT_USE_SYSTEM_EIGEN_PREFIXED", "system_eigen_prefixed")
cdefine('CT_USE_SYSTEM_FMT', 'system_fmt')
cdefine('CT_USE_SYSTEM_YAMLCPP', 'system_yamlcpp')
cdefine('CT_HAS_PYTHON', 'python_package', 'full')

config_h_build = env.Command('build/src/config.h.build',
'include/cantera/base/config.h.in',
Expand Down
1 change: 0 additions & 1 deletion include/cantera/base/config.h.in
Expand Up @@ -45,7 +45,6 @@ typedef int ftnlen; // Fortran hidden string length type
{CT_USE_SYSTEM_EIGEN_PREFIXED!s}
{CT_USE_SYSTEM_FMT!s}
{CT_USE_SYSTEM_YAMLCPP!s}
{CT_HAS_PYTHON!s}

//-------------- Optional Cantera Capabilities ----------------------

Expand Down
3 changes: 3 additions & 0 deletions test/SConscript
Expand Up @@ -15,6 +15,9 @@ localenv.Prepend(CPPPATH=['#include'],
localenv.Append(LIBS=localenv['cantera_shared_libs'],
CCFLAGS=env['warning_flags'])

if env['python_package'] != 'full':
localenv.Append(CPPDEFINES={'CT_SKIP_PYTHON': '1'})

if env['googletest'] == 'submodule':
localenv.Prepend(CPPPATH=['#ext/googletest/googletest/include',
'#ext/googletest/googlemock/include'])
Expand Down
2 changes: 1 addition & 1 deletion test/kinetics/kineticsFromYaml.cpp
Expand Up @@ -533,7 +533,7 @@ TEST(Reaction, TwoTempPlasmaFromYaml)

TEST(Reaction, PythonExtensibleRate)
{
#ifndef CT_HAS_PYTHON
#ifdef CT_SKIP_PYTHON // Possibly set via test/SConscript
GTEST_SKIP();
#endif
auto sol = newSolution("extensible-reactions.yaml");
Expand Down

0 comments on commit f97402b

Please sign in to comment.