Skip to content

Commit

Permalink
build: Fix for Apple clang 14+ warnings (#1697)
Browse files Browse the repository at this point in the history
build: Fix for Apple clang 14 warnings

Add a MacOS 13 test to the CI matrix.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
  • Loading branch information
lgritz committed Jun 14, 2023
1 parent 49aac87 commit 6a5c50e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -451,14 +451,25 @@ jobs:
QT_BREW_VERSION="@5"
- desc: MacOS-12
os: macos-12
nametag: macos11-p310
nametag: macos12-p310
cc_compiler: /usr/local/opt/llvm@15/bin/clang
cxx_compiler: /usr/local/opt/llvm@15/bin/clang++
cxx_std: 17
python_ver: "3.10"
aclang: 13
setenvs: export LLVMBREWVER="@15" DO_BREW_UPDATE=1
OPENIMAGEIO_VERSION=master
- desc: MacOS-13
os: macos-13
nametag: macos13-p311
cc_compiler: /usr/local/opt/llvm@15/bin/clang
cxx_compiler: /usr/local/opt/llvm@15/bin/clang++
cxx_std: 17
python_ver: "3.11"
aclang: 14
setenvs: export LLVMBREWVER="@15" DO_BREW_UPDATE=1
OPENIMAGEIO_VERSION=master

runs-on: ${{matrix.os}}
env:
CXX: ${{matrix.cxx_compiler}}
Expand Down
1 change: 1 addition & 0 deletions src/cmake/compiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ if (CMAKE_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_APPLECLANG)
# Suppress warnings about our strategic use of bitwise operations in place
# of logical operators to produce branchless code in some places.
if (CLANG_VERSION_STRING VERSION_GREATER_EQUAL 14.0
OR APPLECLANG_VERSION_STRING VERSION_GREATER_EQUAL 14.0
OR INTELCLANG_VERSION_STRING VERSION_GREATER_EQUAL 14.0)
add_compile_options ("-Wno-bitwise-instead-of-logical")
endif ()
Expand Down
3 changes: 2 additions & 1 deletion src/liboslcomp/oslgram.y
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
#pragma clang diagnostic ignored "-Wparentheses-equality"
#endif

#if (OSL_CLANG_VERSION >= 150000) || (OSL_INTEL_CLANG_VERSION >= 140000)
#if (OSL_CLANG_VERSION >= 150000) || (OSL_APPLE_CLANG_VERSION >= 140000) \
|| (OSL_INTEL_CLANG_VERSION >= 140000)
#pragma clang diagnostic ignored "-Wunused-but-set-variable"
#endif

Expand Down
3 changes: 2 additions & 1 deletion src/liboslexec/osogram.y
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
#pragma clang diagnostic ignored "-Wparentheses-equality"
#endif

#if (OSL_CLANG_VERSION >= 150000) || (OSL_INTEL_CLANG_VERSION >= 140000)
#if (OSL_CLANG_VERSION >= 150000) || (OSL_APPLE_CLANG_VERSION >= 140000) \
|| (OSL_INTEL_CLANG_VERSION >= 140000)
#pragma clang diagnostic ignored "-Wunused-but-set-variable"
#endif

Expand Down

0 comments on commit 6a5c50e

Please sign in to comment.