Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
limuy2022 committed Dec 15, 2023
1 parent bad65f1 commit b034383
Show file tree
Hide file tree
Showing 21 changed files with 403 additions and 1,192 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
build/
out/
bin/
bison/
cmake_third_party/
Testing/
CMakeFiles/
Expand Down Expand Up @@ -36,6 +37,10 @@ testlog.log
*.a
*.exp
*.pdb
token.cpp
parser.cpp
parser.hpp
location.hh

# 单元测试中的临时输出文件
*.out
27 changes: 17 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ include_directories("cmake_third_party/googletest/googletest/include")

add_library(language_module)
target_sources(language_module
PUBLIC
FILE_SET CXX_MODULES FILES
language/language.cppm
PUBLIC
FILE_SET CXX_MODULES FILES
language/language.cppm
)

message("${LANGUAGE_SOURCES}")
Expand All @@ -42,9 +42,9 @@ message(${CPP_SOURCES})
add_library(foo)

target_sources(foo
PUBLIC
FILE_SET CXX_MODULES FILES
${CPPMSOURCES}
PUBLIC
FILE_SET CXX_MODULES FILES
${CPPMSOURCES}
)

add_executable(Trc ${CPP_SOURCES})
Expand All @@ -58,10 +58,10 @@ file(GLOB_RECURSE TEST_MODULE_SOURCES "tests/unittest/*.cppm")
add_library(testmodulefiles)

target_sources(testmodulefiles
PUBLIC
FILE_SET CXX_MODULES FILES
${CPPMSOURCES}
${TEST_MODULE_SOURCES}
PUBLIC
FILE_SET CXX_MODULES FILES
${CPPMSOURCES}
${TEST_MODULE_SOURCES}
)

add_executable(unittest
Expand All @@ -70,3 +70,10 @@ add_executable(unittest
)
target_compile_definitions(unittest PRIVATE "UNITTEST")
target_link_libraries(unittest testmodulefiles language gtest)
add_dependencies(Trc flex_bison)
add_dependencies(unittest flex_bison)

add_custom_target(flex_bison
command flex -o token.cpp ${PROJECT_SOURCE_DIR}/src/compiler/token.ll
command bison -o parser.cpp ${PROJECT_SOURCE_DIR}/src/compiler/parser.yy
)
Loading

0 comments on commit b034383

Please sign in to comment.