Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update dependencies #55

Merged
merged 6 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Install Nix
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # v28
- name: Build
run: nix-shell --run '${{ github.workspace }}/bin/build_release.sh'
run: nix-shell --run 'build_release'

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Install Nix
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # v28
- name: Build
run: nix-shell --run '${{ github.workspace }}/bin/build_release.sh'
run: nix-shell --run 'build_release'

- name: Archive binary
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
Expand All @@ -59,22 +59,22 @@ jobs:
- name: Install Nix
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # v28
- name: Build
run: nix-shell --run '${{ github.workspace }}/bin/build_deb_package.sh'
run: nix-shell --run 'build_deb_package'

- name: Archive package
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: filc-${{ needs.metadata.outputs.version }}_deb
path: |
${{ github.workspace }}/build_deb_package/*.deb
${{ github.workspace }}/build_deb_package/*.deb.sha512
${{ github.workspace }}/out/deb_package/*.deb
${{ github.workspace }}/out/deb_package/*.deb.sha512
- name: Upload to release
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: xresloader/upload-to-github-release@26f7cc1d7d924dc9b6d5008808be8278b7177811 # v1.6.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "${{ github.workspace }}/build_deb_package/*.deb;${{ github.workspace }}/build_deb_package/*.deb.sha512"
file: "${{ github.workspace }}/out/deb_package/*.deb;${{ github.workspace }}/out/deb_package/*.deb.sha512"
tags: true

rpm:
Expand All @@ -87,20 +87,20 @@ jobs:
- name: Install Nix
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # v28
- name: Build
run: nix-shell --run '${{ github.workspace }}/bin/build_rpm_package.sh'
run: nix-shell --run 'build_rpm_package'

- name: Archive package
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: filc-${{ needs.metadata.outputs.version }}_rpm
path: |
${{ github.workspace }}/build_rpm_package/*.rpm
${{ github.workspace }}/build_rpm_package/*.rpm.sha512
${{ github.workspace }}/out/rpm_package/*.rpm
${{ github.workspace }}/out/rpm_package/*.rpm.sha512
- name: Upload to release
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: xresloader/upload-to-github-release@26f7cc1d7d924dc9b6d5008808be8278b7177811 # v1.6.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "${{ github.workspace }}/build_rpm_package/*.rpm;${{ github.workspace }}/build_rpm_package/*.rpm.sha512"
file: "${{ github.workspace }}/out/rpm_package/*.rpm;${{ github.workspace }}/out/rpm_package/*.rpm.sha512"
tags: true
12 changes: 6 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # v28
- name: Build then run
run: |
nix-shell --run '${{ github.workspace }}/bin/build_release.sh'
nix-shell --run 'build_release'

${{ github.workspace }}/filc

Expand All @@ -30,10 +30,10 @@ jobs:
- name: Install Nix
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # v28
- name: Run tests
run: nix-shell --run '${{ github.workspace }}/bin/run_unit_tests.sh'
run: nix-shell --run 'run_unit_tests'

- name: Build coverage
run: nix-shell --run '${{ github.workspace }}/bin/build_coverage.sh'
run: nix-shell --run 'build_coverage'
- name: Upload coverage report to Codacy
if: ${{ github.actor != 'dependabot[bot]' }}
uses: codacy/codacy-coverage-reporter-action@89d6c85cfafaec52c72b6c5e8b2878d33104c699 # v1.3.0
Expand All @@ -50,7 +50,7 @@ jobs:
- name: Install Nix
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # v28
- name: Run tests
run: nix-shell --run '${{ github.workspace }}/bin/run_e2e_tests.sh'
run: nix-shell --run 'run_e2e_tests'

clang-format:
name: "Run clang-format"
Expand All @@ -61,6 +61,6 @@ jobs:
- name: Install Nix
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # v28
- name: Run clang-format
run: nix-shell --run '${{ github.workspace }}/bin/run_clang-format.sh'
run: nix-shell --run 'run_clang-format'
- name: Check no changes
run: ${{ github.workspace }}/bin/check_no_changes.sh
run: nix-shell --run 'check_no_changes'
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build
filc
!include/*
!src/*
build_*
out
!bin/*
coverage.info
.idea
Expand Down
47 changes: 26 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
cmake_minimum_required(VERSION 3.22 FATAL_ERROR)

# Nix dependencies
file(GLOB NIX_STORE_LIB LIST_DIRECTORIES true "/nix/store/*/lib/cmake/*")
message(DEBUG NIX_STORE_LIB=${NIX_STORE_LIB})
list(APPEND CMAKE_PREFIX_PATH ${NIX_STORE_LIB})
file(GLOB NIX_STORE_BIN LIST_DIRECTORIES true "/nix/store/*/bin/")
message(DEBUG NIX_STORE_BIN=${NIX_STORE_BIN})
list(APPEND CMAKE_PROGRAM_PATH ${NIX_STORE_BIN})

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

set(CMAKE_CXX_STANDARD 17)
Expand All @@ -17,6 +25,8 @@ project(
include(FetchContent)
cmake_policy(SET CMP0135 NEW)

include(commands)

# _.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-.
# Library

Expand All @@ -34,24 +44,20 @@ else ()
endif ()

## Cxxopts
FetchContent_Declare(
cxxopts
GIT_REPOSITORY https://github.com/jarro2783/cxxopts.git
GIT_TAG 3bf268481da8208d171d8908e6491459de3651d7 #v3.2.0
)
FetchContent_MakeAvailable(cxxopts)
message(DEBUG cxxopts="${cxxopts_SOURCE_DIR}/include")
find_package(cxxopts 3.2.0 REQUIRED CONFIG)
message(STATUS "Found cxxopts ${cxxopts_PACKAGE_VERSION}")
message(STATUS "Located in: ${cxxopts_DIR}")
get_target_property(cxxopts_INCLUDE_DIR cxxopts::cxxopts INTERFACE_INCLUDE_DIRECTORIES)
message(STATUS "Included from: ${cxxopts_INCLUDE_DIR}")

## Antlr4
add_definitions(-DANTLR4CPP_STATIC)
set(ANTLR4_WITH_STATIC_CRT OFF)
set(ANTLR4_TAG 4.13.2)
set(ANTLR4_ZIP_REPOSITORY https://github.com/antlr/antlr4/archive/refs/tags/${ANTLR4_TAG}.zip)
set(ANTLR_EXECUTABLE ${PROJECT_SOURCE_DIR}/bin/antlr-${ANTLR4_TAG}-complete.jar)
find_package(antlr4-runtime 4.13.0 REQUIRED CONFIG)
message(STATUS "Found antlr ${ANTLR_VERSION}")
message(STATUS "Located in: ${antlr4-runtime_DIR}")
message(STATUS "Included from: ${ANTLR4_INCLUDE_DIR}")

include(ExternalAntlr4Cpp)
include_directories(${ANTLR4_INCLUDE_DIRS})
find_package(ANTLR REQUIRED)
find_program(ANTLR_EXECUTABLE antlr REQUIRED)
message(STATUS "Found antlr: ${ANTLR_EXECUTABLE}")

antlr_target(Lexer ${PROJECT_SOURCE_DIR}/src/grammar/FilLexer.g4 LEXER
PACKAGE filc)
Expand All @@ -61,10 +67,9 @@ antlr_target(Parser ${PROJECT_SOURCE_DIR}/src/grammar/FilParser.g4 PARSER
COMPILE_FLAGS -lib ${ANTLR_Lexer_OUTPUT_DIR})

## LLVM
find_package(LLVM REQUIRED CONFIG)

find_package(LLVM 18.1.8 REQUIRED CONFIG)
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
message(STATUS "Located in: ${LLVM_DIR}")

include_directories(${LLVM_INCLUDE_DIRS})
separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS})
Expand All @@ -77,7 +82,7 @@ foreach(target ${LLVM_TARGETS_TO_BUILD})
endforeach()

## filc lib
file(GLOB_RECURSE SRC_FILES
file(GLOB_RECURSE SRC_FILES CONFIGURE_DEPENDS filc_lib
"${PROJECT_SOURCE_DIR}/src/*.cpp"
"${PROJECT_SOURCE_DIR}/src/**/*.cpp"
)
Expand All @@ -88,8 +93,8 @@ target_link_libraries(filc_lib PRIVATE additional_config cxxopts::cxxopts antlr4

target_include_directories(filc_lib PUBLIC
"${PROJECT_SOURCE_DIR}/include"
"${cxxopts_SOURCE_DIR}/include"
${ANTLR4_INCLUDE_DIRS}
${cxxopts_INCLUDE_DIR}
${ANTLR4_INCLUDE_DIR}
${ANTLR_Lexer_OUTPUT_DIR}
${ANTLR_Parser_OUTPUT_DIR}
${LLVM_INCLUDE_DIRS})
Expand Down
Binary file removed bin/antlr-4.13.2-complete.jar
Binary file not shown.
13 changes: 0 additions & 13 deletions bin/build_coverage.sh

This file was deleted.

9 changes: 0 additions & 9 deletions bin/build_deb_package.sh

This file was deleted.

8 changes: 0 additions & 8 deletions bin/build_release.sh

This file was deleted.

11 changes: 0 additions & 11 deletions bin/build_rpm_package.sh

This file was deleted.

24 changes: 0 additions & 24 deletions bin/download_antlr.sh

This file was deleted.

10 changes: 0 additions & 10 deletions bin/run_clang-format.sh

This file was deleted.

9 changes: 0 additions & 9 deletions bin/run_e2e_tests.sh

This file was deleted.

9 changes: 0 additions & 9 deletions bin/run_unit_tests.sh

This file was deleted.

Loading
Loading