Let CMake build position independent code by default
Configure CMake to compile static libraries with position independent code, as discussed in #451.
Closes #451.
Closes https://github.com/google/iree/pull/454
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/iree/pull/454 from marbre:cmake-fPIC d11b9a4b447deb3bce46d706e3acab2cbc785761
PiperOrigin-RevId: 289168946
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1017273..0f0cfae 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -66,6 +66,8 @@
string(JOIN " " CMAKE_CXX_FLAGS ${IREE_DEFAULT_COPTS})
+set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
+
#-------------------------------------------------------------------------------
# Third-party dependencies
#-------------------------------------------------------------------------------