Skip to content

Commit 5274c3c

Browse files
authored
compiler warnings are errors (#1870)
1 parent 1762793 commit 5274c3c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ endif()
3030
add_compile_definitions("MLX_VERSION=${MLX_VERSION}")
3131

3232
# --------------------- Processor tests -------------------------
33-
3433
message(
3534
STATUS
3635
"Building MLX for ${CMAKE_SYSTEM_PROCESSOR} processor on ${CMAKE_SYSTEM_NAME}"
@@ -64,6 +63,7 @@ include(FetchContent)
6463
cmake_policy(SET CMP0135 NEW)
6564

6665
add_library(mlx)
66+
set_target_properties(mlx PROPERTIES COMPILE_WARNING_AS_ERROR ON)
6767

6868
if(MLX_BUILD_METAL)
6969
set(METAL_LIB "-framework Metal")

mlx/backend/cpu/gemms/bnns.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ void matmul_bnns(
4343

4444
BNNSDataType bnns_dtype = to_bnns_dtype(out.dtype());
4545

46+
#pragma GCC diagnostic push
47+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
4648
const BNNSLayerParametersBroadcastMatMul gemm_params{
4749
/* float alpha = */ alpha,
4850
/* float beta = */ beta,
@@ -124,6 +126,7 @@ void matmul_bnns(
124126
}
125127

126128
BNNSFilterDestroy(bnns_filter);
129+
#pragma GCC diagnostic pop
127130
}
128131

129132
template <>

0 commit comments

Comments
 (0)