makesrna: move extern prototypes into own header
Patch T36049 by @jeske
This commit is contained in:
@@ -124,6 +124,9 @@ set(APISRC
|
||||
)
|
||||
|
||||
string(REGEX REPLACE "rna_([a-zA-Z0-9_-]*).c" "${CMAKE_CURRENT_BINARY_DIR}/rna_\\1_gen.c" GENSRC "${DEFSRC}")
|
||||
list(APPEND GENSRC
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/rna_prototypes_gen.h"
|
||||
)
|
||||
set_source_files_properties(${GENSRC} PROPERTIES GENERATED TRUE)
|
||||
|
||||
# --------------------------
|
||||
|
||||
@@ -3372,7 +3372,9 @@ static void rna_generate(BlenderRNA *brna, FILE *f, const char *filename, const
|
||||
fprintf(f, "#include \"RNA_types.h\"\n");
|
||||
fprintf(f, "#include \"rna_internal.h\"\n\n");
|
||||
|
||||
rna_generate_prototypes(brna, f);
|
||||
|
||||
/* include the generated prototypes header */
|
||||
fprintf(f, "#include \"rna_prototypes_gen.h\"\n\n");
|
||||
|
||||
fprintf(f, "#include \"%s\"\n", filename);
|
||||
if (api_filename)
|
||||
@@ -3967,6 +3969,26 @@ static int rna_preprocess(const char *outfile)
|
||||
|
||||
status = (DefRNA.error != 0);
|
||||
|
||||
/* create rna prototype header file */
|
||||
strcpy(deffile, outfile);
|
||||
strcat(deffile, "rna_prototypes_gen.h");
|
||||
if (status) {
|
||||
make_bad_file(deffile, __LINE__);
|
||||
}
|
||||
file = fopen(deffile, "w");
|
||||
if (!file) {
|
||||
fprintf(stderr, "Unable to open file: %s\n", deffile);
|
||||
status = 1;
|
||||
}
|
||||
else {
|
||||
fprintf(file,
|
||||
"/* Automatically generated function declarations for the Data API.\n"
|
||||
" * Do not edit manually, changes will be overwritten. */\n\n");
|
||||
rna_generate_prototypes(brna, file);
|
||||
fclose(file);
|
||||
status = (DefRNA.error != 0);
|
||||
}
|
||||
|
||||
/* create rna_gen_*.c files */
|
||||
for (i = 0; PROCESS_ITEMS[i].filename; i++) {
|
||||
strcpy(deffile, outfile);
|
||||
|
||||
Reference in New Issue
Block a user