On Tue, 25 Oct 2022 22:17:25 GMT, Erik Joelsson <er...@openjdk.org> wrote:

> This looks like nice work.
> 
> I'm curious how does this eclipse project figures out preprocessor settings 
> like -D flags from the build to correctly setup the environment for the 
> native code? I know this was a major deal when creating the 
> compile-commands.json for other native IDE integrations. I've heard some IDEs 
> just run the build once and inspect the command lines, but our default log 
> level won't show that. I'm not familiar with eclipse project files, but I 
> couldn't really see anything here that addressed this issue. Can you work 
> with the native code in a meaningful way without it?

You're right, it seems I forgot to also include the preprocessor defines in the 
generated workspace :P
I'll add them in the next commit, thanks for catching that. Eclipse does work 
very well with native code even without those defines and flags from the build 
for the most part though, just that utilities which require them (For instance 
something like PRODUCT_ONLY and NOT_PRODUCT in HotSpot) wouldn't properly work 
with the indexer, which would be annoying, but it's more of a mild 
inconvenience than anything.

> make/ide/eclipse/CreateWorkspace.gmk line 79:
> 
>> 77:     $(patsubst $(TOPDIR)/%,%,$(call FindModuleNativeDirs, $(module)))))
>> 78: 
>> 79: EmitEmptyLine = $(file >> $(1),)
> 
> Note that using the file macro requires GNU make >=4.0. You probably want to 
> document this requirement and add a fast fail if it's not fulfilled.

I think it would be better if I looked for something that the make system 
already has and used that instead of something that's tied to a specific 
version and GNU specific now that I'm revisiting this, thanks for the catch

-------------

PR: https://git.openjdk.org/jdk/pull/10853

Reply via email to