Skip to content

Commit

Permalink
build: support LTCG on MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
mochaaP committed Sep 14, 2024
1 parent b173824 commit cc0c6dc
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@ project(
],
)

cc = meson.get_compiler('c')

if cc.get_argument_syntax() == 'msvc'
if get_option('b_lto')
add_project_arguments(
'/GL', # -flto
language: 'c',
)
add_project_link_arguments(
'/LTCG',
language: 'c',
)
endif
endif

inc = include_directories('include')

dep = []
Expand Down

0 comments on commit cc0c6dc

Please sign in to comment.