@@ -189,6 +189,11 @@ su2_cfd_src += files(['iteration/CIteration.cpp',
189189
190190su2_cfd_src += files ([' limiters/CLimiterDetails.cpp' ])
191191
192+ profiling_args = []
193+ if get_option (' enable-gprof' )
194+ profiling_args = [' -pg' ,' -no-pie' ]
195+ endif
196+
192197if get_option (' enable-normal' )
193198 su2_cfd_lib = static_library (' SU2core' ,
194199 su2_cfd_src,
@@ -201,7 +206,8 @@ if get_option('enable-normal')
201206 ' SU2_CFD.cpp' ,
202207 install : true ,
203208 dependencies : [su2_cfd_dep, su2_deps, common_dep],
204- cpp_args : [' -fPIC' ] + [default_warning_flags, su2_cpp_args])
209+ cpp_args : [' -fPIC' ] + [default_warning_flags, su2_cpp_args] + profiling_args,
210+ link_args : profiling_args)
205211endif
206212
207213if get_option (' enable-autodiff' )
@@ -216,7 +222,8 @@ if get_option('enable-autodiff')
216222 ' SU2_CFD.cpp' ,
217223 install : true ,
218224 dependencies : [su2_cfd_dep_ad, su2_deps, codi_dep, commonAD_dep],
219- cpp_args : [' -fPIC' ] + [default_warning_flags, su2_cpp_args, codi_rev_args])
225+ cpp_args : [' -fPIC' ] + [default_warning_flags, su2_cpp_args, codi_rev_args] + profiling_args,
226+ link_args : profiling_args)
220227endif
221228
222229if get_option (' enable-directdiff' )
@@ -231,6 +238,7 @@ if get_option('enable-directdiff')
231238 ' SU2_CFD.cpp' ,
232239 install : true ,
233240 dependencies : [su2_cfd_dep_dd, su2_deps, codi_dep, commonDD_dep],
234- cpp_args : [' -fPIC' ] + [default_warning_flags, su2_cpp_args, codi_for_args])
241+ cpp_args : [' -fPIC' ] + [default_warning_flags, su2_cpp_args, codi_for_args] + profiling_args,
242+ link_args : profiling_args)
235243endif
236244
0 commit comments