Build with optimization flags
I would like to build opencv4 with the following optimization flags:
-march=native -O3 -flto
What is the right way to specify those flags?
You can add -march=native -O3
to CMAKE_CXX_FLAGS
(or to CMAKE_CXX_FLAGS_config
where config
is RELEASE
, DEBUG
, etc).
You can enable LTO by setting ENABLE_LTO
build option.
Asked: 2019-04-19 05:59:50 -0600
Seen: 1,047 times
Last updated: Jun 23 '19