Wireshark-dev: Re: [Wireshark-dev] /Qspectre
From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Mon, 9 Apr 2018 12:12:10 -0700
On Apr 9, 2018, at 11:58 AM, Maynard, Chris <Christopher.Maynard@xxxxxxx> wrote:

> Maybe there’s a way to detect whether /Qspectre is supported by the compiler or not and omit it if it isn’t in order to avoid all of these warnings?

	check_c_compiler_flag(-Qspectre C__Qspectre_VALID)
	if(C__Qspectre_VALID)
		set(CMAKE_C_FLAGS "-Qspectre ${CMAKE_C_FLAGS}")
	endif(C__Qspectre_VALID)

and similar for C++.  (I'm not sure whether you can use / or whether CMake expects - to be used even with Windows programs, translating it to / as necessary.)