premake / premake-core

Premake
https://premake.github.io/
BSD 3-Clause "New" or "Revised" License
3.24k stars 617 forks source link

Build message for C/C++ source files #2014

Closed GloriousPtr closed 1 year ago

GloriousPtr commented 1 year ago

What are you trying to do? Add build message for .cpp and .c files

What problem are you having? I don't know how to do it.

What have you tried so far? Project level:

filter "files:**.cpp"
    buildmessage "Compiling C++ source file: %{file.relpath}"
filter "files:**.c"
    buildmessage "Compiling C source file %{file.relpath}"

What version of Premake are you using? 5.0.0-beta2

Anything else we should know? N/A

Jarod42 commented 1 year ago

Which generator are you using?

Most generator should produce advancement when building file (even if message is not customized).

buildmessage is for custom build and rules.

GloriousPtr commented 1 year ago

vs2022 with clang toolset is not producing any output per file except for warnings and errors. Works fine with msvc

nickclark2016 commented 1 year ago

It may be possible that it's not something supported for Clang. Could you check and see if it works for Clang + vs2022 if you add a build message by hand?

GloriousPtr commented 1 year ago

I added the above mentioned snippet but message is not customized, but is default when I use MSVC: image

And with clang-cl no message shows up for compiling files: image

I'm sorry if I missed the point here but I'm not sure what do you mean by "Add a build message by hand"?

Jarod42 commented 1 year ago

From what I see, visual project doesn't have a field to customize message. I think "add a build message by hand" was about configuring directly from IDE. (But I think you cannot). Even the regular msvc doesn't customize files list.

nickclark2016 commented 1 year ago

From what I see, visual project doesn't have a field to customize message. I think "add a build message by hand" was about configuring directly from IDE. (But I think you cannot). Even the regular msvc doesn't customize files list.

Good to know. If that's the case, then no, there's no way to do this for VS solution/project exports.

GloriousPtr commented 1 year ago

Okay, I should close the issue then. Thanks for the support!

GloriousPtr commented 1 year ago

Found the solution. Added this and it worked for clang cl:

buildoptions { "/showFilenames" }