2008-09-22 01:08:49 +00:00
|
|
|
# AsmParser, with a Bison generated parser:
|
|
|
|
include(FindBison)
|
|
|
|
find_bison()
|
2008-10-24 11:24:33 +00:00
|
|
|
|
|
|
|
IF(BISON_EXECUTABLE)
|
2008-09-22 01:08:49 +00:00
|
|
|
bison_generator(
|
|
|
|
"llvmAsm"
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/llvmAsmParser.y"
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/llvmAsmParser.h"
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/llvmAsmParser.cpp"
|
|
|
|
)
|
2008-10-24 11:24:33 +00:00
|
|
|
ELSE(BISON_EXECUTABLE)
|
|
|
|
MESSAGE(STATUS "Bison not found, the pregenerated files will be used")
|
|
|
|
|
|
|
|
IF(WIN32)
|
|
|
|
FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR} WIN_SOURCE_DIR)
|
|
|
|
|
|
|
|
ADD_CUSTOM_COMMAND(
|
|
|
|
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/llvmAsmParser.cpp"
|
|
|
|
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/llvmAsmParser.cpp.cvs"
|
|
|
|
COMMAND copy \"${WIN_SOURCE_DIR}\\llvmAsmParser.cpp.cvs\" \"${WIN_SOURCE_DIR}\\llvmAsmParser.cpp\"
|
|
|
|
)
|
|
|
|
ADD_CUSTOM_COMMAND(
|
|
|
|
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/llvmAsmParser.h"
|
|
|
|
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/llvmAsmParser.h.cvs"
|
|
|
|
COMMAND copy \"${WIN_SOURCE_DIR}\\llvmAsmParser.h.cvs\" \"${WIN_SOURCE_DIR}\\llvmAsmParser.h\"
|
|
|
|
)
|
|
|
|
ELSE(WIN32)
|
|
|
|
MESSAGE(SEND_ERROR "Not implemented")
|
|
|
|
# fixme do the same with cp instead of copy
|
|
|
|
ENDIF(WIN32)
|
|
|
|
ENDIF(BISON_EXECUTABLE)
|
2008-09-22 01:08:49 +00:00
|
|
|
|
|
|
|
add_llvm_library(LLVMAsmParser
|
2008-10-24 11:24:33 +00:00
|
|
|
llvmAsmParser.cpp # Generated from llvmAsmParser.y or copyied from corresponding .cvs
|
|
|
|
llvmAsmParser.h # needed for the associated custom command to work
|
2008-09-22 01:08:49 +00:00
|
|
|
LLLexer.cpp
|
|
|
|
Parser.cpp
|
|
|
|
)
|