CMake: make root compile options and link libraries private

Should have done this in my previous changes. These options aren't meant
to be exposed to dependee targets. This also allows us to disable/remove
these options on a given target, without depender targets adding them
back.

Bug: b/145758253
Change-Id: Ieaba6824554d74e65d313409916bdf9ce4fd6182
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43928
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Tested-by: Antonio Maiorano <amaiorano@google.com>
diff --git a/src/Common/CMakeLists.txt b/src/Common/CMakeLists.txt
index fc7d1a5..b41dad7 100644
--- a/src/Common/CMakeLists.txt
+++ b/src/Common/CMakeLists.txt
@@ -76,11 +76,11 @@
 )
 
 target_compile_options(gl_common
-    PUBLIC
+    PRIVATE
         ${ROOT_PROJECT_COMPILE_OPTIONS}
 )
 
 target_link_libraries(gl_common
-    PUBLIC
+    PRIVATE
         ${ROOT_PROJECT_LINK_LIBRARIES}
 )
diff --git a/src/Device/CMakeLists.txt b/src/Device/CMakeLists.txt
index d7ca09c..8f5f234 100644
--- a/src/Device/CMakeLists.txt
+++ b/src/Device/CMakeLists.txt
@@ -69,7 +69,7 @@
 )
 
 target_compile_options(vk_device
-    PUBLIC
+    PRIVATE
         ${ROOT_PROJECT_COMPILE_OPTIONS}
 )
 
diff --git a/src/Main/CMakeLists.txt b/src/Main/CMakeLists.txt
index 34731fd..c548a72 100644
--- a/src/Main/CMakeLists.txt
+++ b/src/Main/CMakeLists.txt
@@ -77,7 +77,7 @@
 )
 
 target_compile_options(gl_main
-    PUBLIC
+    PRIVATE
         ${ROOT_PROJECT_COMPILE_OPTIONS}
 )
 
diff --git a/src/OpenGL/common/CMakeLists.txt b/src/OpenGL/common/CMakeLists.txt
index af00c37..61e838a 100644
--- a/src/OpenGL/common/CMakeLists.txt
+++ b/src/OpenGL/common/CMakeLists.txt
@@ -58,11 +58,11 @@
 )
 
 target_compile_options(libGLESCommon
-    PUBLIC
+    PRIVATE
         ${ROOT_PROJECT_COMPILE_OPTIONS}
 )
 
 target_link_libraries(libGLESCommon
-    PUBLIC
+    PRIVATE
         ${ROOT_PROJECT_LINK_LIBRARIES}
 )
diff --git a/src/Pipeline/CMakeLists.txt b/src/Pipeline/CMakeLists.txt
index 992865d..a4ca0cf 100644
--- a/src/Pipeline/CMakeLists.txt
+++ b/src/Pipeline/CMakeLists.txt
@@ -99,7 +99,7 @@
 )
 
 target_compile_options(vk_pipeline
-    PUBLIC
+    PRIVATE
         ${ROOT_PROJECT_COMPILE_OPTIONS}
 )
 
diff --git a/src/Reactor/CMakeLists.txt b/src/Reactor/CMakeLists.txt
index 965cbcc..eb9ac10 100644
--- a/src/Reactor/CMakeLists.txt
+++ b/src/Reactor/CMakeLists.txt
@@ -85,7 +85,7 @@
 )
 
 target_compile_options(ReactorSubzero
-    PUBLIC
+    PRIVATE
         ${ROOT_PROJECT_COMPILE_OPTIONS}
 )
 
@@ -120,7 +120,7 @@
 )
 
 target_compile_options(ReactorLLVM
-    PUBLIC
+    PRIVATE
         ${ROOT_PROJECT_COMPILE_OPTIONS}
 )
 
diff --git a/src/Renderer/CMakeLists.txt b/src/Renderer/CMakeLists.txt
index b3e166f..ae82434 100644
--- a/src/Renderer/CMakeLists.txt
+++ b/src/Renderer/CMakeLists.txt
@@ -83,7 +83,7 @@
 )
 
 target_compile_options(gl_renderer
-    PUBLIC
+    PRIVATE
         ${ROOT_PROJECT_COMPILE_OPTIONS}
 )
 
diff --git a/src/Shader/CMakeLists.txt b/src/Shader/CMakeLists.txt
index 5d3242d..7d75f55 100644
--- a/src/Shader/CMakeLists.txt
+++ b/src/Shader/CMakeLists.txt
@@ -67,7 +67,7 @@
 )
 
 target_compile_options(gl_shader
-    PUBLIC
+    PRIVATE
         ${ROOT_PROJECT_COMPILE_OPTIONS}
 )
 
diff --git a/src/System/CMakeLists.txt b/src/System/CMakeLists.txt
index bb5f305..09c4f49 100644
--- a/src/System/CMakeLists.txt
+++ b/src/System/CMakeLists.txt
@@ -65,6 +65,6 @@
 )
 
 target_compile_options(vk_system
-    PUBLIC
+    PRIVATE
         ${ROOT_PROJECT_COMPILE_OPTIONS}
 )
diff --git a/src/WSI/CMakeLists.txt b/src/WSI/CMakeLists.txt
index 509eb6a..e395165 100644
--- a/src/WSI/CMakeLists.txt
+++ b/src/WSI/CMakeLists.txt
@@ -70,7 +70,7 @@
 )
 
 target_compile_options(vk_wsi
-    PUBLIC
+    PRIVATE
         ${ROOT_PROJECT_COMPILE_OPTIONS}
 )
 
diff --git a/third_party/astc-encoder/CMakeLists.txt b/third_party/astc-encoder/CMakeLists.txt
index 300c08c..08b7e23 100644
--- a/third_party/astc-encoder/CMakeLists.txt
+++ b/third_party/astc-encoder/CMakeLists.txt
@@ -55,6 +55,6 @@
 )
 
 target_compile_options(astc-encoder
-    PUBLIC
+    PRIVATE
         ${ROOT_PROJECT_COMPILE_OPTIONS}
 )
diff --git a/third_party/subzero/CMakeLists.txt b/third_party/subzero/CMakeLists.txt
index 54d3d0f..70eb251 100644
--- a/third_party/subzero/CMakeLists.txt
+++ b/third_party/subzero/CMakeLists.txt
@@ -105,7 +105,7 @@
 )
 
 target_compile_options(subzero
-    PUBLIC
+    PRIVATE
         ${ROOT_PROJECT_COMPILE_OPTIONS}
         ${SUBZERO_COMPILE_OPTIONS}
 )