We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3774 - Cmake build fails for Android
Summary: Cmake build fails for Android
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: build (show other bugs)
Version: HG 2.1
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-24 17:24 UTC by sfalexrog
Modified: 2017-08-27 04:18 UTC (History)
0 users

See Also:


Attachments
Possible fix (2.46 KB, patch)
2017-08-24 17:24 UTC, sfalexrog
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description sfalexrog 2017-08-24 17:24:45 UTC
Created attachment 2886 [details]
Possible fix

Android haptic code was not added to CMakeLists.txt, leading to build failures when targeting Android platform.

Attached patch adds Android haptic driver to source sets and adds configuration parameter to SDL_config.h.cmake.

Note that this patch also exports SDL2, SDL2-static, and SDL2-main targets in order to integrate SDL2 as a subproject in a build system (it might not be a desirable thing for some). I'm not familiar with CMake versions and when stuff got added (and whether you can even use export() function at 2.8.11), I can only say that it seems to work somehow with CMake that's bundled with Android SDK (3.6).

To someone who's familiar with CMake: please do check the FILE parameter of export() call! I'm pretty sure I got it wrong.
Comment 1 Sam Lantinga 2017-08-27 04:18:28 UTC
The haptic fix is in:
https://hg.libsdl.org/SDL/rev/598839965877j

For the targets patch, please file a separate bug and attach it with an explanation for further review. I don't know CMake well enough to comment on that one.

Thanks!