Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to ignore headers for installation #2577

Closed
SirLynix opened this issue Jul 17, 2022 · 4 comments
Closed

Add a way to ignore headers for installation #2577

SirLynix opened this issue Jul 17, 2022 · 4 comments

Comments

@SirLynix
Copy link
Member

Is your feature request related to a problem? Please describe.

Some headers are only used internally, but yet are used by the project and we want those in generated projects (VS solution for example).

For example:

	-- Add header and source files
	local headerExts = {".h", ".hpp", ".inl", ".natvis"}
	for _, ext in ipairs(headerExts) do
		add_headerfiles("include/(Nazara/" .. name .. "/**" .. ext .. ")")
		add_headerfiles("src/Nazara/" .. name .. "/**" .. ext)
	end

However since some headers are private, they shouldn't be installed.

Describe the solution you'd like

A way to tell add_headerfiles to simply not install those headers, for example:

add_headerfiles("src/**.hpp", { private = true })

which would add it to projects but not install them.

Describe alternatives you've considered

Currently I'm using { prefixdir = "private" } which does separate private headers from actual one.

But that folder still gets installed.

Additional context

No response

@waruqi waruqi added this to the v2.7.1 milestone Jul 17, 2022
SirLynix added a commit to NazaraEngine/NazaraEngine that referenced this issue Jul 18, 2022
@waruqi
Copy link
Member

waruqi commented Jul 26, 2022

The default mode for all add_/set_ interfaces is private, so setting {private = true} doesn't seem to change anything.

target:get("headerfiles") can always get all values.

@SirLynix
Copy link
Member Author

That's not what I meant, I meant a way to tell xmake to consider those header files but not install them, only take them into account for project generation for example.
Maybe something like add_headerfiles("src/**.hpp", { install = false }) would be more appropriate.

waruqi added a commit that referenced this issue Jul 26, 2022
@waruqi
Copy link
Member

waruqi commented Jul 26, 2022

That's not what I meant, I meant a way to tell xmake to consider those header files but not install them, only take them into account for project generation for example. Maybe something like add_headerfiles("src/**.hpp", { install = false }) would be more appropriate.

I have supported it.

@SirLynix
Copy link
Member Author

It works great! Thank you.

SirLynix added a commit to NazaraEngine/ShaderLang that referenced this issue Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants