diff --git a/.github/workflows/dialyzer.yml b/.github/workflows/dialyzer.yml index 10e75ad..c08a01b 100644 --- a/.github/workflows/dialyzer.yml +++ b/.github/workflows/dialyzer.yml @@ -14,14 +14,14 @@ jobs: elixir-version: "1.15" - name: Restore Cached Dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 id: mix-cache with: path: deps key: ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-${{ hashFiles('mix.lock') }} - name: Restore PLT cache - uses: actions/cache@v3 + uses: actions/cache@v4 id: plt-cache with: key: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e5369f0..a44a7b2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: - run: sudo apt-get install -y inotify-tools - name: Restore Cached Dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 id: mix-cache with: path: deps @@ -38,7 +38,8 @@ jobs: run: mix coveralls.json - name: Upload Coverage Reports - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: directory: ./cover fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/CMakeLists.txt b/CMakeLists.txt index 171cc18..8d6a870 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,8 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED True) +set(LINK_OPTIONS -fPIC -O3) + if(NOT DEFINED ENV{MIX_APP_PATH}) set(MIX_APP_PATH ${PROJECT_SOURCE_DIR}) else() @@ -24,7 +26,12 @@ cmake_path(APPEND PRIV_PATH ${MIX_COMPILE_PATH} "../priv") add_library(nif SHARED c_src/atomic_int.cpp) target_include_directories(nif SYSTEM PUBLIC ${ERTS_INCLUDE_DIR}) -target_link_options(nif PUBLIC -undefined dynamic_lookup) + +if(APPLE) + target_link_options(nif PUBLIC ${LINK_OPTIONS} -undefined dynamic_lookup -flat_namespace) +elseif(LINUX) + target_link_options(nif PUBLIC ${LINK_OPTIONS}) +endif() add_custom_command( TARGET nif POST_BUILD