get_headerpad_flags Function

public function get_headerpad_flags(self) result(flags)

Generate header padding flags for install_name_tool compatibility on macOS

Type Bound

compiler_t

Arguments

Type IntentOptional Attributes Name
class(compiler_t), intent(in) :: self

Return Value character(len=:), allocatable


Source Code

function get_headerpad_flags(self) result(flags)
    class(compiler_t), intent(in) :: self
    character(len=:), allocatable :: flags

    if (get_os_type() /= OS_MACOS) then
        flags = ""
        return
    end if

    ! Reserve enough space in the Mach-O header to safely add two install_name or rpath later
    flags = " -Wl,-headerpad,0x200"

end function get_headerpad_flags