Browse Source

Fixed 'boost/optional.hpp file not found' error in storm-version library (simply by not using boost).

tempestpy_adaptions
TimQu 4 years ago
parent
commit
1343ae5c19
  1. 6
      CMakeLists.txt
  2. 2
      src/storm-version-info/storm-version.cpp.in
  3. 24
      src/storm-version-info/storm-version.h

6
CMakeLists.txt

@ -439,15 +439,15 @@ set(STORM_VERSION_APPENDIX "${CMAKE_MATCH_5}") # might be empty
if (STORM_GIT_VERSION_STRING MATCHES "NOTFOUND")
set(STORM_VERSION_SOURCE "VersionSource::Static")
set(STORM_VERSION_COMMITS_AHEAD 0)
set(STORM_VERSION_DIRTY boost::none)
set(STORM_VERSION_DIRTY DirtyState:Unknown)
include(version.cmake)
message(WARNING "Storm - Git version information not available, statically assuming version ${STORM_VERSION_MAJOR}.${STORM_VERSION_MINOR}.${STORM_VERSION_PATCH}.")
else()
set(STORM_VERSION_SOURCE "VersionSource::Git")
if ("${STORM_VERSION_APPENDIX}" MATCHES "^.*dirty.*$")
set(STORM_VERSION_DIRTY "true")
set(STORM_VERSION_DIRTY "DirtyState::Dirty")
else()
set(STORM_VERSION_DIRTY "false")
set(STORM_VERSION_DIRTY "DirtyState::Clean")
endif()
endif()

2
src/storm-version-info/storm-version.cpp.in

@ -11,7 +11,7 @@ namespace storm {
const StormVersion::VersionSource StormVersion::versionSource = @STORM_VERSION_SOURCE@;
const std::string StormVersion::gitRevisionHash = "@STORM_VERSION_GIT_HASH@";
const unsigned StormVersion::commitsAhead = @STORM_VERSION_COMMITS_AHEAD@;
const boost::optional<bool> StormVersion::dirty = @STORM_VERSION_DIRTY@;
const StormVersion::DirtyState StormVersion::dirty = @STORM_VERSION_DIRTY@;
const std::string StormVersion::systemName = "@CMAKE_SYSTEM_NAME@";
const std::string StormVersion::systemVersion = "@CMAKE_SYSTEM_VERSION@";
const std::string StormVersion::cxxCompiler = "@STORM_COMPILER_ID@ @CMAKE_CXX_COMPILER_VERSION@";

24
src/storm-version-info/storm-version.h

@ -3,8 +3,6 @@
#include <string>
#include <sstream>
#include <boost/optional.hpp>
namespace storm {
struct StormVersion {
@ -36,8 +34,14 @@ namespace storm {
/// How many commits passed since the tag was last set.
const static unsigned commitsAhead;
/// 0 iff there no files were modified in the checkout, 1 otherwise. If none, no information about dirtyness is given.
const static boost::optional<bool> dirty;
enum class DirtyState {
Clean, /// no files were modified in the checkout
Dirty, /// some files were modified
Unknown /// No information about dirtyness is given.
};
/// Indicates whether files were modified
const static DirtyState dirty;
/// The system which has compiled Storm.
const static std::string systemName;
@ -77,14 +81,10 @@ namespace storm {
} else {
sstream << " built from archive";
}
if (dirty) {
if (dirty.get()) {
sstream << " (dirty)";
} else {
sstream << " (clean)";
}
} else {
sstream << " (potentially dirty)";
switch (dirty) {
case DirtyState::Clean: sstream << " (clean)"; break;
case DirtyState::Dirty: sstream << " (dirty)"; break;
default: sstream << " (potentially dirty)"; break;
}
return sstream.str();
}

Loading…
Cancel
Save