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

Rework libretro support in CMake #2353

Merged
merged 4 commits into from Sep 28, 2020
Merged

Rework libretro support in CMake #2353

merged 4 commits into from Sep 28, 2020

Conversation

Ghabry
Copy link
Member

@Ghabry Ghabry commented Sep 23, 2020

As this is not maintainable anymore I try to rewrite this now.
Marked as WIP, have to do many tests first.

Also updated libretro-common. Full of high quality "resync" commits.
https://github.com/libretro/libretro-common/commits/master

@Ghabry Ghabry added this to the 0.6.3 milestone Sep 23, 2020
CMakeLists.txt Outdated
# Must be at global scope, otherwise breaks -DPLAYER_BUILD_LIBLCF (see CMP0077)
option(BUILD_SHARED_LIBS "Build shared easyrpg_libretro core" ON)
if(BUILD_SHARED_LIBS)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
Copy link
Member Author

@Ghabry Ghabry Sep 23, 2020

Choose a reason for hiding this comment

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

TODO: This also enables fPic/Pie for non-libretro builds, not really something we need.

@Ghabry
Copy link
Member Author

Ghabry commented Sep 23, 2020

@fmatthew5876
can you check if this fixes the Visual STudio build for you?

@fmatthew5876
Copy link
Contributor

fmatthew5876 commented Sep 23, 2020

After rebasing all my pending PRs and rerunning cmake I haven't hit the error again. So I don't know if the error still exists.

I can confirm that I am able to build and link with this.

@Ghabry
Copy link
Member Author

Ghabry commented Sep 24, 2020

This results now in the following table which is what I wanted:
Is also not possible anymore that libretro fixes affect other builds because I operate now on a new easyrpg_libretro target instead of PROJECT_NAME.

Also still possible to provide CMAKE_POSITION_INDEPENDENT_CODE from the outside except for shared libs where OFF makes no sense (linker error).

PLATFORM SHARED_LIBS Result fpic?
SDL2 ON easyrpg-player NO
SDL2 OFF easyrpg-player NO
libretro ON easyrpg_libretro.so YES
libretro OFF easyrpg_libretro.a NO

@Ghabry Ghabry marked this pull request as ready for review Sep 24, 2020
@Ghabry Ghabry requested a review from fdelapena Sep 24, 2020
@fdelapena fdelapena merged commit 762b53d into EasyRPG:master Sep 28, 2020
7 checks passed
@Ghabry Ghabry added the backport to stable Pull requests with changes backported to our stable, maintenance branch label Sep 28, 2020
@Ghabry Ghabry deleted the cmake branch May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport to stable Pull requests with changes backported to our stable, maintenance branch Building
Development

Successfully merging this pull request may close these issues.

None yet

3 participants