diff --git a/CMakeLists.txt b/CMakeLists.txt index 36e9c1ee520baf6d0a0f892c5aabadddc9ce1166..fd6a239f3a1c0ef3581f151dbaf5e086e73341be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,13 +10,11 @@ PROJECT(athena ) set(CMAKE_CXX_STANDARD 17) -find_package( DD4hep REQUIRED COMPONENTS DDCore DDG4) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") +find_package(DD4hep REQUIRED COMPONENTS DDCore DDG4) find_package(Acts REQUIRED COMPONENTS Core PluginIdentification PluginTGeo PluginDD4hep ) - -find_package(fmt) -#find_library(FMT_LIBRARY fmt) - +find_package(fmt REQUIRED) #----------------------------------------------------------------------------------- set(a_lib_name athena) diff --git a/src/FileLoader.cpp b/src/FileLoader.cpp index d0d60872b9b206ab620e3adbaaf79461cdb079c1..25a5c7e5d019a381b5831958b979edf18927e980 100644 --- a/src/FileLoader.cpp +++ b/src/FileLoader.cpp @@ -68,9 +68,9 @@ long load_file( "_", pos + 1); if (after == std::string::npos) after = cache.size(); // cache ends on env var - auto env_name = cache.substr(pos + 1, after - pos - 1); - auto env_value = std::getenv(env_name.c_str()); - if (env_value == nullptr) env_value = ""; + const std::string env_name(cache.substr(pos + 1, after - pos - 1)); + auto env_ptr = std::getenv(env_name.c_str()); + const std::string env_value(env_ptr != nullptr ? env_ptr : ""); cache.erase(pos, after - pos); cache.insert(pos, env_value); printout(INFO, "FileLoader", "$" + env_name + " -> " + env_value);