godotengine / godot-cpp

C++ bindings for the Godot script API
MIT License
1.75k stars 580 forks source link

CMake: add dev feature tag when GODOT_DEV_BUILD is enabled. #1648

Open enetheru opened 6 days ago

enetheru commented 6 days ago

When SCons has dev_build=yes enabled, there is a "dev" feature flag added to the compile artifact.

This pr adds the same to the cmake build when the corresponding GODOT_DEV_BUILD flag is enabled.

enetheru commented 3 days ago

I'm sorry, dont merge this yet, I'm going to start submitting all my PR's as draft because I always find something to change.

In this case, the code is not defensive enough, if someone defines DEV in an outer scope, whatever that is will be injected in the name and we dont want that. So I'm going to ammend this for that case.

dsnopek commented 1 day ago

I just tested this locally and it doesn't seem to be working for me, although, I could be doing something wrong?

I built with:

mkdir cmake-build
cd cmake-build
cmake ../ -G "Ninja" -DGODOT_DEV_BUILD:BOOL=ON

# Just the godot-cpp static library:
cmake --build . -t template_debug --config Debug
ls bin
# SHOWS: libgodot-cpp.linux.template_debug.x86_64.a

# The test project.
cmake --build . -t template_debug --config Debug
ls ../test/project/bin
# SHOWS: libgdexample.linux.template_debug.x86_64.so

So, I'm not getting the .dev added

enetheru commented 1 day ago

I'll do some re-testing and check back in later