From 6ebe8fb1315bf5cab707b069eefac5fa2583fa8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 5 Dec 2015 20:38:25 +0100 Subject: [PATCH] CMake: enable PIC by default when building static libs/plugins. Common use case is to have static libraries and dynamic plugins, which means that the static libraries need to have PIC enabled. --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 92bc57ac0..09f32734f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,10 +121,10 @@ if(BUILD_DEPRECATED) endif() option(BUILD_STATIC "Build static libraries (default are shared)" OFF) -option(BUILD_STATIC_PIC "Build static libraries and plugins with position-independent code" OFF) +option(BUILD_STATIC_PIC "Build static libraries and plugins with position-independent code" ON) option(BUILD_PLUGINS_STATIC "Build static plugins (default are dynamic)" OFF) -option(BUILD_TESTS "Build unit tests." OFF) -cmake_dependent_option(BUILD_GL_TESTS "Build unit tests for OpenGL code." OFF "BUILD_TESTS" OFF) +option(BUILD_TESTS "Build unit tests" OFF) +cmake_dependent_option(BUILD_GL_TESTS "Build unit tests for OpenGL code" OFF "BUILD_TESTS" OFF) if(BUILD_TESTS) enable_testing() endif()