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

static builds of ACE ignore its build flags #225

Open
tehKaiN opened this issue Jun 2, 2024 · 1 comment
Open

static builds of ACE ignore its build flags #225

tehKaiN opened this issue Jun 2, 2024 · 1 comment

Comments

@tehKaiN
Copy link
Member

tehKaiN commented Jun 2, 2024

Steps to reproduce:

  • build libace.a with ACE_DEBUG cmake switch set to ON - this will set the define with same name
  • make install the ACE library
  • use find_library() to include libace in your project

Expected behavior:

  • ACE_DEBUG define persists and is used in ACE headers

Actual behavior:

  • ACE_DEBUG is not set when building user's project, because it's only set when calling the ACE's CMakeLists.txt

Possible solution variant 1:

When installing the library, create the cmake script which will be called upon finding the ACE library, which will set same defines as its build phase.
That could be done with generating custom FindACE.cmake and installing it along with the library.
This should work, but my gut tells me it's not the way to go.

Possible solution variant 2:

When building the library, ace_config.h could be created, which would store all the required ACE defines. this would also clear up the compile commands a bit, making it a bit lighter on parameter-specified defines. This works similarly to libjpeg and other "big" and "serious" libraries, so I think it's a good pattern to pursue.

@Vairn
Copy link
Contributor

Vairn commented Jun 4, 2024

Well, the libname_config.h is a common design/development pattern used for this situation, some libraries generate it, some have it so you can edit it to turn on/off features you want. Some even have a build/compile parameter where you can specify your own config file to use for the build.
Could be good, then we can add the USE_ECS_FEATURES, USE_AGA_FEATURES, ACE_DEBUG to it, and the compiler adapt accordingly.

Have to have a looksie if there are any other defines etc,

So it is a +1 from me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo asap
Development

No branches or pull requests

2 participants