fix(unity): fixed name conflict in unity builds
getSpecies was defined in two translation units. This was not an issue for regular builds but broke unity builds. this has been refactored to a single function in utils.h
This commit is contained in:
2
Doxyfile
2
Doxyfile
@@ -48,7 +48,7 @@ PROJECT_NAME = fourdst::libcomposition
|
|||||||
# could be handy for archiving the generated documentation or if some version
|
# could be handy for archiving the generated documentation or if some version
|
||||||
# control system is used.
|
# control system is used.
|
||||||
|
|
||||||
PROJECT_NUMBER = v2.2.1
|
PROJECT_NUMBER = v2.2.2
|
||||||
|
|
||||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||||
# for a project that appears at the top of each page and should give viewers a
|
# for a project that appears at the top of each page and should give viewers a
|
||||||
|
|||||||
@@ -18,7 +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
|
||||||
#
|
#
|
||||||
# *********************************************************************** #
|
# *********************************************************************** #
|
||||||
project('libcomposition', 'cpp', version: 'v2.2.1', default_options: ['cpp_std=c++23'], meson_version: '>=1.5.0')
|
project('libcomposition', 'cpp', version: 'v2.2.2', default_options: ['cpp_std=c++23'], meson_version: '>=1.5.0')
|
||||||
|
|
||||||
# Add default visibility for all C++ targets
|
# Add default visibility for all C++ targets
|
||||||
add_project_arguments('-fvisibility=default', language: 'cpp')
|
add_project_arguments('-fvisibility=default', language: 'cpp')
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
#include "fourdst/atomic/atomicSpecies.h"
|
#include "fourdst/atomic/atomicSpecies.h"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <optional>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
namespace fourdst::composition {
|
namespace fourdst::composition {
|
||||||
/**
|
/**
|
||||||
@@ -87,4 +89,6 @@ namespace fourdst::composition {
|
|||||||
Composition buildCompositionFromMassFractions(
|
Composition buildCompositionFromMassFractions(
|
||||||
std::map<std::string, double> massFractions
|
std::map<std::string, double> massFractions
|
||||||
);
|
);
|
||||||
|
|
||||||
|
std::optional<fourdst::atomic::Species> getSpecies(const std::string& symbol);
|
||||||
}
|
}
|
||||||
@@ -34,6 +34,7 @@
|
|||||||
#include "fourdst/atomic/atomicSpecies.h"
|
#include "fourdst/atomic/atomicSpecies.h"
|
||||||
#include "fourdst/atomic/species.h"
|
#include "fourdst/atomic/species.h"
|
||||||
#include "fourdst/composition/composition.h"
|
#include "fourdst/composition/composition.h"
|
||||||
|
#include "fourdst/composition/utils.h"
|
||||||
|
|
||||||
#include "fourdst/composition/exceptions/exceptions_composition.h"
|
#include "fourdst/composition/exceptions/exceptions_composition.h"
|
||||||
|
|
||||||
@@ -62,13 +63,6 @@ namespace {
|
|||||||
return sorted;
|
return sorted;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::optional<fourdst::atomic::Species> getSpecies(const std::string& symbol) {
|
|
||||||
if (!fourdst::atomic::species.contains(symbol)) {
|
|
||||||
return std::nullopt;
|
|
||||||
}
|
|
||||||
return fourdst::atomic::species.at(symbol);
|
|
||||||
}
|
|
||||||
|
|
||||||
void throw_unknown_symbol(quill::Logger* logger, const std::string& symbol) {
|
void throw_unknown_symbol(quill::Logger* logger, const std::string& symbol) {
|
||||||
LOG_ERROR(logger, "Symbol {} is not a valid species symbol (not in the species database)", symbol);
|
LOG_ERROR(logger, "Symbol {} is not a valid species symbol (not in the species database)", symbol);
|
||||||
throw fourdst::composition::exceptions::UnknownSymbolError("Symbol " + symbol + " is not a valid species symbol (not in the species database)");
|
throw fourdst::composition::exceptions::UnknownSymbolError("Symbol " + symbol + " is not a valid species symbol (not in the species database)");
|
||||||
|
|||||||
@@ -14,13 +14,6 @@
|
|||||||
#include "quill/LogMacros.h"
|
#include "quill/LogMacros.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
std::optional<fourdst::atomic::Species> getSpecies(const std::string& symbol) {
|
|
||||||
if (!fourdst::atomic::species.contains(symbol)) {
|
|
||||||
return std::nullopt;
|
|
||||||
}
|
|
||||||
return fourdst::atomic::species.at(symbol);
|
|
||||||
}
|
|
||||||
|
|
||||||
quill::Logger* getLogger() {
|
quill::Logger* getLogger() {
|
||||||
static quill::Logger* logger = fourdst::logging::LogManager::getInstance().getLogger("log");
|
static quill::Logger* logger = fourdst::logging::LogManager::getInstance().getLogger("log");
|
||||||
return logger;
|
return logger;
|
||||||
@@ -193,4 +186,11 @@ namespace fourdst::composition {
|
|||||||
return buildCompositionFromMassFractions(species, massFractionVector);
|
return buildCompositionFromMassFractions(species, massFractionVector);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::optional<fourdst::atomic::Species> getSpecies(const std::string& symbol) {
|
||||||
|
if (!fourdst::atomic::species.contains(symbol)) {
|
||||||
|
return std::nullopt;
|
||||||
|
}
|
||||||
|
return fourdst::atomic::species.at(symbol);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user