NO

Author Topic: Exclude from build & Header files  (Read 6832 times)

Rainbow Sally

  • Guest
Exclude from build & Header files
« on: December 31, 2004, 05:49:05 PM »
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: [Select]


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




The (partially) corrected PPJ looks like this.

Code: [Select]


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



[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: [Select]

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

typedef struct _WND_OBJ
{
#include "WND_OBJ.H"

}WND_OBJ;



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.

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Exclude from build & Header files
« Reply #1 on: December 31, 2004, 06:40:30 PM »
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
/Pelle

Rainbow Sally

  • Guest
Exclude from build & Header files
« Reply #2 on: January 01, 2005, 11:44:48 AM »
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


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: [Select]

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



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.

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Exclude from build & Header files
« Reply #3 on: January 01, 2005, 07:36:32 PM »
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.

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.

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

Pelle
/Pelle

Anonymous

  • Guest
Exclude from build & Header files
« Reply #4 on: January 02, 2005, 05:24:12 AM »
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.


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...