1. rubenvb
  2. Ambrosia

Commits

rubenvb  committed 17d94a1

Prepare LIBS list parsing.

  • Participants
  • Parent commits 0f0031e
  • Branches master

Comments (0)

Files changed (4)

File libAmbrosia/Include/Ambrosia/enums.h

View file
  • Ignore whitespace
     header,
     header_c,
     header_cxx,
+    library,
+    library_shared,
+    library_static,
     resource,
     Qt_ui,
     Qt_moc,
         case file_type::header_c:
         case file_type::header_cxx:
             return file_type::header;
+        case file_type::library:
+        case file_type::library_shared:
+        case file_type::library_static:
+            return file_type::library;
         default:
             return type;
     }

File libAmbrosia/Include/Ambrosia/nectar_loader.h

View file
  • Ignore whitespace
     bool parse_source_directory_list( const file_type type ); // searches m_source_directory+"/"+m_subdirectory
     bool parse_build_directory( const file_type type );  // will be created on first use
     bool parse_variable_list( string_set &items ); // only adds or removes strings from variables
+    bool parse_library_list( const file_type type ); // parses -l and -L items, and handle interproject dependencies?
     // main target parser
     void parse_target();
     // input validation functions (see Ambrosia wiki for valid input requirements)

File libAmbrosia/Source/Ambrosia/enum_maps.cpp

View file
  • Ignore whitespace
            {"SOURCES_JAVA",    file_type::source_java},
            {"SOURCES_FORTRAN", file_type::source_fortran},
            {"HEADERS",         file_type::header},
+           {"HEADERS_C",       file_type::header_c},
+           {"HEADERS_CXX",     file_type::header_cxx},
+           {"LIBS",            file_type::library},
+           {"LIBS_SHARED",     file_type::library_shared},
+           {"LIBS_STATIC",     file_type::library_static},
            {"RESOURCES",       file_type::resource},
            {"QT_UI",           file_type::Qt_ui},
            {"QT_MOC",          file_type::Qt_moc},
            {file_type::source_java,    "SOURCES_JAVA"},
            {file_type::source_fortran, "SOURCES_FORTRAN"},
            {file_type::header,         "HEADERS"},
+           {file_type::header_c,       "HEADERS_C"},
+           {file_type::header_cxx,     "HEADER_CXX"},
+           {file_type::library,        "LIBS"},
+           {file_type::library_shared, "LIBS_SHARED"},
+           {file_type::library_static, "LIBS_STATIC"},
            {file_type::resource,       "RESOURCES"},
            {file_type::Qt_ui,          "QT_UI"},
            {file_type::Qt_moc,         "QT_MOC"},

File libAmbrosia/Source/Ambrosia/nectar_loader.cpp

View file
  • Ignore whitespace
     return false;
 }
 
+bool nectar_loader::parse_library_list( const file_type type )
+{
+    emit_nectar_error( "Parsing " + map_value(file_type_map_inverse, type) + " list has not yet been implemented." );
+    return false;
+}
+
 void nectar_loader::parse_target()
 {
     const target_type type = p_target->type();
         else
         {
             file_type type;
-            // is it a list of files?
+            // is it a list of files or librar(y director)ies?
             if( map_value(file_type_map, token, type) )
             {
-                debug(5) << "nectar_loader::parse_target::" << token << " file list detected.\n";
-                if( !parse_file_list(type) )
+                debug(5) << "nectar_loader::parse_target::" << token << " list detected.\n";
+                if( get_general_type(type) == file_type::library
+                    && !parse_library_list(type) )
+                {
+                    debug(6) << "nectar_loader::parse_target::Failed parsing file list.\n";
+                    return; // failure, assumes parse_library_list has called emit_error
+                }
+                else if( !parse_file_list(type) )
                 {
                     debug(6) << "nectar_loader::parse_target::Failed parsing file list.\n";
                     return; // failure, assumes parse_file_list has called emit_error
                 }
                 else
                 {
-                    // parse other types of directories
+                    emit_nectar_error( "Parsing of " + token + " not yet implemented." );
                 }
             }
             else