Make parser generate a header, to avoid external project build confusion.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 28 Feb 2009 15:31:46 -0500
changeset 714 e8ed66bfff18
parent 713 df03861232ec
child 715 817d02ae5c4b
Make parser generate a header, to avoid external project build confusion.
CMakeLists.txt
misc/lemon.c
mojoshader_compiler.c
--- a/CMakeLists.txt	Sat Feb 28 15:26:39 2009 -0500
+++ b/CMakeLists.txt	Sat Feb 28 15:31:46 2009 -0500
@@ -54,7 +54,7 @@
 ADD_EXECUTABLE(lemon "misc/lemon.c")
 GET_TARGET_PROPERTY(LEMON lemon LOCATION)
 ADD_CUSTOM_COMMAND(
-    OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/mojoshader_parser_hlsl.c"
+    OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/mojoshader_parser_hlsl.h"
     MAIN_DEPENDENCY "${CMAKE_CURRENT_SOURCE_DIR}/mojoshader_parser_hlsl.lemon"
     DEPENDS lemon "${CMAKE_CURRENT_SOURCE_DIR}/misc/lempar.c"
     COMMAND "${LEMON}"
@@ -72,7 +72,7 @@
 
 SET_SOURCE_FILES_PROPERTIES(
     mojoshader_compiler.c
-    PROPERTIES OBJECT_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/mojoshader_parser_hlsl.c"
+    PROPERTIES OBJECT_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/mojoshader_parser_hlsl.h"
 )
 
 FIND_PROGRAM(RE2C re2c DOC "Path to re2c command line app: http://re2c.org/")
--- a/misc/lemon.c	Sat Feb 28 15:26:39 2009 -0500
+++ b/misc/lemon.c	Sat Feb 28 15:31:46 2009 -0500
@@ -3611,9 +3611,9 @@
   in = tplt_open(lemp);
   if( in==0 ) return;
 #if __MOJOSHADER__
-  out = file_open(lemp,".c","wb");
+  out = file_open(lemp,".h","wb");
 #else
-  out = file_open(lemp,".h","wb");
+  out = file_open(lemp,".c","wb");
 #endif
   if( out==0 ){
     fclose(in);
--- a/mojoshader_compiler.c	Sat Feb 28 15:26:39 2009 -0500
+++ b/mojoshader_compiler.c	Sat Feb 28 15:31:46 2009 -0500
@@ -10,7 +10,7 @@
 } Context;
 
 #define __MOJOSHADER_HLSL_COMPILER__ 1
-#include "mojoshader_parser_hlsl.c"
+#include "mojoshader_parser_hlsl.h"
 
 static int ConvertToLemonToken(const Context *ctx)
 {