Forcing LLVM's rude forcing of /W4 and !NDEBUG off. (#3370)

Also tagging third-party dirs as SYSTEM (-Isystem).
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0911bbe..eb5a04b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -290,6 +290,10 @@
 #     dependency is added prior to including this configuration.
 #-------------------------------------------------------------------------------
 
+# Disable LLVM's warnings.
+set(LLVM_ENABLE_ASSERTIONS OFF CACHE STRING "don't use global flags /facepalm")
+set(LLVM_ENABLE_WARNINGS OFF CACHE STRING "don't use global flags /facepalm")
+
 # Adds bundled projects that must be included after the LLVM directory has
 # been added and within the scope of its settings (i.e. build type override,
 # etc).
@@ -300,13 +304,6 @@
 endfunction()
 
 function(add_iree_mlir_src_dep llvm_monorepo_path)
-  # If CMAKE_BUILD_TYPE is FastBuild, set to Debug for llvm
-  set(_CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}")
-  string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
-  if(NOT uppercase_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
-    set(CMAKE_BUILD_TYPE "Debug")
-  endif()
-
   # experimental model builder uses vulkan runner.
   if(${IREE_BUILD_EXPERIMENTAL})
     set(MLIR_VULKAN_RUNNER_ENABLED ON)
@@ -345,8 +342,8 @@
     include(HandleLLVMOptions)
 
     # Add include/link directories
-    include_directories(${LLVM_INCLUDE_DIRS})
-    include_directories(${MLIR_INCLUDE_DIRS})
+    include_directories(SYSTEM ${LLVM_INCLUDE_DIRS})
+    include_directories(SYSTEM ${MLIR_INCLUDE_DIRS})
     link_directories(${LLVM_BUILD_LIBRARY_DIR})
     add_definitions(${LLVM_DEFINITIONS})
   else()
diff --git a/build_tools/cmake/external_cc_library.cmake b/build_tools/cmake/external_cc_library.cmake
index 94f56dc..dd9799b 100644
--- a/build_tools/cmake/external_cc_library.cmake
+++ b/build_tools/cmake/external_cc_library.cmake
@@ -120,7 +120,7 @@
         ${_RULE_SRCS}
         ${_RULE_HDRS}
     )
-    target_include_directories(${_NAME}
+    target_include_directories(${_NAME} SYSTEM
       PUBLIC
         "$<BUILD_INTERFACE:${IREE_COMMON_INCLUDE_DIRS}>"
         "$<BUILD_INTERFACE:${_RULE_INCLUDES}>"
@@ -162,7 +162,7 @@
   else()
     # Generating header-only library
     add_library(${_NAME} INTERFACE)
-    target_include_directories(${_NAME}
+    target_include_directories(${_NAME} SYSTEM
       INTERFACE
         "$<BUILD_INTERFACE:${IREE_COMMON_INCLUDE_DIRS}>"
         "$<BUILD_INTERFACE:${_RULE_INCLUDES}>"
diff --git a/build_tools/cmake/flatbuffer_c_library.cmake b/build_tools/cmake/flatbuffer_c_library.cmake
index eb63567..24ee470 100644
--- a/build_tools/cmake/flatbuffer_c_library.cmake
+++ b/build_tools/cmake/flatbuffer_c_library.cmake
@@ -130,7 +130,7 @@
 
   add_library(${_NAME} INTERFACE)
   add_dependencies(${_NAME} ${_GEN_TARGET})
-  target_include_directories(${_NAME}
+  target_include_directories(${_NAME} SYSTEM
     INTERFACE
       "$<BUILD_INTERFACE:${IREE_COMMON_INCLUDE_DIRS}>"
       ${CMAKE_CURRENT_BINARY_DIR}
diff --git a/build_tools/cmake/flatbuffer_cc_library.cmake b/build_tools/cmake/flatbuffer_cc_library.cmake
index 86c38fc..52618de 100644
--- a/build_tools/cmake/flatbuffer_cc_library.cmake
+++ b/build_tools/cmake/flatbuffer_cc_library.cmake
@@ -113,7 +113,7 @@
 
   add_library(${_NAME} INTERFACE)
   add_dependencies(${_NAME} ${_GEN_TARGET})
-  target_include_directories(${_NAME}
+  target_include_directories(${_NAME} SYSTEM
     INTERFACE
       "$<BUILD_INTERFACE:${IREE_COMMON_INCLUDE_DIRS}>"
       ${CMAKE_CURRENT_BINARY_DIR}
diff --git a/build_tools/cmake/iree_cc_binary.cmake b/build_tools/cmake/iree_cc_binary.cmake
index 2c76d2d..5e71014 100644
--- a/build_tools/cmake/iree_cc_binary.cmake
+++ b/build_tools/cmake/iree_cc_binary.cmake
@@ -110,7 +110,7 @@
   else()
     set_target_properties(${_NAME} PROPERTIES OUTPUT_NAME "${_RULE_NAME}")
   endif()
-  target_include_directories(${_NAME}
+  target_include_directories(${_NAME} SYSTEM
     PUBLIC
       ${IREE_COMMON_INCLUDE_DIRS}
   )
diff --git a/build_tools/cmake/iree_cc_library.cmake b/build_tools/cmake/iree_cc_library.cmake
index 6f5e51f..e4d5b67 100644
--- a/build_tools/cmake/iree_cc_library.cmake
+++ b/build_tools/cmake/iree_cc_library.cmake
@@ -120,9 +120,12 @@
         ${_RULE_TEXTUAL_HDRS}
         ${_RULE_HDRS}
     )
-    target_include_directories(${_NAME}
+    target_include_directories(${_NAME} SYSTEM
       PUBLIC
         "$<BUILD_INTERFACE:${IREE_COMMON_INCLUDE_DIRS}>"
+    )
+    target_include_directories(${_NAME}
+      PUBLIC
         "$<BUILD_INTERFACE:${_RULE_INCLUDES}>"
     )
     target_compile_options(${_NAME}
@@ -167,7 +170,7 @@
   else()
     # Generating header-only library.
     add_library(${_NAME} INTERFACE)
-    target_include_directories(${_NAME}
+    target_include_directories(${_NAME} SYSTEM
       INTERFACE
         "$<BUILD_INTERFACE:${IREE_COMMON_INCLUDE_DIRS}>"
     )
diff --git a/build_tools/cmake/iree_cc_test.cmake b/build_tools/cmake/iree_cc_test.cmake
index a8b346f..5040343 100644
--- a/build_tools/cmake/iree_cc_test.cmake
+++ b/build_tools/cmake/iree_cc_test.cmake
@@ -80,7 +80,7 @@
     PRIVATE
       ${_RULE_SRCS}
   )
-  target_include_directories(${_NAME}
+  target_include_directories(${_NAME} SYSTEM
     PUBLIC
       ${IREE_COMMON_INCLUDE_DIRS}
   )
diff --git a/build_tools/cmake/iree_copts.cmake b/build_tools/cmake/iree_copts.cmake
index b96e041..9d99d9b 100644
--- a/build_tools/cmake/iree_copts.cmake
+++ b/build_tools/cmake/iree_copts.cmake
@@ -125,6 +125,12 @@
     "/wd4141"
     # 'WIN32_LEAN_AND_MEAN': macro redefinition
     "/wd4005"
+    "/wd4267"
+    "/wd4141"
+    "/wd4244"
+    "/wd4146"
+    "/wd4018"
+    "/wd4065"
     # TODO(benvanik): figure out if really required or accidentally enabled.
     "/EHsc"
     "/bigobj"
diff --git a/build_tools/cmake/rebuild.sh b/build_tools/cmake/rebuild.sh
index 2a8a7d4..7705f5d 100755
--- a/build_tools/cmake/rebuild.sh
+++ b/build_tools/cmake/rebuild.sh
@@ -35,7 +35,7 @@
   mkdir build
 fi
 cd build
-"$CMAKE_BIN" -G Ninja -DCMAKE_BUILD_TYPE=FastBuild \
+"$CMAKE_BIN" -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo \
                       -DIREE_BUILD_COMPILER=ON \
                       -DIREE_BUILD_TESTS=ON \
                       -DIREE_BUILD_SAMPLES=OFF \
diff --git a/docs/get_started/cmake_options_and_variables.md b/docs/get_started/cmake_options_and_variables.md
index 1a2237b..9886149 100644
--- a/docs/get_started/cmake_options_and_variables.md
+++ b/docs/get_started/cmake_options_and_variables.md
@@ -5,8 +5,7 @@
 #### `CMAKE_BUILD_TYPE`:STRING
 
 Sets the build type. Possible values are `Release`, `Debug`,
-`RelWithDebInfo`/`FastBuild` and `MinSizeRel`. If unset, build type is set to
-`Release`.
+`RelWithDebInfo` and `MinSizeRel`. If unset, build type is set to `Release`.
 
 #### `CMAKE_<LANG>_COMPILER`:STRING