Skip to content

build: make icons-hash-gen a proper target#2142

Open
PPN-SD wants to merge 1 commit into
jarun:masterfrom
PPN-SD:cross
Open

build: make icons-hash-gen a proper target#2142
PPN-SD wants to merge 1 commit into
jarun:masterfrom
PPN-SD:cross

Conversation

@PPN-SD

@PPN-SD PPN-SD commented Jun 10, 2026

Copy link
Copy Markdown

EDIT: so the project can be cross-compiled easier

@N-R-K

N-R-K commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

so it can be cross-compiled easier

The generator needs to run on the build/host system, not the target one. So I'm not sure why you would want to cross compile it. Can you elaborate a bit more about what problem this solves?

@PPN-SD

PPN-SD commented Jun 10, 2026

Copy link
Copy Markdown
Author

It's easier to compile native icons-hash-gen with a proper target.

@N-R-K

N-R-K commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

It's easier to compile native icons-hash-gen with a proper target.

If I understood correctly, instead of just running make, you're manually first compiling the meta program and then running your cross build?

I've actually thought about using CC_BUILD, CFLAGS_BUILD etc for the generator so that those can be set to the build machine and cross compilation wouldn't require manual multi-step but I don't do cross builds myself and wasn't sure if there's any conventions around it. Does that work for your use case?

@PPN-SD

PPN-SD commented Jun 10, 2026

Copy link
Copy Markdown
Author

If I understood correctly, instead of just running make, you're manually first compiling the meta program and then running your cross build?

That's it

I've actually thought about using CC_BUILD, CFLAGS_BUILD etc for the generator so that those can be set to the build machine and cross compilation wouldn't require manual multi-step but I don't do cross builds myself and wasn't sure if there's any conventions around it. Does that work for your use case?

CC_BUILD can't be used as-is and requires additional handling.

@jarun

jarun commented Jun 11, 2026

Copy link
Copy Markdown
Owner

@N-R-K is this good to go?

Comment thread Makefile Outdated

src/$(ICONS_INCLUDE): src/icons-hash.c src/icons.h src/icons-in-terminal.h
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -DICONS_GENERATE -o src/icons-hash-gen src/icons-hash.c
src/icons-hash-gen: src/icons-hash.c

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to depend on src/icons.h and src/icons-in-terminal.h as well otherwise generator will be using outdated icons.

@N-R-K

N-R-K commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

@N-R-K is this good to go?

Personally think it's better to be explicit about host vs target compiler instead: #2144.

so it can be cross-compiled easier

Signed-off-by: Nicolas PARLANT <nicolas.parlant@parhuet.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants