Use CMAKE_<LANG>_FLAGS_INIT (note the _INIT) variables to set the
target. This variable will set the corresponding CMAKE_<LANG>_FLAGS
variable, but is also used to initalize the CMAKE_REQUIRED_FLAGS for
various check_xxx functions such as check_include_file() or
check_symbol_exist(). This fixes the architecture mismatch issue.
Depends on D3031.