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
Ease of use with CMake #203
Comments
Love to see this materialize.
Yes, please do. |
I will give it a go then, should have something to show next week or so. |
I have a prototype that I have tested on a small toy project. At the moment, the function looks like this:
Here is a usage example: cmake_minimum_required(VERSION 3.20)
project(monkeylang)
set(CMAKE_CXX_STANDARD 20)
find_package(Reflex REQUIRED)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(ReflexCMakeSupport)
add_reflex_target(
TARGET lexer
LIBRARY_TYPE SHARED
FILES "reflex_input/lex.reflex"
INCLUDE_DIRECTORIES include # provides token headers which are shared with parser
)
add_executable(app main.cpp)
target_link_libraries(app PRIVATE lexer) The headers for each #include <lexer/lex.hpp> To incorporate the work into a PR I thought about applying the cmake script inside example, but I am unsure what targets I could create there. Could you please advise on a set of targets I should create inside examples directory? This would also serve second purpose for testing the script as well. |
Thank you for the update. Target examples you could pick might be a mix of lexers and C++ applications
It's up to you. Thanks. |
I am not sure if I overlooked it, but It would be great to have a cmake script that users could include and invoke functions to invoke reflex. I have something like this in mind:
Then users could do stuff like
I would be up to implement the above if desired.
The text was updated successfully, but these errors were encountered: