Skip to content

make generator doesn't support headeronly targets #6382

@PierreEVEN

Description

@PierreEVEN

Xmake Version

v2.9.9

Operating System Version and Architecture

windows 11 / archlinux

Describe Bug

The make generator doesn't supports headeronly targets

The make generator try to find a linker for headeronly targets which is not relevant

target("test")
    set_kind("headeronly")
    add_headerfiles("./header.hpp")

xmake project -k make
error: no suitable linker for headeronly.{}

Expected Behavior

create ok!

Project Configuration

target("test")
    set_kind("headeronly")
    add_headerfiles("./header.hpp")

Additional Information and Error Logs

error: no suitable linker for headeronly.{}

Edit ⚠️ : also the cmake generator requires a header-only target to by of kind headeronly other wise it tries to find the language. So using static instead of headeronly is not a solution (although it works for make).

If I put static instead of headeronly :

CMake Error: Cannot determine link language for target "test".
CMake Error: CMake can not determine linker language for target: test

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions