Skip to content

Commit f4c89fe

Browse files
ScottWillcoxCopilotCopilot
authored
GRIDEDIT-1926 '-Wno-unused-parameters' behind optional configuration parameter (#517)
* GRIDEDIT-1926 '-Wno-unused-parameters' behind optional configuration. Only needed on MacOS15-intel runners * Update cmake/compiler_config.cmake Fix typo Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Remove unused ARCH_FLAG variable from workflow (#518) * Initial plan * Remove unused ARCH_FLAG variable Co-authored-by: ScottWillcox <54632073+ScottWillcox@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ScottWillcox <54632073+ScottWillcox@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
1 parent ed80a53 commit f4c89fe

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

.github/workflows/build-and-test-workflow.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,10 @@ jobs:
109109
# Step: CMake configuration
110110
- name: Configure
111111
run: |
112-
ARCH_FLAG=""
113-
if [ "${{ runner.arch }}" = "ARM64" ]; then
114-
ARCH_FLAG="-DCMAKE_OSX_ARCHITECTURES=arm64"
112+
SUPPRESS_PARAM_FLAG=""
113+
if [ "${{ inputs.platform }}" = "macos-15-intel" ]; then
114+
# Suppress unused parameter warnings on macOS 15 Intel runner (known platform-specific issue)
115+
SUPPRESS_PARAM_FLAG="-DSUPPRESS_UNUSED_PARAMETER_WARNING=ON"
115116
fi
116117
117118
cmake \
@@ -120,7 +121,7 @@ jobs:
120121
-DCMAKE_BUILD_TYPE=${{ inputs.build_type }} \
121122
-DCMAKE_PREFIX_PATH=${{ steps.paths.outputs.ext_deps_dir }}/netcdf-c/install/netcdf-c \
122123
-DCMAKE_INSTALL_PREFIX=${{ steps.paths.outputs.install_dir }} \
123-
$ARCH_FLAG \
124+
$SUPPRESS_PARAM_FLAG \
124125
-DOpenMP_C_FLAGS="-Xpreprocessor -fopenmp -I$HOMEBREW_PREFIX/opt/libomp/include" \
125126
-DOpenMP_CXX_FLAGS="-Xpreprocessor -fopenmp -I$HOMEBREW_PREFIX/opt/libomp/include" \
126127
-DOpenMP_C_LIB_NAMES="omp" \

cmake/compiler_config.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ if(APPLE)
1414
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
1515
message(STATUS "Configuring build for macOS with ${CMAKE_CXX_COMPILER_ID} (${CMAKE_CXX_COMPILER_VERSION}).")
1616
# Common warning and visibility flags
17-
add_compile_options("-fvisibility=hidden;-Wall;-Wextra;-pedantic;-Werror;-Wno-unused-function;-Wno-unused-parameter")
17+
add_compile_options("-fvisibility=hidden;-Wall;-Wextra;-pedantic;-Werror;-Wno-unused-function")
18+
# Conditionally suppress unused parameter warnings (used for platform-specific compiler issues)
19+
if(SUPPRESS_UNUSED_PARAMETER_WARNING)
20+
add_compile_options("-Wno-unused-parameter")
21+
message(STATUS "Suppressing -Wno-unused-parameter warnings for macOS Clang build on macOS15-intel")
22+
endif()
1823
# Be lenient for Eigen (deprecated enum conversion) on all macOS Clang builds
1924
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-deprecated-enum-enum-conversion>)
2025
# Optimization / debug flags

cmake/options.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,10 @@ option(
3737
"Includes source location information in customized exceptions."
3838
OFF
3939
)
40+
41+
# suppress unused parameter warnings (sometimes necessary for platform-specific builds)
42+
option(
43+
SUPPRESS_UNUSED_PARAMETER_WARNING
44+
"Suppress -Wno-unused-parameter warning flag (used for platform-specific compiler issues)."
45+
OFF
46+
)

0 commit comments

Comments
 (0)