cmake: Fix bug where -Wno- flags could not be compatbility-checked
cmake: Fix bug where -Wno- flags could not be compatbility-checked

It turns out that 'check_compiler_flag' has not been working for flags
that start with -Wno-. This has caused old compilers to accidentally
use flags that they do not support.

To fix this we check for compatibility with the appropriate -W flag
instead and infer the -Wno- compatibility from this check.

The root cause of this problem is explained well here:

https://github.com/zephyrproject-rtos/zephyr/pull/18922#discussion_r321537098

Signed-off-by: Sebastian Bøe <edee888afd63e94916688495334700803eba20a0@nordicsemi.no>

zephyrproject-rtos/zephyr,nashif/zephyr,galak/zephyr,finikorg/zephyr,Vudentz/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,Vudentz/zephyr,galak/zephyr,finikorg/zephyr,Vudentz/zephyr,galak/zephyr,nashif/zephyr,nashif/zephyr,Vudentz/zephyr,nashif/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,Vudentz/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,Vudentz/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,galak/zephyr