Remove custom command for bison, it fails if bison is not found

This commit is contained in:
baldurk 2016-01-01 01:21:56 +01:00
parent 530690e442
commit 395b7dd3f5

View File

@ -64,22 +64,6 @@ set(HEADERS
MachineIndependent/preprocessor/PpContext.h
MachineIndependent/preprocessor/PpTokens.h)
find_package(BISON)
if(NOT BISON_FOUND)
if (WIN32)
set(BISON_EXECUTABLE ../tools/bison.exe)
message("bison not found. Assuming it is at ${BISON_EXECUTABLE}")
else()
message(FATAL_ERROR "bison required but not found. Please install via your package management tool.")
endif()
endif()
# Always use a custom command since our use of --defines isn't assumed by CMake's BISON_TARGET,
# which ends up causing the target to always be rebuilt.
add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp.h
COMMAND ${BISON_EXECUTABLE} --defines=${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp.h -t ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang.y -o ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp
MAIN_DEPENDENCY MachineIndependent/glslang.y
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
set(BISON_GLSLParser_OUTPUT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp)
add_library(glslang STATIC ${BISON_GLSLParser_OUTPUT_SOURCE} ${SOURCES} ${HEADERS})