Skip to content

Commit

Permalink
fix: check -municode before enabling it
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed May 18, 2022
1 parent bfe5a65 commit fbff4c1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Mingw.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ endmacro()
macro(mingw_unicode target)
is_mingw(_is_mingw)
if(${_is_mingw})
target_compile_definitions(${target} INTERFACE "UNICODE" "_UNICODE")
target_link_options(${target} INTERFACE "-municode")
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-municode" _cxx_supports_municode)
if(${_cxx_supports_municode})
target_compile_definitions(${target} INTERFACE "UNICODE" "_UNICODE")
target_compile_options(${target} INTERFACE "-municode")
endif()
endif()
endmacro()

0 comments on commit fbff4c1

Please sign in to comment.