diff options
author | Oscar Fuentes <ofv@wanadoo.es> | 2008-10-25 03:19:08 +0000 |
---|---|---|
committer | Oscar Fuentes <ofv@wanadoo.es> | 2008-10-25 03:19:08 +0000 |
commit | ddbbb4fe89e11a59bbf2e425261ab3245b8e3bde (patch) | |
tree | a477f668ab9dc8bb4c8856969275a183165b48c9 | |
parent | 78dfef771b2552090be60bee404570c2a0b03bcb (diff) | |
download | external_llvm-ddbbb4fe89e11a59bbf2e425261ab3245b8e3bde.zip external_llvm-ddbbb4fe89e11a59bbf2e425261ab3245b8e3bde.tar.gz external_llvm-ddbbb4fe89e11a59bbf2e425261ab3245b8e3bde.tar.bz2 |
CMake: Cross-platform support for using pre-generated llvmAsmParser.cpp and llvmAsmParser.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58130 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/AsmParser/CMakeLists.txt | 43 |
1 files changed, 18 insertions, 25 deletions
diff --git a/lib/AsmParser/CMakeLists.txt b/lib/AsmParser/CMakeLists.txt index b8283c5..62e6dce 100644 --- a/lib/AsmParser/CMakeLists.txt +++ b/lib/AsmParser/CMakeLists.txt @@ -2,34 +2,27 @@ 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) +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") - 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.cpp" + DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/llvmAsmParser.cpp.cvs" + COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/llvmAsmParser.cpp.cvs" "${CMAKE_CURRENT_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\" + add_custom_command( + OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/llvmAsmParser.h" + DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/llvmAsmParser.h.cvs" + COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/llvmAsmParser.h.cvs" "${CMAKE_CURRENT_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) +endif(BISON_EXECUTABLE) add_llvm_library(LLVMAsmParser llvmAsmParser.cpp # Generated from llvmAsmParser.y or copyied from corresponding .cvs |