mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-11-04 05:59:32 +01:00 
			
		
		
		
	Force MSVC to use utf-8
This commit is contained in:
		@@ -330,16 +330,15 @@ if (BUILD_TESTING AND NOT_SUBPROJECT)
 | 
				
			|||||||
        coverage_evaluate()
 | 
					        coverage_evaluate()
 | 
				
			||||||
    endif()
 | 
					    endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Add desired warnings
 | 
					    # Add per compiler options
 | 
				
			||||||
    if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang|AppleClang|GNU" )
 | 
					    if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang|AppleClang|GNU" )
 | 
				
			||||||
        target_compile_options( SelfTest PRIVATE -Wall -Wextra -Wunreachable-code -Wpedantic)
 | 
					        target_compile_options( SelfTest PRIVATE -Wall -Wextra -Wunreachable-code -Wpedantic)
 | 
				
			||||||
        if (CATCH_ENABLE_WERROR)
 | 
					        if (CATCH_ENABLE_WERROR)
 | 
				
			||||||
            target_compile_options( SelfTest PRIVATE -Werror)
 | 
					            target_compile_options( SelfTest PRIVATE -Werror)
 | 
				
			||||||
        endif()
 | 
					        endif()
 | 
				
			||||||
    endif()
 | 
					    endif()
 | 
				
			||||||
    # Clang specific warning go here
 | 
					    # Clang specific options go here
 | 
				
			||||||
    if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
 | 
					    if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
 | 
				
			||||||
        # Actually keep these
 | 
					 | 
				
			||||||
        target_compile_options( SelfTest PRIVATE -Wweak-vtables -Wexit-time-destructors -Wglobal-constructors -Wmissing-noreturn )
 | 
					        target_compile_options( SelfTest PRIVATE -Wweak-vtables -Wexit-time-destructors -Wglobal-constructors -Wmissing-noreturn )
 | 
				
			||||||
    endif()
 | 
					    endif()
 | 
				
			||||||
    if ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
 | 
					    if ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
 | 
				
			||||||
@@ -348,6 +347,8 @@ if (BUILD_TESTING AND NOT_SUBPROJECT)
 | 
				
			|||||||
        if (CATCH_ENABLE_WERROR)
 | 
					        if (CATCH_ENABLE_WERROR)
 | 
				
			||||||
            target_compile_options( SelfTest PRIVATE /WX)
 | 
					            target_compile_options( SelfTest PRIVATE /WX)
 | 
				
			||||||
        endif()
 | 
					        endif()
 | 
				
			||||||
 | 
					        # Force MSVC to consider everything as encoded in utf-8
 | 
				
			||||||
 | 
					        target_compile_options( SelfTest PRIVATE /utf-8 )
 | 
				
			||||||
    endif()
 | 
					    endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user