Merge pull request #45 from tboudreaux/feature/pythonInterface/composition

Python Interface for composition module
This commit is contained in:
2025-04-30 11:57:23 -04:00
committed by GitHub
3 changed files with 11 additions and 5 deletions

View File

@@ -1,10 +1,11 @@
yaml_cpp_cmake_options = cmake.subproject_options()
yaml_cpp_cmake_options.add_cmake_defines({
'CMAKE_POLICY_VERSION_MINIMUM': '3.5'
'CMAKE_POLICY_VERSION_MINIMUM': '3.5',
'BUILD_SHARED_LIBS': 'ON',
'CMAKE_SKIP_INSTALL_RULES': 'ON'
})
yaml_cpp_sp = cmake.subproject(
'yaml-cpp',
options: yaml_cpp_cmake_options,
)
yaml_cpp_dep = yaml_cpp_sp.dependency('yaml-cpp')
add_project_arguments('-I' + meson.current_build_dir() + '/subprojects/yaml-cpp/__CMake_build', language: 'cpp')

View File

@@ -8,7 +8,7 @@ config_headers = files(
)
# Define the libconfig library so it can be linked against by other parts of the build system
libconfig = static_library('config',
libconfig = library('config',
config_sources,
include_directories: include_directories('public'),
cpp_args: ['-fvisibility=default'],

View File

@@ -156,7 +156,12 @@ public:
template <typename T>
T get(const std::string &key, T defaultValue) {
if (!m_loaded) {
throw std::runtime_error("Error! Config file not loaded");
// ONLY THROW ERROR IF HARSH OR WARN CONFIGURATION
#if defined(CONFIG_HARSH)
throw std::runtime_error("Error! Config file not loaded. To disable this error, recompile with CONFIG_HARSH=0");
#elif defined(CONFIG_WARN)
std::cerr << "Warning! Config file not loaded. This instance of 4DSSE was compiled with CONFIG_WARN so the code will continue using only default values" << std::endl;
#endif
}
// --- Check if the key has already been checked for existence
if (std::find(unknownKeys.begin(), unknownKeys.end(), key) != unknownKeys.end()) {