Skip to content

Commit 7d1ccf7

Browse files
authored
remove -Ofast for Clang to fix AppleClang deprecation warnings
AppleClang 17 is based on LLVM Clang 19, but its version number is numerically less than 19.0. Since `-Ofast` in Clang is equivalent to `-O3 -ffast-math`, `-Ofast` is redundant. This commit disables `-Ofast` for all Clang-based compilers (including AppleClang) to resolve the version mismatch and avoid future deprecation issues.
1 parent 08cef8d commit 7d1ccf7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ else()
372372
endif()
373373

374374
if(CMAKE_BUILD_TYPE MATCHES "(Release|RELEASE|release)")
375-
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten" AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0)))
375+
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten" AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) AND NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
376376
target_compile_options(ncnn PRIVATE -Ofast)
377377
endif()
378378

0 commit comments

Comments
 (0)