Skip to content

Commit

Permalink
Change OS of CI to previous releases as latest one does not provide c…
Browse files Browse the repository at this point in the history
…lang-13
  • Loading branch information
grasph committed Jan 23, 2025
1 parent 2c86cf3 commit 7ef14ab
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 12 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@ jobs:
- '1.10'
- 'nightly'
os:
- ubuntu-latest
# - ubuntu-latest
- ubuntu-22.04
# - macOS-latest
arch:
- x64
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install liclang
- name: Install libclang
run: |
if [ "$RUNNER_OS" = Linux ]; then
sudo apt-get install clang-13 libclang-13-dev
Expand Down
28 changes: 20 additions & 8 deletions .github/workflows/test-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,24 @@ jobs:
- 'nightly'
os:
# - ubuntu-latest
- macOS-latest
# - macOS-latest
- macos-13
arch:
- x64
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install liclang
- name: Install libclang
run: |
if [ "$RUNNER_OS" = Linux ]; then
sudo apt-get install clang-13 libclang-13-dev
else #MacOS
brew install llvm@13
#brew install llvm@13 #llvm@13 no more supported by brew
wget "https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz"
tar xJf clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz
rm clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz
ln -s clang+llvm-13.0.0-x86_64-apple-darwin clang-13
fi
- uses: julia-actions/setup-julia@latest
with:
Expand All @@ -51,11 +56,18 @@ jobs:
if [ "$RUNNER_OS" = Linux ]; then
cmake -DClang_DIR=/usr/lib/llvm-13/lib/cmake/clang -B build -S .
else #MacOS
#cmake -DClang_DIR=/usr/local/Cellar/llvm@13/13.0.1_2/lib/cmake/clang/ -B build -S .
echo ls /opt/homebrew/opt/llvm@13/lib/cmake/clang
ls /opt/homebrew/opt/llvm@13/lib/cmake/clang
cmake -DClang_DIR=/opt/homebrew/opt/llvm@13/lib/cmake/clang -B build -S .
#echo "ls clang-13/"
#ls clang-13/
#echo "ls clang-13/lib"
#ls clang-13/lib
#echo "ls clang-13/lib/cmake"
#ls clang-13/lib/cmake
#echo "ls clang-13/lib/cmake/clang"
#ls clang-13/lib/cmake/clang
#cmake -DClang_DIR=`pwd`/clang-13/lib/cmake/clang -DLLVM_DIR=`pwd`/clang-13/lib/cmake/llvm -B build -S .
cmake -DClang_DIR=`pwd`/clang-13/lib/cmake/clang -B build -S .
fi
cmake --build build --verbose -j `nproc`
cmake --build build --verbose -j `sysctl -n hw.logicalcpu`
PATH="`pwd`/build:$PATH"
export SDKROOT="$(xcrun --sdk macosx --show-sdk-path)
cd test && ./runtests.jl
14 changes: 12 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,19 @@ else() # Using Clang_jll

set(SHARED_LIBS libclang clang-cpp LLVM)
foreach(shared_lib IN LISTS SHARED_LIBS)
add_library(${shared_lib} SHARED IMPORTED)
set(lib_path "${CLANG_PREFIX}/lib/lib${shared_lib}${CMAKE_SHARED_LIBRARY_SUFFIX}")
string(REPLACE liblib lib lib_path ${lib_path})
if(EXISTS "${lib_path}")
add_library(${shared_lib} SHARED IMPORTED)
else()
set(lib_path "${CLANG_PREFIX}/lib/lib${shared_lib}${CMAKE_STATIC_LIBRARY_SUFFIX}")
string(REPLACE liblib lib lib_path ${lib_path})
if(EXISTS "${lib_path}")
add_library(${shared_lib} STATIC IMPORTED)
else()
message(FATAL_ERROR "${shared_lib} libraray was not found in ${CLANG_PREFIX}/lib")
endif()
endif()
set_property(TARGET ${shared_lib} PROPERTY
IMPORTED_LOCATION ${lib_path})
endforeach()
Expand Down Expand Up @@ -129,7 +139,7 @@ add_executable(wrapit

add_dependencies(wrapit version)

target_link_libraries(wrapit PRIVATE libclang clang-cpp LLVM cxxopts dl
target_link_libraries(wrapit PRIVATE libclang clang-cpp cxxopts dl
OpenSSL::Crypto)
set_target_properties(wrapit PROPERTIES
CXX_STANDARD 17
Expand Down

0 comments on commit 7ef14ab

Please sign in to comment.