Refactor: Build generated DNA files as C++
Pull Request: https://projects.blender.org/blender/blender/pulls/134469
This commit is contained in:
@@ -13,10 +13,6 @@
|
||||
|
||||
struct SDNA;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* DNAstr contains the prebuilt SDNA structure defining the layouts of the types
|
||||
* used by this version of Blender. It is defined in a file dna.c, which is
|
||||
@@ -254,7 +250,3 @@ void DNA_sdna_alias_data_ensure_structs_map(struct SDNA *sdna);
|
||||
# define DNA_struct_member_exists(sdna, stype, vartype, name) \
|
||||
DNA_struct_member_exists_with_alias(sdna, stype, vartype, name)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -98,18 +98,18 @@ if(WIN32 AND NOT UNIX)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Output dna.c
|
||||
# Output dna.cc
|
||||
add_custom_command(
|
||||
OUTPUT
|
||||
${CMAKE_CURRENT_BINARY_DIR}/dna.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/dna.cc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/dna_type_offsets.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/dna_verify.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/dna_verify.cc
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E env ${PLATFORM_ENV_BUILD}
|
||||
"$<TARGET_FILE:makesdna>"
|
||||
${CMAKE_CURRENT_BINARY_DIR}/dna.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/dna.cc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/dna_type_offsets.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/dna_verify.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/dna_verify.cc
|
||||
${CMAKE_SOURCE_DIR}/source/blender/makesdna/
|
||||
DEPENDS makesdna
|
||||
)
|
||||
@@ -121,8 +121,8 @@ set(SRC
|
||||
dna_defaults.c
|
||||
dna_genfile.cc
|
||||
dna_utils.cc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/dna.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/dna_verify.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/dna.cc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/dna_verify.cc
|
||||
${SRC_DNA_INC}
|
||||
|
||||
${CMAKE_CURRENT_BINARY_DIR}/dna_type_offsets.h
|
||||
@@ -131,9 +131,9 @@ set(SRC
|
||||
)
|
||||
|
||||
set_source_files_properties(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/dna.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/dna.cc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/dna_type_offsets.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/dna_verify.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/dna_verify.cc
|
||||
PROPERTIES GENERATED TRUE
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user