mirror of
				https://github.com/Z3Prover/z3
				synced 2025-11-03 21:09:11 +00:00 
			
		
		
		
	[CMake] CMake's default value for CMAKE_CXX_FLAGS includes /W3
				
					
				
			remove this so we can have fine grained control of warnings.
This commit is contained in:
		
							parent
							
								
									fe1af4bcdb
								
							
						
					
					
						commit
						fb403229bd
					
				
					 1 changed files with 7 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -15,6 +15,13 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
 | 
			
		|||
  # FIXME: Remove "x.." when CMP0054 is set to NEW
 | 
			
		||||
elseif ("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC")
 | 
			
		||||
  list(APPEND WARNING_FLAGS_TO_CHECK ${MSVC_WARNINGS})
 | 
			
		||||
 | 
			
		||||
  # CMake's default flags include /W3 already so remove them if
 | 
			
		||||
  # they already exist.
 | 
			
		||||
  if ("${CMAKE_CXX_FLAGS}" MATCHES "/W3")
 | 
			
		||||
    string(REPLACE "/W3" "" _cmake_cxx_flags_remove_w3 "${CMAKE_CXX_FLAGS}")
 | 
			
		||||
    set(CMAKE_CXX_FLAGS "${_cmake_cxx_flags_remove_w3}" CACHE STRING "" FORCE)
 | 
			
		||||
  endif()
 | 
			
		||||
else()
 | 
			
		||||
  message(AUTHOR_WARNING "Unknown compiler")
 | 
			
		||||
endif()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue