diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-03-12 16:03:01 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-03-12 16:05:11 +0300 |
commit | 92d77b250ee11dcbace4eaa4464bf4a7e13627ec (patch) | |
tree | 6ac5e0b4c89855fe4c497d28322d6991f1d84460 /source/blender | |
parent | ae45496812a46b084e3c31948029efd8b5409b68 (diff) |
makesrna: move extern prototypes into own header
Patch T36049 by @jeske
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/makesrna/intern/CMakeLists.txt | 3 | ||||
-rw-r--r-- | source/blender/makesrna/intern/makesrna.c | 24 |
2 files changed, 26 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index ec82fcafe76..fa7fd6da8bb 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -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) # -------------------------- diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 14c39862467..e0075414615 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -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); |