2024-05-27 14:47:32 +00:00
|
|
|
include(CTest)
|
|
|
|
|
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/src)
|
|
|
|
include_directories(PRIVATE ${GLIB_INCLUDE_DIRS})
|
|
|
|
|
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
pkg_search_module(GLIB REQUIRED IMPORTED_TARGET glib-2.0)
|
2024-06-04 12:58:40 +00:00
|
|
|
link_libraries(PkgConfig::GLIB)
|
|
|
|
|
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/dep/tomlc99)
|
2024-05-27 14:47:32 +00:00
|
|
|
|
|
|
|
# ------------------------------------------------ #
|
|
|
|
# LLVM backend #
|
|
|
|
# ------------------------------------------------ #
|
|
|
|
|
|
|
|
# Fetch LLVM link configuration
|
|
|
|
execute_process(COMMAND llvm-config --libs all
|
|
|
|
OUTPUT_VARIABLE LLVM_LIBS)
|
|
|
|
# Strip whitespace from output
|
|
|
|
string(STRIP "${LLVM_LIBS}" LLVM_LIBS)
|
|
|
|
# Link all targets to LLVM
|
|
|
|
link_libraries(${LLVM_LIBS})
|
|
|
|
|
2024-05-27 19:22:06 +00:00
|
|
|
execute_process(COMMAND llvm-config --includedir
|
|
|
|
OUTPUT_VARIABLE LLVM_INCLUDE_DIR)
|
|
|
|
string(STRIP "${LLVM_INCLUDE_DIR}" LLVM_INCLUDE_DIR)
|
|
|
|
include_directories(${LLVM_INCLUDE_DIR})
|
|
|
|
|
2024-05-27 14:47:32 +00:00
|
|
|
# ------------------------------------------------------- #
|
|
|
|
# CTEST 1
|
|
|
|
# test llvm backend codegen for global variables
|
|
|
|
|
2024-07-02 14:45:05 +00:00
|
|
|
#file(GLOB_RECURSE SOURCE_FILES ${PROJECT_SOURCE_DIR}/src/llvm/*.c)
|
|
|
|
#list(REMOVE_ITEM SOURCE_FILES ${PROJECT_SOURCE_DIR}/src/main.c)
|
|
|
|
#add_executable(global_vars
|
|
|
|
# ${PROJECT_SOURCE_DIR}/src/codegen/backend.c
|
|
|
|
# ${PROJECT_SOURCE_DIR}/src/sys/log.c
|
|
|
|
# ${PROJECT_SOURCE_DIR}/src/sys/col.c
|
|
|
|
# ${PROJECT_SOURCE_DIR}/src/set/set.c
|
|
|
|
# ${PROJECT_SOURCE_DIR}/src/ast/ast.c
|
|
|
|
# ${PROJECT_SOURCE_DIR}/src/cfg/opt.c
|
|
|
|
# ${PROJECT_SOURCE_DIR}/src/io/files.c
|
|
|
|
# ${PROJECT_SOURCE_DIR}/src/mem/cache.c
|
|
|
|
# global_vars.c
|
|
|
|
# ${SOURCE_FILES})
|
|
|
|
#set_target_properties(global_vars
|
|
|
|
# PROPERTIES
|
|
|
|
# OUTPUT_NAME "global_vars"
|
|
|
|
# RUNTIME_OUTPUT_DIRECTORY ${GEMSTONE_BINARY_DIR}/tests/llvm)
|
|
|
|
#target_link_libraries(global_vars tomlc99)
|
|
|
|
#add_test(NAME global_vars
|
|
|
|
# WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/tests/llvm
|
|
|
|
# COMMAND ${GEMSTONE_BINARY_DIR}/tests/llvm/global_vars)
|