diff --git a/CMakeLists.txt b/CMakeLists.txt index 7332b23..822a594 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -130,7 +130,7 @@ target_compile_definitions(sdbus-c++-objlib PRIVATE target_include_directories(sdbus-c++-objlib PUBLIC $ $) -if(DEFINED BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) - set_target_properties(sdbus-c++-objlib PROPERTIES POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS}) + set_target_properties(sdbus-c++-objlib PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() if(BUILD_LIBSYSTEMD) add_dependencies(sdbus-c++-objlib LibsystemdBuildProject)