![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /usr/share/cmake-3.16/Help/policy/ |
Upload File : |
CMP0083 ------- To control generation of Position Independent Executable (``PIE``) or not, some flags are required at link time. CMake 3.13 and lower did not add these link flags when :prop_tgt:`POSITION_INDEPENDENT_CODE` is set. The ``OLD`` behavior for this policy is to not manage ``PIE`` link flags. The ``NEW`` behavior is to add link flags if :prop_tgt:`POSITION_INDEPENDENT_CODE` is set: * Set to ``TRUE``: flags to produce a position independent executable are passed to the linker step. For example ``-pie`` for ``GCC``. * Set to ``FALSE``: flags not to produce a position independent executable are passed to the linker step. For example ``-no-pie`` for ``GCC``. * Not set: no flags are passed to the linker step. Since a given linker may not support ``PIE`` flags in all environments in which it is used, it is the project's responsibility to use the :module:`CheckPIESupported` module to check for support to ensure that the :prop_tgt:`POSITION_INDEPENDENT_CODE` target property for executables will be honored at link time. This policy was introduced in CMake version 3.14. Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly. Unlike most policies, CMake version |release| does not warn when this policy is not set and simply uses ``OLD`` behavior. .. Note:: Android platform has a special handling of ``PIE`` so it is not required to use the :module:`CheckPIESupported` module to ensure flags are passed to the linker. .. include:: DEPRECATED.txt Examples ^^^^^^^^ Behave like CMake 3.13 and do not apply any ``PIE`` flags at link stage. .. code-block:: cmake cmake_minimum_required(VERSION 3.13) project(foo) # ... add_executable(foo ...) set_property(TARGET foo PROPERTY POSITION_INDEPENDENT_CODE TRUE) Use the :module:`CheckPIESupported` module to detect whether ``PIE`` is supported by the current linker and environment. Apply ``PIE`` flags only if the linker supports them. .. code-block:: cmake cmake_minimum_required(VERSION 3.14) # CMP0083 NEW project(foo) include(CheckPIESupported) check_pie_supported() # ... add_executable(foo ...) set_property(TARGET foo PROPERTY POSITION_INDEPENDENT_CODE TRUE)