Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7.2: please do not use hardcoded yacc #119

Open
kloczek opened this issue Jun 27, 2023 · 5 comments
Open

7.2: please do not use hardcoded yacc #119

kloczek opened this issue Jun 27, 2023 · 5 comments

Comments

@kloczek
Copy link

kloczek commented Jun 27, 2023

add_custom_command(
OUTPUT parse.c
COMMAND yacc -o parse.c ${CMAKE_CURRENT_SOURCE_DIR}/parse.y
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/parse.y
)

This should be implemented using https://cmake.org/cmake/help/latest/module/FindFLEX.html

@tobhe
Copy link
Member

tobhe commented Jun 27, 2023

Thanks, I wasn't aware of that cmake feature! This looks a lot better than the current hack.

@tobhe
Copy link
Member

tobhe commented Jun 29, 2023

One problem I am running into is that this cmake module doesn't find the yacc versions shipped in base by most BSD systems.

@kloczek
Copy link
Author

kloczek commented Jun 30, 2023

What about bison? 🤔

@tobhe
Copy link
Member

tobhe commented Jun 30, 2023

bison would require installing an external package which I find unfortunate because iked builds fine with what is available in the base installation. Maybe we need a FindYACC and fallback to bison if that isn't there.

@kloczek
Copy link
Author

kloczek commented Jun 30, 2023

Currently most of the bison generated parses do not need flex static library on linking.

I'm not sure how it is with yacc on *BSD but generally speaking yacc on Linux is way behind GNU bison and everything what theoretically needs yacc always is possible to build bison.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants