[PATCH] D16130: Don't try to build Burg if yacc isn't installed.

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 12 18:56:31 PST 2016


jlebar created this revision.
jlebar added reviewers: rengolin, cmatthews, jmolloy, beanz.
jlebar added a subscriber: llvm-commits.

Without this patch, ninja test-suite dies with

  CMake Error at MultiSource/Applications/Burg/CMakeLists.txt:17 (add_yacc_parser):
    Unknown CMake command "add_yacc_parser".

I have no idea what I'm doing here in CMake world, please be gentle.

http://reviews.llvm.org/D16130

Files:
  MultiSource/Applications/Burg/CMakeLists.txt

Index: MultiSource/Applications/Burg/CMakeLists.txt
===================================================================
--- MultiSource/Applications/Burg/CMakeLists.txt
+++ MultiSource/Applications/Burg/CMakeLists.txt
@@ -14,7 +14,11 @@
 set(Source ${ExtraSource} ${TMP1})
 
 include_directories(${CMAKE_CURRENT_BINARY_DIR})
-add_yacc_parser(burg_parser gram.y ${CMAKE_CURRENT_BINARY_DIR}/y.tab.c ${CMAKE_CURRENT_BINARY_DIR}/y.tab.h)
-    llvm_multisource()
+
+# Only build Burg if yacc is installed.
+if(YACC_EXECUTABLE)
+  add_yacc_parser(burg_parser gram.y ${CMAKE_CURRENT_BINARY_DIR}/y.tab.c ${CMAKE_CURRENT_BINARY_DIR}/y.tab.h)
+  llvm_multisource()
+endif(YACC_EXECUTABLE)
 
 llvm_add_subdirectories(${DIRS} ${PARALLEL_DIRS})


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16130.44702.patch
Type: text/x-patch
Size: 732 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160113/285d3fa4/attachment.bin>


More information about the llvm-commits mailing list