Commit 3ae00976 authored by Stephan Lachnit's avatar Stephan Lachnit
Browse files

Merge branch 'b-macventura' into 'v3.0-stable'

[v3.0-stable] Update for mac user

See merge request allpix-squared/allpix-squared!1022
parents bf870a62 4c43d38e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ The following authors, in alphabetical order, have developed or contributed to A
* Manuel Alejandro Del Rio Viera, DESY, [mdelriov](https://gitlab.cern.ch/mdelriov)
* Katharina Dort, University of Gießen, [kdort](https://gitlab.cern.ch/kdort)
* Neal Gauvin, Université de Genève, [ngauvin](https://gitlab.cern.ch/ngauvin)
* Yajun He, DESY, [yajun](https://gitlab.cern.ch/yajun)
* Lennart Huth, DESY, [lhuth](https://gitlab.cern.ch/lhuth)
* Daniel Hynds, University of Oxford, [dhynds](https://gitlab.cern.ch/dhynds)
* Francisco-Jose Iguaz-Gutierrez, Synchrotron SOLEIL, [iguaz-gutierrez](https://github.com/iguaz-gutierrez)
+13 −4
Original line number Diff line number Diff line
@@ -81,11 +81,20 @@ Module::createOutputFile(const std::string& pathname, const std::string& extensi

        // Check if the requested path is an absolute path and issue a warning:
        std::filesystem::path path = pathname;
        if(path.is_absolute() && std::search(path.begin(), path.end(), file.begin(), file.end()) == path.end()) {
        if(path.is_absolute()) {
#ifdef __APPLE__ // Fix compiling error caused by Xcode iterator legacy
            auto path_it_v = std::vector<std::string>(path.begin(), path.end());
            auto file_it_v = std::vector<std::string>(file.begin(), file.end());
            const auto is_outside =
                std::search(path_it_v.begin(), path_it_v.end(), file_it_v.begin(), file_it_v.end()) == path_it_v.end();
#else
            const auto is_outside = std::search(path.begin(), path.end(), file.begin(), file.end()) == path.end();
#endif
            if(is_outside) {
                LOG(WARNING) << "Storing file at requested absolute location " << path
                             << " - this is outside the module output folder";
            }

        }
        // Add the file itself - this fully replaces the "file" path in case "path" is absolute:
        file /= (extension.empty() ? path : path.replace_extension(extension));