diff --git a/cmake/OptimalOptions.cmake b/cmake/OptimalOptions.cmake
index ac450c99..c9ff881e 100644
--- a/cmake/OptimalOptions.cmake
+++ b/cmake/OptimalOptions.cmake
@@ -43,9 +43,11 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
 	IF(CMAKE_BUILD_TYPE STREQUAL "debug")
 		ADD_DEFINITIONS(-D_DEBUG)
 	ENDIF(CMAKE_BUILD_TYPE STREQUAL "debug")
+ENDIF(CMAKE_COMPILER_IS_GNUCXX)
 
+if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
 	SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
-ENDIF(CMAKE_COMPILER_IS_GNUCXX)
+ENDIF()
 
 IF(MSVC)
 	# @@ Some of these might only be available in VC8.
