Pelles C > Feature requests

Exclude from build & Header files

(1/1)

Rainbow Sally:
I'd like to see a feature to allow manualy selecting header files.  If the file has a ".h" extension it should go under the header files branch of the treeview.  It should not be included in a compile unless the user specifies this explicitly.

Also, when a user does this it should remove that same header from any other places it may appear in the PPJ file.

Let me show you what I mean.

This is wrong and triggers an error "empty source file...":


--- Code: ---

#
# Build oop1.OBJ.
#
"$(POC_PROJECT_PATH)\output\oop1.OBJ": \
  "$(POC_PROJECT_PATH)\oop1.c" \
  "$(POC_PROJECT_PATH)\oop1_res.h"  
  $(CC) $(CCFLAGS) "$!" -Fo"$@"


--- End code ---



The (partially) corrected PPJ looks like this.


--- Code: ---

#
# Build oop1.OBJ.
#
"$(POC_PROJECT_PATH)\output\oop1.OBJ": \
  "$(POC_PROJECT_PATH)\oop1.c"
  $(CC) $(CCFLAGS) "$!" -Fo"$@"


--- End code ---


[removed backslash and ref to .h file

I say this is only partially corrected because that H file should still be in the project if I want to zip it or something and I don't know where to edit that yet.  :-)

Also, in the following case an H file is used to load up a struct field declaration.  The same H file can also load other H files, thus creating a compile-time linkage.  This technique be used to do other things as well, but suffice it to say "it's legal" and should be accommodated if possible, in my opinion. :-)


--- Code: ---
// H-3 load struct fields from *_OBJ.H

typedef struct _WND_OBJ
{
#include "WND_OBJ.H"

}WND_OBJ;


--- End code ---


The simplest way to accommodate it would be to have another menu selection (in addition to add source file) that would allow addition of a header file.

I know you have another version almost ready to fly.  Hope this is do-able and in time for inclusion.

Thank you Pelle!!  

Either way, thank you, thank you, thank you.

I love this C and IDE.

Pelle:
I think the current method is OK - automatic scanning of source files for any #include files. The only "problem" right now is that you sometimes have to help the IDE by using the command "Update all dependencies" - to re-scan the source files.

Pelle

Rainbow Sally:

--- Quote from: "Pelle" ---I think the current method is OK - automatic scanning of source files for any #include files. The only "problem" right now is that you sometimes have to help the IDE by using the command "Update all dependencies" - to re-scan the source files.

Pelle
--- End quote ---


I found one of my problems.  It won't list files in <pointy braces>.  It will only find them if they are in quotes.

I can't use quotes when I'm simulating an include folder under "\." though, so I guess I'll have to live with it in those cases.

There appears to be an issue with #includes inside of struct typedefs though, even with the quotes.  zzz_fields.h will load, the program will work perfectly, but zzz_fields.h won't get listed in the header files list.


--- Code: ---
typedef struct _ZZZ
{
   #include "zzz_fields.h"
}ZZZ;


--- End code ---


This is very useful for compile-time inheritance linkage.  zzz_fields.h includes yyy_fields.h, and so on - and on.

Since this concept is probably also "on the fringe", so to speak, I won't bug you about it.

But... it would be nice if the parser could find these includes too.  ;-)  

Every user built (i.e., non-lib) class in the OOPz system would be included in quotes.

Pelle:

--- Quote from: "Rainbow Sally" ---I found one of my problems.  It won't list files in <pointy braces>.  It will only find them if they are in quotes.
--- End quote ---

Yes - I assume that #include <...> is only used for standard include files (like string.h, windows.h ...), and #include "..." is used for the more "private" files, that you want to put in the project file.


--- Quote from: "Rainbow Sally" ---
There appears to be an issue with #includes inside of struct typedefs though, even with the quotes.  zzz_fields.h will load, the program will work perfectly, but zzz_fields.h won't get listed in the header files list.

--- End quote ---

Can't see why it shouldn't work - will look at it.

Pelle

Anonymous:

--- Quote from: "Pelle" ---Yes - I assume that #include <...> is only used for standard include files (like string.h, windows.h ...), and #include "..." is used for the more "private" files, that you want to put in the project file.

--- End quote ---


Actually, I've had good success with creating private LIB and INCLUDE directories in my own workspace (f:\mycode\lib , f:\mycode\inc) and adding them to the list in your IDE setup window.  I can include my own private and third party libs using the bracketed (not the quoted) syntax.  The quoted form only seems to work for the current directory or where a directory is explicitly specified.

Pretty cool if you ask me...

Navigation

[0] Message Index

Go to full version