1 /*! 2 * \file mfront/include/MFront/GeneratorOptions.hxx 3 * \brief 4 * \author Thomas Helfer 5 * \date 16 août 2015 6 * \copyright Copyright (C) 2006-2018 CEA/DEN, EDF R&D. All rights 7 * reserved. 8 * This project is publicly released under either the GNU GPL Licence 9 * or the CECILL-A licence. A copy of thoses licences are delivered 10 * with the sources of TFEL. CEA or EDF may also distribute this 11 * project under specific licensing conditions. 12 */ 13 14 #ifndef LIB_MFRONT_GENERATOROPTIONS_HXX 15 #define LIB_MFRONT_GENERATOROPTIONS_HXX 16 17 #include<string> 18 #include"MFront/MFrontConfig.hxx" 19 20 namespace mfront{ 21 22 /*! 23 * a data structure holding options passed to generators 24 */ 25 struct MFRONT_VISIBILITY_EXPORT GeneratorOptions{ 26 /*! 27 * \brief a simple enumeration describing the optimisation level. 28 * \note See the `tfel-config` utility for more details 29 */ 30 enum OptimisationLevel{ 31 LEVEL0, //!< no architecture specific optimisations (i.e. no 32 // `-march=native` under gcc). The options used are 33 // the ones returned by `tfel-config --oflags0`. 34 LEVEL1, //!< standard optimisation level. The options used are 35 // the ones returned by `tfel-config --oflags`. 36 LEVEL2 //!< add potentially unsafe math optmisations. The 37 // options used are the ones returned by 38 // `tfel-config --oflags --oflags2`. 39 }; 40 //! \brief default constructor 41 GeneratorOptions(); 42 /*! 43 * \brief copy constructor 44 * \param[in] src: source 45 */ 46 GeneratorOptions(const GeneratorOptions&); 47 /*! 48 * \brief move constructor 49 * \param[in] src: source 50 */ 51 GeneratorOptions(GeneratorOptions&&); 52 /*! 53 * \brief copy assignement 54 * \param[in] src: source 55 */ 56 GeneratorOptions& operator=(const GeneratorOptions&); 57 /*! 58 * \brief move assignement 59 * \param[in] src: source 60 */ 61 GeneratorOptions& operator =(GeneratorOptions&&); 62 //! \brief destructor 63 ~GeneratorOptions(); 64 //! targeted operating system 65 #if ((defined(_WIN32)||defined(_WIN64)) && (!defined (__CYGWIN__))) 66 std::string sys = "win32"; 67 #elif defined __CYGWIN__ 68 std::string sys = "cygwin"; 69 #elif defined __APPLE__ 70 std::string sys = "apple"; 71 #else 72 std::string sys = "default"; 73 #endif /* __CYGWIN__ */ 74 //! \brief optimisation level 75 OptimisationLevel olevel = LEVEL1; 76 /*! 77 * \brief boolean stating that no output regarding the compilation 78 * commands shall be displayed. 79 */ 80 bool silentBuild = true; 81 #if (defined _WIN32 || defined _WIN64 ||defined __CYGWIN__) 82 bool nodeps = true; 83 #else /* (defined _WIN32 || defined _WIN64 ||defined __CYGWIN__) */ 84 bool nodeps = false; 85 #endif /* (defined _WIN32 || defined _WIN64 ||defined __CYGWIN__) */ 86 bool melt = true; 87 }; // end of struct GeneratorOptions 88 89 } // end of namespace mfront 90 91 #endif /* LIB_MFRONT_GENERATOROPTIONS_HXX */ 92