Skip to content

Commit

Permalink
Add compile flags from conf.pri.windows file to cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocobo1 committed Sep 21, 2020
1 parent 04d3452 commit a675b93
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cmake/Modules/MacroQbtCommonConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,13 @@ macro(qbt_common_config)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()

if (MSVC)
target_compile_options(qbt_common_cfg INTERFACE /guard:cf)
target_link_options(qbt_common_cfg INTERFACE /guard:cf
$<$<NOT:$<CONFIG:Debug>>:/OPT:REF /OPT:ICF>
# suppress linking warning due to /INCREMENTAL and /OPT:ICF being both ON
$<$<CONFIG:RelWithDebInfo>:/INCREMENTAL:NO>
)
endif()

endmacro(qbt_common_config)

0 comments on commit a675b93

Please sign in to comment.