commit 614b46528eb8e33545c4079dd28fd6d3e2e49279
parent 30bcec0e4f50b6b66ccb36b01315db5ae88d1fc2
Author: Kyle Milz <kyle@0x30.net>
Date: Tue, 19 Jul 2016 23:08:06 -0600
src: start generating runtime_h automatically
Diffstat:
3 files changed, 11 insertions(+), 22 deletions(-)
diff --git a/src/Jamfile b/src/Jamfile
@@ -22,6 +22,10 @@ GL_SRCS =
matrix4x4.c
trackball.c ;
+Stringize demo_atlas_glsl.h : demo_atlas.glsl ;
+Stringize demo_vshader_glsl.h : demo_vshader.glsl ;
+Stringize demo_fshader_glsl.h : demo_fshader.glsl ;
+
ObjectC++Flags $(GL_SRCS) : -std=c++11 ;
ObjectC++Flags $(GL_SRCS) : `pkg-config $(PKG_CONFIG_LIBS) --cflags` ;
@@ -39,9 +43,7 @@ INST_SRCS =
inst_action.cc
inst_ast_visitor.cc ;
-Stringize demo_atlas_glsl.h : demo_atlas.glsl ;
-Stringize demo_vshader_glsl.h : demo_vshader.glsl ;
-Stringize demo_fshader_glsl.h : demo_fshader.glsl ;
+Stringize runtime_h.h : $(TOP)/lib/runtime.h ;
ObjectC++Flags $(INST_SRCS) : `llvm-config --cxxflags` ;
ObjectC++Flags $(INST_SRCS) : -DCITRUN_LIB=$(CITRUN_LIB) -DCITRUN_PATH=$(CITRUN_PATH) ;
diff --git a/src/runtime_h.h b/src/runtime_h.h
@@ -1,13 +0,0 @@
-static const char runtime_h[] =
-"#include <stdint.h>\n"
-"struct citrun_node {\n"
-" uint64_t *lines_ptr;\n"
-" uint32_t size;\n"
-" uint32_t inst_sites;\n"
-" const char *file_name;\n"
-" struct citrun_node *next;\n"
-" uint64_t *old_lines;\n"
-"};\n"
-"void citrun_node_add(struct citrun_node *);\n"
-"void citrun_start();\n"
-;
diff --git a/t/inst_preamble.t b/t/inst_preamble.t
@@ -27,12 +27,12 @@ extern "C" {
#endif
#include <stdint.h>
struct citrun_node {
- uint64_t *lines_ptr;
- uint32_t size;
- uint32_t inst_sites;
- const char *file_name;
- struct citrun_node *next;
- uint64_t *old_lines;
+ uint64_t *lines_ptr;
+ uint32_t size;
+ uint32_t inst_sites;
+ const char *file_name;
+ struct citrun_node *next;
+ uint64_t *old_lines;
};
void citrun_node_add(struct citrun_node *);
void citrun_start();