File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -189,14 +189,16 @@ if(CV_GCC OR CV_CLANG)
189
189
190
190
# Profiling?
191
191
if (ENABLE_PROFILING)
192
- add_extra_compiler_option("-pg -g" )
193
192
# turn off incompatible options
194
193
foreach (flags CMAKE_CXX_FLAGS CMAKE_C_FLAGS CMAKE_CXX_FLAGS_RELEASE CMAKE_C_FLAGS_RELEASE CMAKE_CXX_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG
195
194
OPENCV_EXTRA_FLAGS_RELEASE OPENCV_EXTRA_FLAGS_DEBUG OPENCV_EXTRA_C_FLAGS OPENCV_EXTRA_CXX_FLAGS)
196
195
string (REPLACE "-fomit-frame-pointer" "" ${flags} "${${flags} }" )
197
196
string (REPLACE "-ffunction-sections" "" ${flags} "${${flags} }" )
198
197
string (REPLACE "-fdata-sections" "" ${flags} "${${flags} }" )
199
198
endforeach ()
199
+ # -pg should be placed both in the linker and in the compiler settings
200
+ set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg" )
201
+ add_extra_compiler_option("-pg -g" )
200
202
else ()
201
203
if (MSVC )
202
204
# TODO: Clang/C2 is not supported
You can’t perform that action at this time.
0 commit comments