Skip to content
New issue

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

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

Already on GitHub? # to your account

Fixed CMakeLists.txt for Emscripten builds #403

Merged
merged 1 commit into from
May 14, 2024

Conversation

jonathanmarvens
Copy link
Contributor

The run-test262 target fails for Emscripten due to the ftw() usage.

The __run-test262__ target fails for Emscripten due to the `ftw()` usage.
@chqrlie
Copy link
Collaborator

chqrlie commented May 14, 2024

The run-test262 target fails for Emscripten due to the ftw() usage.

Of course run-test262 should not be built for this arch, it is only supposed to run on the host.
How can cmake be instructed to distinguish between host executables and target executables, yet not compile quickjs twice when host and target are identical?

@jonathanmarvens
Copy link
Contributor Author

The run-test262 target fails for Emscripten due to the ftw() usage.

Of course run-test262 should not be built for this arch, it is only supposed to run on the host. How can cmake be instructed to distinguish between host executables and target executables, yet not compile quickjs twice when host and target are identical?

@chqrlie That gets into the cross-compilation features of CMake, which I haven’t messed with in a long time. That said, I can experiment for a better solution that takes that into consideration, but can we at least get this PR in so that Emscripten builds are no longer broken?

@chqrlie
Copy link
Collaborator

chqrlie commented May 14, 2024

The run-test262 target fails for Emscripten due to the ftw() usage.

Of course run-test262 should not be built for this arch, it is only supposed to run on the host. How can cmake be instructed to distinguish between host executables and target executables, yet not compile quickjs twice when host and target are identical?

@chqrlie That gets into the cross-compilation features of CMake, which I haven’t messed with in a long time. That said, I can experiment for a better solution that takes that into consideration, but can we at least get this PR in so that Emscripten builds are no longer broken?

I am going to merge the patch. I would prefer a solution using make :)

@chqrlie chqrlie merged commit 5ca3c50 into quickjs-ng:master May 14, 2024
47 checks passed
@jonathanmarvens
Copy link
Contributor Author

@chqrlie Thank you.

I would prefer a solution using make :)

I try to avoid flame wars, so I generally do my best to keep my very strong and totally not nice opinions about CMake to myself. Haha.

Anyway, I’ll spend a bit of time experimenting on a better solution as promised.

@jonathanmarvens jonathanmarvens deleted the patch-1 branch May 14, 2024 06:50
@saghul
Copy link
Contributor

saghul commented May 14, 2024

I think testing for https://cmake.org/cmake/help/latest/variable/CMAKE_CROSSCOMPILING.html might be what we need.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants