Merge remote-tracking branch 'upstream/main' into feature/mixedPolytrope
# Conflicts: # .gitignore # build-config/meson.build # meson.build # meson_options.txt # src/composition/public/composition.h # src/config/public/config.h # src/constants/public/const.h # src/meson.build # tests/composition_sandbox/comp.cpp
This commit is contained in:
@@ -1,10 +1,11 @@
|
|||||||
yaml_cpp_cmake_options = cmake.subproject_options()
|
yaml_cpp_cmake_options = cmake.subproject_options()
|
||||||
yaml_cpp_cmake_options.add_cmake_defines({
|
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_sp = cmake.subproject(
|
||||||
'yaml-cpp',
|
'yaml-cpp',
|
||||||
options: yaml_cpp_cmake_options,
|
options: yaml_cpp_cmake_options,
|
||||||
)
|
)
|
||||||
yaml_cpp_dep = yaml_cpp_sp.dependency('yaml-cpp')
|
yaml_cpp_dep = yaml_cpp_sp.dependency('yaml-cpp')
|
||||||
add_project_arguments('-I' + meson.current_build_dir() + '/subprojects/yaml-cpp/__CMake_build', language: 'cpp')
|
|
||||||
@@ -8,7 +8,7 @@ config_headers = files(
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Define the libconfig library so it can be linked against by other parts of the build system
|
# 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,
|
config_sources,
|
||||||
include_directories: include_directories('public'),
|
include_directories: include_directories('public'),
|
||||||
cpp_args: ['-fvisibility=default'],
|
cpp_args: ['-fvisibility=default'],
|
||||||
|
|||||||
@@ -18,8 +18,7 @@
|
|||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// *********************************************************************** */
|
// *********************************************************************** */
|
||||||
#ifndef CONFIG_H
|
#pragma once
|
||||||
#define CONFIG_H
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@@ -28,7 +27,6 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <stdexcept>
|
|
||||||
|
|
||||||
// Required for YAML parsing
|
// Required for YAML parsing
|
||||||
#include "yaml-cpp/yaml.h"
|
#include "yaml-cpp/yaml.h"
|
||||||
@@ -162,7 +160,12 @@ public:
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
T get(const std::string &key, T defaultValue) {
|
T get(const std::string &key, T defaultValue) {
|
||||||
if (!m_loaded) {
|
if (!m_loaded) {
|
||||||
throw std::runtime_error("Configuration file not loaded! This should be done at the very start of whatever main function you are using (and only done once!)");
|
// 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
|
// --- Check if the key has already been checked for existence
|
||||||
if (std::find(unknownKeys.begin(), unknownKeys.end(), key) != unknownKeys.end()) {
|
if (std::find(unknownKeys.begin(), unknownKeys.end(), key) != unknownKeys.end()) {
|
||||||
@@ -241,5 +244,3 @@ public:
|
|||||||
|
|
||||||
} // namespace config
|
} // namespace config
|
||||||
} // namespace serif
|
} // namespace serif
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
Reference in New Issue
Block a user