mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-11-30 20:26:05 -05:00
perf: build zm_zone.cpp with gcc's dynamic vector cost model so motion detection vectorizes at -O2, fixes #5482
This commit is contained in:
1 parent
8556830515
commit
ff052d5c68
1 file changed
+6
@@ -143,6 +143,12 @@ if(GSOAP_FOUND)
|
||||
|
||||
endif()
|
||||
|
||||
# GCC 12+ only vectorizes with its very-cheap cost model at -O2, which leaves the
|
||||
# per-pixel motion detection loop in zm_zone.cpp scalar in Release builds.
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
set_source_files_properties(zm_zone.cpp PROPERTIES COMPILE_OPTIONS "-fvect-cost-model=dynamic")
|
||||
endif()
|
||||
|
||||
# A fix for cmake recompiling the source files for every target.
|
||||
add_library(zm STATIC ${ZM_BIN_SRC_FILES})
|
||||
|
||||
|
||||
Reference in new issue
Block a user