Select copts for stblib based on compiler to fix MSVC unknown flag error. (#5928)

diff --git a/build_tools/third_party/stblib/CMakeLists.txt b/build_tools/third_party/stblib/CMakeLists.txt
index 39b754c..20d1a5e 100644
--- a/build_tools/third_party/stblib/CMakeLists.txt
+++ b/build_tools/third_party/stblib/CMakeLists.txt
@@ -14,6 +14,10 @@
 
 set(STBLIB_ROOT "${IREE_ROOT_DIR}/third_party/stblib/")
 
+iree_select_compiler_opts(_STBLIB_COPTS
+  CLANG
+    "-Wno-implicit-fallthrough"
+)
 
 external_cc_library(
   PACKAGE
@@ -25,7 +29,7 @@
   SRCS
     "stb_image.c"
   COPTS
-    "-Wno-implicit-fallthrough"
+    ${_STBLIB_COPTS}
   INCLUDES
     ${STBLIB_ROOT}
 )