Add custom target for the file generation

The reason I want to propose this is so that users who just want a compilation database (I use Windows Subsystem for Linux/WSL so its useful for me) can then set the following in their own project:

option(CMAKE_EXPORT_COMPILE_COMMANDS ON)

And then run:

cd build
cmake ..
cmake --build . -t godotcpp_generated_files

The above just builds the generated files, and nothing else. No compilation of anything, so its very lightweight.
pull/1388/head
Daniel Cauchi 2024-02-10 14:00:57 +02:00 committed by GitHub
parent 36847f6af0
commit 4016d034b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -138,6 +138,7 @@ add_custom_command(OUTPUT ${GENERATED_FILES_LIST}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/binding_generator.py DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/binding_generator.py
COMMENT "Generating bindings" COMMENT "Generating bindings"
) )
add_custom_target(godotcpp_generated_files DEPENDS ${GENERATED_FILES_LIST})
# Get Sources # Get Sources
file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS src/*.c**) file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS src/*.c**)