@@ -189,6 +189,11 @@ su2_cfd_src += files(['iteration/CIteration.cpp',
189
189
190
190
su2_cfd_src += files ([' limiters/CLimiterDetails.cpp' ])
191
191
192
+ profiling_args = []
193
+ if get_option (' enable-gprof' )
194
+ profiling_args = [' -pg' ,' -no-pie' ]
195
+ endif
196
+
192
197
if get_option (' enable-normal' )
193
198
su2_cfd_lib = static_library (' SU2core' ,
194
199
su2_cfd_src,
@@ -201,7 +206,8 @@ if get_option('enable-normal')
201
206
' SU2_CFD.cpp' ,
202
207
install : true ,
203
208
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)
205
211
endif
206
212
207
213
if get_option (' enable-autodiff' )
@@ -216,7 +222,8 @@ if get_option('enable-autodiff')
216
222
' SU2_CFD.cpp' ,
217
223
install : true ,
218
224
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)
220
227
endif
221
228
222
229
if get_option (' enable-directdiff' )
@@ -231,6 +238,7 @@ if get_option('enable-directdiff')
231
238
' SU2_CFD.cpp' ,
232
239
install : true ,
233
240
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)
235
243
endif
236
244
0 commit comments