Enable linking against libSPIRV-Tools from linux shared libraries
authorChris Forbes <chrisforbes@google.com>
Sun, 3 Apr 2016 22:21:35 +0000 (10:21 +1200)
committerChris Forbes <chrisforbes@google.com>
Sun, 3 Apr 2016 22:21:35 +0000 (10:21 +1200)
Required for linking against libSPIRV-Tools from LVL's
libVkLayer_core_validation.so.

Signed-off-by: Chris Forbes <chrisforbes@google.com>
CMakeLists.txt

index 9609f19..161a22e 100644 (file)
@@ -29,6 +29,8 @@ project(spirv-tools)
 enable_testing()
 set(SPIRV_TOOLS "SPIRV-Tools")
 
+set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+
 if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
   add_definitions(-DSPIRV_LINUX)
 elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")