[libcxxabi] Don't enable -fvisibility=hidden on Windows (#207943)

This option is supported (and hence gets added by the
target_add_compile_flags_if_supported function) on Windows, but if using
dllexport, there's no point in using hidden visibility. (However if
building both static and shared libraries at the same time, it could be
beneficial to have hidden visibilty in the static libraries.)

In asserts enabled builds of Clang, building with -fvisibility=hidden
caused errors like this:

    dllexport GlobalValue must have default or protected visibility
    ptr @_ZTIv
    [...]
    fatal error: error in backend: Broken module found, compilation aborted!

Normally, combining -fvisibility=hidden with dllexport is not a problem,
but specifically for `__cxxabiv1:: __fundamental_type_info` it does make
Clang trigger an inconsistency, visible in asserts enabled builds of
Clang - see https://github.com/llvm/llvm-project/issues/207963.

This fixes Windows builds with Clang with asserts enabled, after
cb942d009a5ed029ce20d9b75b3604f551f0cb56.

GitOrigin-RevId: 5343b204252d7bf5bdfcacd664e78e9f7f9fd745
1 file changed