Skip to content
This repository has been archived by the owner on Jun 29, 2024. It is now read-only.

Commit

Permalink
Add LLVM to CMakeLists.txt
Browse files Browse the repository at this point in the history
+ add it to tests workflow
  • Loading branch information
Gashmob committed Aug 31, 2023
1 parent 1eafecd commit 06adaff
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ jobs:
with:
distribution: 'temurin'
java-version: '17'
- name: Install LLVM
uses: KyleMayes/install-llvm-action@v1
with:
version: "15"

- name: Configure CMake
if: ${{ matrix.os == 'ubuntu-latest' }}
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
project(
Filc
VERSION 0.2.1
LANGUAGES CXX
LANGUAGES CXX C
)

# _.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-.
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ grammar : [https://fil.ktraini.com/doc/advanced/grammar](https://fil.ktraini.com
- [Setup Java](https://github.com/marketplace/actions/setup-java-jdk)
- [Codecov coverage report](https://github.com/marketplace/actions/codecov)
- [Codacy coverage report](https://github.com/marketplace/actions/codacy-coverage-reporter)
- [Zip action](https://github.com/montudor/action-zip)
- [Upload to release](https://github.com/JasonEtco/upload-to-release)
- [Zip action](https://github.com/marketplace/actions/action-zip)
- [Upload to release](https://github.com/marketplace/actions/upload-to-release)
- [Install LLVM](https://github.com/marketplace/actions/install-llvm-and-clang)

### `version.sh`

Expand Down
22 changes: 11 additions & 11 deletions src/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,16 @@ antlr_target(Parser ${PROJECT_SOURCE_DIR}/src/lib/grammar/FilParser.g4 PARSER

## _.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-.
## LLVM section
#
#find_package(LLVM REQUIRED CONFIG)
#
#message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
#message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
#
#include_directories(${LLVM_INCLUDE_DIRS})
#separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS})
#add_definitions(${LLVM_DEFINITIONS})
#
#llvm_map_components_to_libnames(llvm_libs support core irreader)

find_package(LLVM 15 REQUIRED)

message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")

separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS})
add_definitions(${LLVM_DEFINITIONS})

llvm_map_components_to_libnames(llvm_libs support core irreader)

# _.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-.
# Lib section
Expand Down Expand Up @@ -102,6 +101,7 @@ target_include_directories(compiler_lib PUBLIC
${ANTLR4_INCLUDE_DIRS}
${ANTLR_Lexer_OUTPUT_DIR}
${ANTLR_Parser_OUTPUT_DIR}
${LLVM_INCLUDE_DIRS}
../../lib)
target_link_libraries(compiler_lib PUBLIC additional_config antlr4_static)

Expand Down

0 comments on commit 06adaff

Please sign in to comment.