mirror of
https://github.com/cwbaker/lalr.git
synced 2026-09-26 16:33:18 +03:00
Add Cmake targets
This commit is contained in:
parent
efde50b76c
commit
4e000f92ef
2 changed files with 23 additions and 0 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -8,6 +8,8 @@
|
|||
/sweet/sweet_parser.sln
|
||||
/*.sln
|
||||
/.vscode/
|
||||
/.vs
|
||||
/out
|
||||
debug
|
||||
release
|
||||
shipping
|
||||
|
|
|
|||
21
CMakeLists.txt
Normal file
21
CMakeLists.txt
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
project(LALR)
|
||||
|
||||
### ---------------------- Static Library --------------------- ###
|
||||
file(GLOB SOURCES "./src/lalr/*.cpp")
|
||||
file(GLOB HEADERS "./src/lalr/*.hpp")
|
||||
add_library(${PROJECT_NAME} STATIC ${SOURCES} ${HEADERS})
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC ./src/)
|
||||
|
||||
### -------------------------- offline compiler -------------------------- ###
|
||||
file(GLOB COMPILER_SOURCES "./src/lalr/lalrc/*.cpp")
|
||||
add_executable(${PROJECT_NAME}Compiler ${COMPILER_SOURCES})
|
||||
target_link_libraries(${PROJECT_NAME}Compiler ${PROJECT_NAME})
|
||||
|
||||
### -------------------------- Tests -------------------------- ###
|
||||
add_subdirectory(src/unittest-cpp)
|
||||
|
||||
enable_testing()
|
||||
file(GLOB TEST_SOURCES "./src/lalr/lalr_test/*.cpp")
|
||||
add_executable(${PROJECT_NAME}Tests ${TEST_SOURCES})
|
||||
target_link_libraries(${PROJECT_NAME}Tests ${PROJECT_NAME} UnitTest++)
|
||||
add_test(NAME ${PROJECT_NAME}Tests COMMAND ${PROJECT_NAME}Tests)
|
||||
Loading…
Add table
Add a link
Reference in a new issue