aboutsummaryrefslogtreecommitdiffstats
path: root/lib/AsmParser/CMakeLists.txt
diff options
context:
space:
mode:
authorCédric Venet <cedric.venet@laposte.net>2008-10-24 11:24:33 +0000
committerCédric Venet <cedric.venet@laposte.net>2008-10-24 11:24:33 +0000
commitc30584393e1b7f4ee175280512e9f4263f951b78 (patch)
tree9904549be44e8c0157edd4c6996ff4ad95c5705d /lib/AsmParser/CMakeLists.txt
parent4d65872a2fa46647c82d1c2a710e63232dd0bf48 (diff)
downloadexternal_llvm-c30584393e1b7f4ee175280512e9f4263f951b78.zip
external_llvm-c30584393e1b7f4ee175280512e9f4263f951b78.tar.gz
external_llvm-c30584393e1b7f4ee175280512e9f4263f951b78.tar.bz2
Modify the cmake build system so that if it doesn't find bison, it will use the pregenerated file in from the svn (.cvs). Work only for windows for the moment. Tested on Vista64 with MSVC2008express.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58090 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser/CMakeLists.txt')
-rw-r--r--lib/AsmParser/CMakeLists.txt26
1 files changed, 25 insertions, 1 deletions
diff --git a/lib/AsmParser/CMakeLists.txt b/lib/AsmParser/CMakeLists.txt
index c12f414..b8283c5 100644
--- a/lib/AsmParser/CMakeLists.txt
+++ b/lib/AsmParser/CMakeLists.txt
@@ -1,15 +1,39 @@
# AsmParser, with a Bison generated parser:
include(FindBison)
find_bison()
+
+IF(BISON_EXECUTABLE)
bison_generator(
"llvmAsm"
"${CMAKE_CURRENT_SOURCE_DIR}/llvmAsmParser.y"
"${CMAKE_CURRENT_SOURCE_DIR}/llvmAsmParser.h"
"${CMAKE_CURRENT_SOURCE_DIR}/llvmAsmParser.cpp"
)
+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)
add_llvm_library(LLVMAsmParser
- llvmAsmParser.cpp # Generated from llvmAsmParser.y
+ llvmAsmParser.cpp # Generated from llvmAsmParser.y or copyied from corresponding .cvs
+ llvmAsmParser.h # needed for the associated custom command to work
LLLexer.cpp
Parser.cpp
)