Skip to content

Commit

Permalink
Merge pull request NixOS#6 from Pamplemousse/no_fortify_sources
Browse files Browse the repository at this point in the history
Disable `FORTIFY_SOURCE` when not optimizing
  • Loading branch information
polar authored Jul 12, 2021
2 parents 969ea76 + cad384d commit de209e8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ cpp = meson.get_compiler('cpp')
add_project_arguments(get_option('cxxflags'), language : 'cpp')
add_project_link_arguments(get_option('ldflags'), language: 'cpp')

if(get_option('optimization') == '0')
add_project_arguments('-U_FORTIFY_SOURCE',language:['cpp','c'])
message('Disabling FORTIFY_SOURCE as optimization is set to 0')
endif

cmake = import('cmake')
pkg = import('pkgconfig')
Expand Down

0 comments on commit de209e8

Please sign in to comment.