Skip to content

Commit

Permalink
Make parser generate a header, to avoid external project build confus…
Browse files Browse the repository at this point in the history
…ion.
  • Loading branch information
icculus committed Feb 28, 2009
1 parent bba00b6 commit ac8b1b8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Expand Up @@ -54,7 +54,7 @@ ENDIF(MSVC)
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}"
Expand All @@ -72,7 +72,7 @@ ADD_LIBRARY(mojoshader STATIC

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/")
Expand Down
4 changes: 2 additions & 2 deletions misc/lemon.c
Expand Up @@ -3611,9 +3611,9 @@ int mhflag; /* Output in makeheaders format if true */
in = tplt_open(lemp);
if( in==0 ) return;
#if __MOJOSHADER__
out = file_open(lemp,".c","wb");
#else
out = file_open(lemp,".h","wb");
#else
out = file_open(lemp,".c","wb");
#endif
if( out==0 ){
fclose(in);
Expand Down
2 changes: 1 addition & 1 deletion mojoshader_compiler.c
Expand Up @@ -10,7 +10,7 @@ typedef struct Context
} Context;

#define __MOJOSHADER_HLSL_COMPILER__ 1
#include "mojoshader_parser_hlsl.c"
#include "mojoshader_parser_hlsl.h"

static int ConvertToLemonToken(const Context *ctx)
{
Expand Down

0 comments on commit ac8b1b8

Please sign in to comment.