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

Update CMake scripts #1365

Merged
merged 14 commits into from May 28, 2018

Conversation

Projects
None yet
3 participants
@Ghabry
Copy link
Member

Ghabry commented May 15, 2018

Requires the liblcf cmake PR to work.

This updates all the CMake stuff to use targets.

Works for Windows, Linux and MacOSX, including static builds.

Under Windows I have a vcpkg issue: The opus vcxproj file compiles a sample c++ file in which means the main is overwritten when linking static m(. Must be fixed in vcpkg repo.

Simplified the code a bit by making Wildmidi always ON, doesn't matter if SDL2 or SDL2_Mixer is used. Still no love for OpenAL yet ^^'.

Added a new magical function player_find_package to reduce code duplication.

@carstene1ns
Copy link
Member

carstene1ns left a comment

Not tested yet, but looks nice and clean.


project(EasyRPG_Player CXX C)
set(PACKAGE_VERSION "0.5.3")
project(EasyRPG_Player VERSION 0.5.3 LANGUAGES CXX C)

This comment has been minimized.

@carstene1ns

carstene1ns May 15, 2018

Member

Should be safe to remove C here.

This comment has been minimized.

@carstene1ns

# Source Files
set(PLAYER_SRCS
add_library(${PROJECT_NAME}_Static

This comment has been minimized.

@carstene1ns

carstene1ns May 15, 2018

Member

Does cmake still not support having different kinds of things (executable, library) with the same name? 👎 Maybe change the name to player_aux or something.
Also, this might be a shared library without explicit setting STATIC, no?

This comment has been minimized.

@Ghabry

Ghabry May 15, 2018

Author Member

is a static library by default because BUILD_SHARED_LIBS is OFF by default (strange default). But you are right, must force STATIC here.

Is not possible to have two targets with the same name but you can cheat:
https://gist.github.com/jlgerber/eafc4ee2b9954e27dd2bb009496b1b03#file-cmakelists-txt-L13
Will do this to get rid of _Static.

This comment has been minimized.

@carstene1ns

carstene1ns May 15, 2018

Member

nice, you are already using half of the cheat currently 👍

else()
message(STATUS "Resampler: None")
message(STATUS "Resampler: None")
endif()

This comment has been minimized.

@carstene1ns

carstene1ns May 15, 2018

Member

Maybe align everything with spaces (like the rest)?

This comment has been minimized.

@Ghabry

Ghabry May 15, 2018

Author Member

This was all really well aligned until fdela came and changed the Ogg playback string to Ogg vorbis playback :P.
Already played around with some alignments (and no alignments). The problem with no spacing at all is that it's harder to read IMHO.
But this change is obivously wrong, is wrong space to tab...... oO

This comment has been minimized.

@carstene1ns
@Ghabry

This comment has been minimized.

Copy link
Member Author

Ghabry commented May 18, 2018

good news: Even without vcpkg we can already switch to CMake completely.
I just need to rename pixman to pixman-1, then it works with my hand-rolled buildsystem.
Well and fix some linker errors ;).

@ras0219-msft

This comment has been minimized.

Copy link

ras0219-msft commented May 18, 2018

The opus issue should be fixed in vcpkg master!

@Ghabry

This comment has been minimized.

Copy link
Member Author

Ghabry commented May 18, 2018

@ras0219-msft
yepp this is what I planned to do 👍

@carstene1ns

This comment has been minimized.

Copy link
Member

carstene1ns commented May 18, 2018

Good, waiting for the (hopefully final) rebase.

@Ghabry

This comment has been minimized.

Copy link
Member Author

Ghabry commented May 18, 2018

oooh, I understood this wrong. The opus issue was already solved in the vcpkg package repo. Awesome :D

@Ghabry Ghabry force-pushed the Ghabry:cmake branch from 19aacd5 to e495ae3 May 19, 2018

Ghabry added some commits May 19, 2018

CMake: Bundle FindFreetype because the version with targets is not su…
…pport before CMake 3.11.

Handle the circular dependency on Harfbuzz in FindFreetype because the INTERFACE linkage is not supported before CMake 3.11.

@Ghabry Ghabry force-pushed the Ghabry:cmake branch from 6829ecd to 1f8a684 May 20, 2018

Ghabry added some commits May 21, 2018

CMake: Fix linking when PLAYER_AUDIO_BACKEND=SDL2_mixer is used. Fix …
…check in player_find_package when no CONDITION is provided.
@Ghabry

This comment has been minimized.

Copy link
Member Author

Ghabry commented May 21, 2018

Okay, that's enough (annoying) CMake work for now.

@carstene1ns
Copy link
Member

carstene1ns left a comment

Works as expected.

@carstene1ns carstene1ns merged commit a1ce052 into EasyRPG:master May 28, 2018

7 checks passed

Android (armeabi-v7a) Build finished.
Details
GCW0 Build finished.
Details
GNU/Linux Build finished.
Details
OSX Build finished.
Details
Windows (x64) Build finished.
Details
Windows (x86) Build finished.
Details
web Build finished.
Details

@carstene1ns carstene1ns referenced this pull request May 28, 2018

Open

Integrate external toolchains better #296

0 of 5 tasks complete

@Ghabry Ghabry deleted the Ghabry:cmake branch Sep 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.