Skip to content

Commit

Permalink
Merge pull request #608 from ryuichis/gh-actions-mac-11
Browse files Browse the repository at this point in the history
Fix builds for latest macOS environment
  • Loading branch information
ryuichis committed Jul 1, 2021
2 parents b600d23 + 9fd04ae commit 977e51a
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-11.0]
os: [ubuntu-20.04, macos-11]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- run: sudo xcode-select -s /Applications/Xcode_12.4.app/Contents/Developer
if: matrix.os == 'macos-11.0'
- run: sudo xcode-select -s /Applications/Xcode_12.5.app/Contents/Developer
if: matrix.os == 'macos-11'
- run: cd oclint-scripts && ./gh-actions build
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docgen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-11.0]
os: [ubuntu-20.04, macos-11]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- run: sudo xcode-select -s /Applications/Xcode_12.4.app/Contents/Developer
if: matrix.os == 'macos-11.0'
- run: sudo xcode-select -s /Applications/Xcode_12.5.app/Contents/Developer
if: matrix.os == 'macos-11'
- run: cd oclint-scripts && ./gh-actions docgen
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-11.0]
os: [ubuntu-20.04, macos-11]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
Expand All @@ -18,9 +18,9 @@ jobs:
sudo apt-get install -y ninja-build
if: matrix.os == 'ubuntu-20.04'
- run: |
sudo xcode-select -s /Applications/Xcode_12.4.app/Contents/Developer
sudo xcode-select -s /Applications/Xcode_12.5.app/Contents/Developer
brew install ninja
if: matrix.os == 'macos-11.0'
if: matrix.os == 'macos-11'
- run: cd oclint-scripts && ./make && ./bundle -archive -release
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/system-llvm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:
./build -no-ninja -llvm-root=/usr/lib/llvm-12
./bundle -archive -llvm-root=/usr/lib/llvm-12
build-on-mac:
runs-on: macos-11.0
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- run: |
sudo xcode-select -s /Applications/Xcode_12.4.app/Contents/Developer
sudo xcode-select -s /Applications/Xcode_12.5.app/Contents/Developer
HOMEBREW_NO_AUTO_UPDATE=1 brew install llvm@12
- run: |
cd oclint-scripts
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ jobs:
deps: "core"
- module: "driver"
deps: "core"
runs-on: macos-11.0
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- run: sudo xcode-select -s /Applications/Xcode_12.4.app/Contents/Developer
- run: sudo xcode-select -s /Applications/Xcode_12.5.app/Contents/Developer
- env:
MODULE: ${{ matrix.module }}
DEPS: ${{ matrix.deps }}
Expand Down
4 changes: 2 additions & 2 deletions oclint-core/cmake/OCLintConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ SET(CMAKE_CXX_FLAGS "-std=c++14 ${CMAKE_CXX_LINKER_FLAGS} -fno-rtti -fPIC ${CMAK
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINKER_FLAGS} -fno-rtti")

IF(APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden -mmacosx-version-min=10.15")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -mmacosx-version-min=10.15")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden -mmacosx-version-min=11.0")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -mmacosx-version-min=11.0")
ENDIF()

IF(OCLINT_BUILD_TYPE STREQUAL "Release")
Expand Down
8 changes: 8 additions & 0 deletions oclint-scripts/clang
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ def setup_prebuilt_binary():
process.call('tar xf prebuilt.tar.xz -C ' + install_path + ' --strip-components=1')
path.cd(current_dir)

if environment.is_darwin():
llvm_exports_cmake_path = os.path.join(install_path, 'lib', 'cmake', 'llvm', 'LLVMExports.cmake')
llvm_exports_cmake_file = open(llvm_exports_cmake_path, 'r')
llvm_exports_cmake_lines = llvm_exports_cmake_file.readlines()
llvm_exports_cmake_lines[59] = ' INTERFACE_LINK_LIBRARIES "m;ZLIB::ZLIB;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libcurses.tbd;LLVMDemangle"'
llvm_exports_cmake_file = open(llvm_exports_cmake_path, 'w')
llvm_exports_cmake_file.writelines(llvm_exports_cmake_lines)
llvm_exports_cmake_file.close()

if args.clean:
clean_module()
Expand Down

0 comments on commit 977e51a

Please sign in to comment.