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

Fix cstest build with Ninja #2506

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

thestr4ng3r
Copy link
Contributor

Your checklist for this pull request

  • I've documented or updated the documentation of every API function and struct this PR changes.
  • I've added tests that prove my fix is effective or that my feature works (if possible)

Detailed description

When building with Ninja, it is necessary to explicitly declare that the libcmocka.a and libcyaml.a files are built by their respective ExternalProject targets, otherwise it will refuse to build.

See also the documentation of BUILD_BYPRODUCTS in https://cmake.org/cmake/help/v3.31/module/ExternalProject.html#id13

Test plan

The following should not error:

florian-macbook:capstone florian$ cmake -Bbuild -GNinja -DCAPSTONE_BUILD_CSTEST=ON
-- The C compiler identification is AppleClang 16.0.0.16000026
-- The CXX compiler identification is AppleClang 16.0.0.16000026
(...)
-- Configuring done (0.6s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/florian/dev/capstone/build
florian-macbook:capstone florian$ ninja -Cbuild
ninja: Entering directory `build'
ninja: error: 'suite/cstest/extern/src/cmocka_ext-build/src/libcmocka.a', needed by 'suite/cstest/cstest', missing and no known rule to make it

When building with Ninja, it is necessary to explicitly declare that the
libcmocka.a and libcyaml.a files are built by their respective
ExternalProject targets, otherwise it will refuse to build.
Copy link
Member

@kabeor kabeor left a comment

Choose a reason for hiding this comment

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

Thank you! Merged.

@kabeor kabeor merged commit 7db9a08 into capstone-engine:next Oct 16, 2024
19 checks passed
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.

4 participants