Skip to content

[thrift] build fails on linux due to FLEX & BISON not found #4042

@markaren

Description

@markaren

Currently, thrift tries to find flex and bison using:

vcpkg_find_acquire_program(FLEX)
vcpkg_find_acquire_program(BISON)

https://github.com/Microsoft/vcpkg/blob/master/ports/thrift/portfile.cmake

However, this only works on windows..

Solution:
Use find_program on other platforms:

if (WIN32)
    vcpkg_find_acquire_program(FLEX)
    vcpkg_find_acquire_program(BISON)
else()
    find_program(FLEX flex)
    if(NOT FLEX)
        message(FATAL_ERROR "Could not find flex. Please install it through your package manager.")
    endif()
    find_program(BISON bison)
    if(NOT BISON)
        message(FATAL_ERROR "Could not find bison. Please install it through your package manager.")
    endif()
endif()

I can make a PR with the fix included if this sounds ok?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions