Skip to content

Commit

Permalink
Merge pull request #21 from denismakogon/arch
Browse files Browse the repository at this point in the history
including arch to lib name
  • Loading branch information
denismakogon authored Oct 12, 2023
2 parents f4eaf92 + 6133e8c commit 3cf11ac
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,22 @@ jobs:
- os: ubuntu-latest
TARGET: linux
PLATFORM: x64
LIB_EXT: so
- os: macos-latest
TARGET: macos
PLATFORM: x64
LIB_EXT: dylib
steps:
- name: 'Check out repository'
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: caching
uses: actions/cache@v3
id: cmakelists
with:
path: CMakeLists.txt
key: ${{ github.sha }}-${{ github.run_id }}

- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
Expand Down Expand Up @@ -59,8 +64,8 @@ jobs:
- name: artifacts
uses: actions/upload-artifact@v3
with:
name: libjudy.${{ matrix.LIB_EXT }}
path: build/libjudy.${{ matrix.LIB_EXT }}
name: libjudy.${{ matrix.TARGET }}
path: build/libjudy*
retention-days: 1

package:
Expand Down Expand Up @@ -152,13 +157,13 @@ jobs:
- name: libjudy.so
uses: actions/download-artifact@v3
with:
name: libjudy.so
name: libjudy.linux
path: build/src/main/resources/lib

- name: libjudy.dylib
uses: actions/download-artifact@v3
with:
name: libjudy.dylib
name: libjudy.macos
path: build/src/main/resources/lib

- name: Display structure of downloaded files
Expand Down
9 changes: 6 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ cmake_minimum_required(VERSION 3.24)

project(judy LANGUAGES C CXX VERSION 0.0.1 DESCRIPTION "Multithreaded CPP UDP server consumable through the C ABI consumption")

set(CMAKE_OSX_ARCHITECTURES "x86_64")

execute_process(COMMAND date +'%Y.%m.%d' OUTPUT_VARIABLE JAR_VERSION)
execute_process(COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE ARCHITECTURE)

if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(STDLIB_INCLUDE /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include)
Expand All @@ -23,11 +26,11 @@ message(STATUS "Found boost includes at " ${Boost_INCLUDE_DIR})
AUX_SOURCE_DIRECTORY(src SOURCES)

add_executable(${PROJECT_NAME}-main ${SOURCES} ${HEADERS})
add_library(${PROJECT_NAME} SHARED ${SOURCES} ${HEADERS})
add_library(${PROJECT_NAME}-${ARCHITECTURE} SHARED ${SOURCES} ${HEADERS})
target_include_directories(${PROJECT_NAME}-main PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_include_directories(${PROJECT_NAME}-${ARCHITECTURE} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_link_libraries(${PROJECT_NAME}-main ${Boost_LIBRARIES} )
target_link_libraries(${PROJECT_NAME} PRIVATE Threads::Threads)
target_link_libraries(${PROJECT_NAME}-${ARCHITECTURE} PRIVATE Threads::Threads)

add_custom_target(
java-sources
Expand Down

0 comments on commit 3cf11ac

Please sign in to comment.