Skip to content

[build] CMake: Introduce DownloadProject module#851

Merged
Frenzie merged 2 commits intokoreader:masterfrom
Frenzie:use-cmake-better
Mar 13, 2019
Merged

[build] CMake: Introduce DownloadProject module#851
Frenzie merged 2 commits intokoreader:masterfrom
Frenzie:use-cmake-better

Conversation

@Frenzie
Copy link
Copy Markdown
Member

@Frenzie Frenzie commented Mar 12, 2019

This module is like FetchContent in CMake 3.11, but for the moment it may be more inviting to hackers not to require that yet.

The principle is explained here: https://crascit.com/2015/07/25/cmake-gtest/

It allows us to work with CMake in a more natural environment for CMake-submodules, which are otherwise nigh-uncontrollable in between escaping variables in CMake syntax and CMake being extremely bad at taking command-line arguments. (A fact I utterly despise as a regular user just downloading a project to compile & try.)

Upping the minimum CMake version over 3.3 should also allow us to get rid of a few braindead Android-related workarounds for sdcv, where we had to completely force-feed the .a suffix.

Frenzie added 2 commits March 12, 2019 23:39
This module is like FetchContent in CMake 3.11, but for the moment it may be more inviting to hackers not to require that yet.

The principle is explained here: https://crascit.com/2015/07/25/cmake-gtest/

It allows us to work with CMake in a more natural environment for CMake-submodules, which are otherwise nigh-uncontrollable in between escaping variables in CMake syntax and CMake being extremely bad at taking command-line arguments. (A fact I utterly despise as a regular user just downloading a project to compile & try.)

Upping the minimum CMake version over 3.3 should also allow us to get rid of a few braindead Android-related workarounds for sdcv, where we had to completely force-feed the `.a` suffix.
Copy link
Copy Markdown
Member

@NiLuJe NiLuJe left a comment

Choose a reason for hiding this comment

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

I won't pretend to actually be able to follow CMake's arcane logic, but I get the idea, and this looks sound ;).

@Frenzie Frenzie merged commit 2540b18 into koreader:master Mar 13, 2019
@Frenzie Frenzie deleted the use-cmake-better branch March 13, 2019 21:22
@Frenzie
Copy link
Copy Markdown
Member Author

Frenzie commented Mar 14, 2019

Drat, I hadn't noticed that the binary seems to be slightly larger. It's not as if 100-200 kB matters that much in the grand scheme of things, but still… I'd like to know why. mumble, mumble, mumble

Edit: it might be accidentally being built as debug instead of release, come to think of it.

@Frenzie
Copy link
Copy Markdown
Member Author

Frenzie commented Mar 14, 2019

Oh, this is my own fault. I added a stub but this was never quite properly implemented:

# will have to be passed as -DCMAKE_BUILD_TYPE to $(CMAKE) invocations
CMAKE_BUILD_TYPE:=Debug
export CMAKE_BUILD_TYPE

-DCMAKE_BUILD_TYPE=Release \

Frenzie added a commit to Frenzie/koreader-base that referenced this pull request Mar 14, 2019
I added a stub sometime last year, but never finished implementing it.

Cf. koreader#851 (comment)
Frenzie added a commit that referenced this pull request Mar 14, 2019
I added a stub sometime last year, but never finished implementing it.

Cf. #851 (comment)
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.

2 participants