Skip to content

Commit

Permalink
Add bison and re2c as dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
widberg committed Jan 17, 2023
1 parent 0923e1f commit 71e8932
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 9,279 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@
[submodule "dependencies/CLI11"]
path = dependencies/CLI11
url = https://github.com/CLIUtils/CLI11.git
[submodule "dependencies/winflexbison"]
path = dependencies/winflexbison
url = https://github.com/lexxmark/winflexbison.git
[submodule "dependencies/re2c"]
path = dependencies/re2c
url = https://github.com/skvadrik/re2c.git
6 changes: 6 additions & 0 deletions dependencies/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ add_subdirectory(hashlibpp)
# LuaJIT
add_subdirectory(luajit)

# re2c
add_subdirectory(re2c)

# sol2
add_subdirectory(sol2)

Expand All @@ -28,3 +31,6 @@ SET(USERCALL_HPP_CHECK_RETURN ON CACHE BOOL "")
SET(USERCALL_HPP_USE_HEXRAYS_DEFS ON CACHE BOOL "")
SET(USERCALL_HPP_USE_REALLY_SHORT_NAMES ON CACHE BOOL "")
add_subdirectory(usercall.hpp)

# winflexbison
add_subdirectory(winflexbison)
1 change: 1 addition & 0 deletions dependencies/re2c
Submodule re2c added at 3a7c3f
1 change: 1 addition & 0 deletions dependencies/winflexbison
Submodule winflexbison added at 1176da
13 changes: 7 additions & 6 deletions pigeon/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
add_executable(pigeon
pigeon.cpp
pigeon.yy
${CMAKE_CURRENT_BINARY_DIR}/pigeon.cpp
)
target_include_directories(pigeon PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(pigeon CLI11::CLI11)
add_dependencies(pigeon win_bison re2c)

add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/pigeon.cpp.re ${CMAKE_CURRENT_SOURCE_DIR}/pigeon.cpp
COMMAND bison ${CMAKE_CURRENT_SOURCE_DIR}/pigeon.yy -o ${CMAKE_CURRENT_BINARY_DIR}/pigeon.cpp.re -Wcounterexamples
COMMAND re2c ${CMAKE_CURRENT_BINARY_DIR}/pigeon.cpp.re -o ${CMAKE_CURRENT_SOURCE_DIR}/pigeon.cpp --no-debug-info
DEPENDS pigeon.yy
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/pigeon.cpp.re ${CMAKE_CURRENT_BINARY_DIR}/pigeon.cpp
COMMAND $<TARGET_FILE:win_bison> ${CMAKE_CURRENT_SOURCE_DIR}/pigeon.yy -o ${CMAKE_CURRENT_BINARY_DIR}/pigeon.cpp.re -Wcounterexamples
COMMAND $<TARGET_FILE:re2c> ${CMAKE_CURRENT_BINARY_DIR}/pigeon.cpp.re -o ${CMAKE_CURRENT_BINARY_DIR}/pigeon.cpp --no-debug-info
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/pigeon.yy
)

include(cmake/add_pigeon_target.cmake)
Expand Down
Loading

0 comments on commit 71e8932

Please sign in to comment.