Branch data Line data Source code
1 : : /****************************************************************************** 2 : : * This file is part of the cvc5 project. 3 : : * 4 : : * Copyright (c) 2009-2026 by the authors listed in the file AUTHORS 5 : : * in the top-level source directory and their institutional affiliations. 6 : : * All rights reserved. See the file COPYING in the top-level source 7 : : * directory for licensing information. 8 : : * **************************************************************************** 9 : : * 10 : : * Interface to a public class that provides compile-time information 11 : : * about the cvc5 library. 12 : : * 13 : : * Eventually, the configuration methods will all be migrated to the 14 : : * cvc5::internal::configuration namespace below. This is cleaner and avoids a 15 : : * gcc/10.1.0 bug. See https://github.com/cvc5/cvc5/pull/7898 for details. 16 : : */ 17 : : 18 : : #include "cvc5_public.h" 19 : : 20 : : #ifndef CVC5__CONFIGURATION_H 21 : : #define CVC5__CONFIGURATION_H 22 : : 23 : : #include <cvc5/cvc5_export.h> 24 : : 25 : : #include <string> 26 : : #include <vector> 27 : : 28 : : namespace cvc5::internal { 29 : : 30 : : namespace configuration { 31 : 4291 : static constexpr bool isStatisticsBuild() 32 : : { 33 : : #ifdef CVC5_STATISTICS_ON 34 : 4291 : return true; 35 : : #else 36 : : return false; 37 : : #endif 38 : : } 39 : : } // namespace configuration 40 : : 41 : : /** 42 : : * Represents the (static) configuration of cvc5. 43 : : */ 44 : : class CVC5_EXPORT Configuration final 45 : : { 46 : : public: 47 : : /** Delete default ctor: Disallow construction of this class. */ 48 : : Configuration() = delete; 49 : : 50 : : private: 51 : : // these constants are filled in by the build system 52 : : static const bool GIT_BUILD; 53 : : static const bool CVC5_IS_RELEASE; 54 : : static const char* const CVC5_VERSION; 55 : : static const char* const CVC5_FULL_VERSION; 56 : : static const char* const CVC5_GIT_INFO; 57 : : 58 : : public: 59 : : static std::string getName(); 60 : : 61 : : static bool isSafeBuild(); 62 : : 63 : : static bool isStableBuild(); 64 : : 65 : : static bool isDebugBuild(); 66 : : 67 : : static bool isTracingBuild(); 68 : : 69 : : static bool isMuzzledBuild(); 70 : : 71 : : static bool isAssertionBuild(); 72 : : 73 : : static bool isCoverageBuild(); 74 : : 75 : : static bool isProfilingBuild(); 76 : : 77 : : static bool isAsanBuild(); 78 : : 79 : : static bool isUbsanBuild(); 80 : : 81 : : static bool isTsanBuild(); 82 : : 83 : : static bool isCompetitionBuild(); 84 : : 85 : : static bool isStaticBuild(); 86 : : 87 : : static std::string getPackageName(); 88 : : 89 : : static std::string getVersionString(); 90 : : 91 : : static std::string copyright(); 92 : : 93 : : static std::string about(); 94 : : 95 : : static std::string aboutAndCopyright(); 96 : : 97 : : static bool licenseIsGpl(); 98 : : 99 : : static bool isBuiltWithGmp(); 100 : : 101 : : static bool isBuiltWithCln(); 102 : : 103 : : static bool isBuiltWithGlpk(); 104 : : 105 : : static bool isBuiltWithCryptominisat(); 106 : : 107 : : static bool isBuiltWithKissat(); 108 : : 109 : : static bool isBuiltWithEditline(); 110 : : 111 : : static bool isBuiltWithPoly(); 112 : : 113 : : static bool isBuiltWithCoCoA(); 114 : : 115 : : static bool isBuiltWithPortfolio(); 116 : : 117 : : /* Return a sorted array of the trace tags name */ 118 : : static const std::vector<std::string>& getTraceTags(); 119 : : /* Test if the given argument is a known trace tag name */ 120 : : static bool isTraceTag(const std::string& tag); 121 : : 122 : : static bool isGitBuild(); 123 : : static std::string getGitInfo(); 124 : : 125 : : static std::string getCompiler(); 126 : : static std::string getCompiledDateTime(); 127 : : 128 : : }; /* class Configuration */ 129 : : 130 : : } // namespace cvc5::internal 131 : : 132 : : #endif /* CVC5__CONFIGURATION_H */