shithub: rgbds

Download patch

ref: 930c2ac328ecc09d630165bf5f5211e9edc165be
parent: 28737d5778f05bd554e595360c1f94d21328d15d
author: ISSOtm <eldredhabert0@gmail.com>
date: Thu Oct 13 07:02:33 EDT 2022

Require Bison 3.0.0 in CMakeLists

We actually require that version, so be explicit about it
to provide better error messages.

--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -14,21 +14,20 @@
     "_version.c"
     )
 
-find_package(BISON REQUIRED)
+find_package(BISON 3.0.0 REQUIRED)
 set(BISON_FLAGS "-Wall")
-# Set sompe optimization flags on versions that support them
+# Set some optimization flags on versions that support them
 if(BISON_VERSION VERSION_GREATER_EQUAL "3.5")
   set(BISON_FLAGS "${BISON_FLAGS} -Dapi.token.raw=true")
 endif()
 if(BISON_VERSION VERSION_GREATER_EQUAL "3.6")
   set(BISON_FLAGS "${BISON_FLAGS} -Dparse.error=detailed")
-elseif(BISON_VERSION VERSION_GREATER_EQUAL "3.0")
+else()
   set(BISON_FLAGS "${BISON_FLAGS} -Dparse.error=verbose")
 endif()
-if(BISON_VERSION VERSION_GREATER_EQUAL "3.0")
-  set(BISON_FLAGS "${BISON_FLAGS} -Dparse.lac=full")
-  set(BISON_FLAGS "${BISON_FLAGS} -Dlr.type=ielr")
-endif()
+set(BISON_FLAGS "${BISON_FLAGS} -Dparse.lac=full")
+set(BISON_FLAGS "${BISON_FLAGS} -Dlr.type=ielr")
+
 BISON_TARGET(PARSER "asm/parser.y"
              "${PROJECT_SOURCE_DIR}/src/asm/parser.c"
              COMPILE_FLAGS "${BISON_FLAGS}"