|
|
Home » U++ TheIDE » U++ TheIDE: Other Features Wishlist and/or Bugs » [PROPOSAL] A couple of changes in "import.ext"
[PROPOSAL] A couple of changes in "import.ext" [message #56920] |
Fri, 30 April 2021 14:02 |
mdelfede
Messages: 1307 Registered: September 2007
|
Ultimate Contributor |
|
|
Importing a large library with "import.ext" I got a couple of probmems:
1) Some files need to be excluded / included depending on platform.
A nice way would be something like
files(PLATFORM_POSIX)
files.cpp
dir1/*.cpp
;
exclude(PLATFORM_WIN32)
an_unix_file.cpp
;
2) A big problem is that object files are put ALL in ONE folder. If the library
has something like this:
dir1/MyNiceModule.cpp
dir2/MyNiceModule.cpp
build will fail because second MyNiceModule.o is placed in same output folder and overwrites first one.
The solution could be to put .o files in subfolder or add a prefix like dir1_MyNiceModule.o.
Ciao
Massimo
|
|
|
|
Re: [PROPOSAL] A couple of changes in "import.ext" [message #56943 is a reply to message #56935] |
Sun, 02 May 2021 18:40 |
mdelfede
Messages: 1307 Registered: September 2007
|
Ultimate Contributor |
|
|
For point 1 I can try it... just a question : the directives in import.ext are processed sequentially ?
I mean :
files somefolder/*.cpp;
exclude somefolder/platforms/*;
files somefolder/platforms/posix/*.cpp;
will pull in all somefolder cpp files, excluding somefolder/plaforms folders but including somefolder/plaforms/posix folders ?
For point 2, I see it more difficult without tampering with all build system.
[Updated on: Sun, 02 May 2021 18:41] Report message to a moderator
|
|
|
|
|
Re: [PROPOSAL] A couple of changes in "import.ext" [message #56957 is a reply to message #56946] |
Tue, 04 May 2021 01:30 |
mdelfede
Messages: 1307 Registered: September 2007
|
Ultimate Contributor |
|
|
mirek wrote on Mon, 03 May 2021 08:45
Yes. I gave you a pointer to the code, did not I?
Yep, and the part 1 is almost done. I just need to know which flags are available at build time and how to read them... if you
can point me in the right direction you'll spare me some time.
By now I added an optional (flags) part, where 'flags' can be any expression, for example:
TRUE
true
1
FALSE
false
0
!flag && (flag1 || flag2)
!flag && flag1 || flag2
with ! (or ~) is the negation, && is AND, || is OR, precedence is UNARY > && > ||.
For example:
Behaves as usual.
files(flagPosix && !flagSomething) mypath/*.cpp;
fetches the files only if flagPosix is true and flagSomething is false.
This applies also to other items (include, exclude, etc).
Just need to evaluate the flag(s) and it's complete.
Ciao
Max
[Updated on: Tue, 04 May 2021 01:31] Report message to a moderator
|
|
|
Re: [PROPOSAL] A couple of changes in "import.ext" [message #56959 is a reply to message #56957] |
Tue, 04 May 2021 07:50 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
mdelfede wrote on Tue, 04 May 2021 01:30mirek wrote on Mon, 03 May 2021 08:45
Yes. I gave you a pointer to the code, did not I?
Yep, and the part 1 is almost done. I just need to know which flags are available at build time and how to read them... if you
can point me in the right direction you'll spare me some time.
By now I added an optional (flags) part, where 'flags' can be any expression, for example:
TRUE
true
1
FALSE
false
0
!flag && (flag1 || flag2)
!flag && flag1 || flag2
with ! (or ~) is the negation, && is AND, || is OR, precedence is UNARY > && > ||.
For example:
Behaves as usual.
files(flagPosix && !flagSomething) mypath/*.cpp;
fetches the files only if flagPosix is true and flagSomething is false.
This applies also to other items (include, exclude, etc).
Just need to evaluate the flag(s) and it's complete.
Ciao
Max
Is it using MatchWhen? It should.
Flags will need to be passed as additional parameter.
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: [PROPOSAL] A couple of changes in "import.ext" [message #56982 is a reply to message #56980] |
Thu, 06 May 2021 16:02 |
mdelfede
Messages: 1307 Registered: September 2007
|
Ultimate Contributor |
|
|
Hi,
here the complete patch.
Tested (quickly) on Linux, so no MSC builder, I'll do it if it's all ok.
'import.ext' now accepts flags:
files(POSIX & !SOMETHING) some/path/*.cpp
allows relative paths (from current package) and absolute paths (useless, but anyways):
files(POSIX & !SOMETHING) ../myoriginallib/some/path/*.cpp
files /home/massimo/some/path/*.c
and finally allows duplicate file names in different paths and in c/c++/cxx files:
files some/path/version.cpp
files another/path/version.cpp
files another/path/version.c
object files are put in output directory with names prepended with original paths and with source extension before .o :
some/path/test.cpp --> outdir/package_full_path_some_path_test.cpp.o
Patch is attached. Please tell if it's ok and if I shall do the same for MSC too.
-
Attachment: ide.patch
(Size: 7.33KB, Downloaded 97 times)
[Updated on: Thu, 06 May 2021 16:04] Report message to a moderator
|
|
|
|
|
Goto Forum:
Current Time: Sun Apr 28 14:26:10 CEST 2024
Total time taken to generate the page: 0.04582 seconds
|
|
|