Skip to content

Commit

Permalink
改为模块
Browse files Browse the repository at this point in the history
  • Loading branch information
wangziwenhk committed Sep 22, 2024
1 parent b37da07 commit cf9dde5
Show file tree
Hide file tree
Showing 46 changed files with 3,239 additions and 669 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cmake-build-debug
cmake-build-release
test
.idea
test
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

588 changes: 588 additions & 0 deletions .idea/editor.xml

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/shelf/_2024_9_19_18_04___Changes_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/shelf/__Changes_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

845 changes: 845 additions & 0 deletions .idea/shelf/在变基之前未提交的更改_[Changes]/shelved.patch

Large diffs are not rendered by default.

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

351 changes: 351 additions & 0 deletions .idea/workspace.xml

Large diffs are not rendered by default.

37 changes: 30 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,17 @@ message("Current build type: ${CMAKE_BUILD_TYPE}")
message("Current generator: ${CMAKE_GENERATOR}")

#Enter the system type for better searching of the database.
if(WIN32)
if (WIN32)
set(PLATFORM_DEFINES "-DWIN32")
else(LINUX)
else (LINUX)
set(PLATFORM_DEFINES "-DLINUX")
endif()
endif ()

if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-D_ITERATOR_DEBUG_LEVEL=2)
else ()
add_definitions(-D_ITERATOR_DEBUG_LEVEL=0)
endif ()

find_path(ANTLR4_INCLUDE_DIR antlr4-runtime/antlr4-runtime.h
PATHS ${CMAKE_PREFIX_PATH} NO_DEFAULT_PATH)
Expand All @@ -36,11 +42,28 @@ include_directories(${LLVM_INCLUDE_DIRS})
include_directories(parser)

file(GLOB_RECURSE AST_FILES "parser/*.cpp" "parser/*.h")
file(GLOB_RECURSE SOURCE_FILES "src/*")
#file(GLOB_RECURSE SOURCE_FILES "src/*.cpp" "src/*.h")
file(GLOB_RECURSE SOURCE_FILES "src/*.cpp")
file(GLOB_RECURSE MODULE_FILES "src/*.ixx")

set(FILTERED_SOURCE_FILES)

# 遍历所有源文件,排除 main.cpp
foreach(FILE ${SOURCE_FILES})
if(NOT FILE MATCHES "src/main.cpp$")
list(APPEND FILTERED_SOURCE_FILES ${FILE})
endif()
endforeach()

set(SOURCE_FILES ${FILTERED_SOURCE_FILES})

add_subdirectory(src)

add_executable(Riddle_Language ${SOURCE_FILES} ${AST_FILES})
#add_executable(Riddle_Language ${SOURCE_FILES} ${AST_FILES})
add_executable(Riddle_Language src/main.cpp ${AST_FILES})

target_compile_definitions(Riddle_Language PRIVATE ${PLATFORM_DEFINES})

target_link_libraries(Riddle_Language LLVMCore)
target_link_libraries(Riddle_Language antlr4_shared)
target_link_libraries(Riddle_Language PRIVATE LLVMCore)
target_link_libraries(Riddle_Language PRIVATE antlr4_shared)
target_link_libraries(Riddle_Language PRIVATE Riddle_Module)
Loading

0 comments on commit cf9dde5

Please sign in to comment.