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

Switch to cmake for builds #25

Merged
merged 65 commits into from
Dec 20, 2017
Merged

Switch to cmake for builds #25

merged 65 commits into from
Dec 20, 2017

Conversation

berkus
Copy link
Member

@berkus berkus commented Dec 3, 2017

  • Cleanup code in general
  • Remove custom types
  • Remove autoupdater
  • Add conan-based build

Obsoletes #22 - this one is ready to merge once tested successfully.

…cotire

subrepo:
  subdir:   "cotire"
  merged:   "516d78476"
upstream:
  origin:   "https://github.com/procxx/cotire.git"
  branch:   "stable"
  commit:   "516d78476"
git-subrepo:
  version:  "0.3.1"
  origin:   "???"
  commit:   "???"
…am/ThirdParty/libtgvoip

subrepo:
  subdir:   "Telegram/ThirdParty/libtgvoip"
  merged:   "651594b3"
upstream:
  origin:   "https://github.com/telegramdesktop/libtgvoip"
  branch:   "tdesktop"
  commit:   "651594b3"
git-subrepo:
  version:  "0.3.1"
  origin:   "???"
  commit:   "???"
…ty/variant

subrepo:
  subdir:   "Telegram/ThirdParty/variant"
  merged:   "237f83ca"
upstream:
  origin:   "https://github.com/mapbox/variant"
  branch:   "master"
  commit:   "237f83ca"
git-subrepo:
  version:  "0.3.1"
  origin:   "???"
  commit:   "???"
…Party/GSL

subrepo:
  subdir:   "Telegram/ThirdParty/GSL"
  merged:   "1c95f943"
upstream:
  origin:   "https://github.com/Microsoft/GSL.git"
  branch:   "master"
  commit:   "1c95f943"
git-subrepo:
  version:  "0.3.1"
  origin:   "???"
  commit:   "???"
…Party/Catch

subrepo:
  subdir:   "Telegram/ThirdParty/Catch"
  merged:   "63c097a07"
upstream:
  origin:   "https://github.com/philsquared/Catch"
  branch:   "master"
  commit:   "63c097a07"
git-subrepo:
  version:  "0.3.1"
  origin:   "???"
  commit:   "???"
subrepo:
  subdir:   "modules"
  merged:   "b6fbaff17"
upstream:
  origin:   "https://github.com/procxx/cmake-modules.git"
  branch:   "master"
  commit:   "b6fbaff17"
git-subrepo:
  version:  "0.3.1"
  origin:   "???"
  commit:   "???"
QMap<uint64, int32> msgsIds; // copied from feedMsgs
for (int32 i = 0, l = v->size(); i < l; ++i) {
QMap<uint64_t, int32_t> msgsIds; // copied from feedMsgs
for (int32_t i = 0, l = v->size(); i < l; ++i) {
Copy link
Member

Choose a reason for hiding this comment

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

Range-based for? size_t -> int32_t?

Copy link
Member Author

Choose a reason for hiding this comment

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

Created #35 as follow-up.

@@ -28,7 +39,6 @@ The source code is published under GPLv3 with OpenSSL exception, the license is
* liblzma ([public domain](http://tukaani.org/xz/))
* Google Breakpad ([License](https://chromium.googlesource.com/breakpad/breakpad/+/master/LICENSE))
* Google Crashpad ([Apache License 2.0](https://chromium.googlesource.com/crashpad/crashpad/+/master/LICENSE))
* GYP ([BSD License](https://github.com/bnoordhuis/gyp/blob/master/LICENSE))
* Ninja ([Apache License 2.0](https://github.com/ninja-build/ninja/blob/master/COPYING))
Copy link
Member

Choose a reason for hiding this comment

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

Is it still ever required for building?

Copy link
Member Author

@berkus berkus Dec 4, 2017

Choose a reason for hiding this comment

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

Gyp? no

@@ -104,7 +104,7 @@ void BoxContent::onDraggingScrollDelta(int delta) {
}

void BoxContent::onDraggingScrollTimer() {
auto delta = (_draggingScrollDelta > 0) ? qMin(_draggingScrollDelta * 3 / 20 + 1, int32(MaxScrollSpeed)) : qMax(_draggingScrollDelta * 3 / 20 - 1, -int32(MaxScrollSpeed));
auto delta = (_draggingScrollDelta > 0) ? qMin(_draggingScrollDelta * 3 / 20 + 1, int32_t(MaxScrollSpeed)) : qMax(_draggingScrollDelta * 3 / 20 - 1, -int32_t(MaxScrollSpeed));
Copy link
Member

Choose a reason for hiding this comment

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

May be use std::clamp or similar func?

Copy link
Member Author

Choose a reason for hiding this comment

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

Created #36 as a follow-up.

@@ -247,7 +247,7 @@ w/CVnbwQOw0g5GBwwFV3r0uTTvy44xx8XXxk+Qknu4eBCsmrAFNnAgMBAAE=\n\
#ifdef CUSTOM_API_ID
#include "../../../TelegramPrivate/custom_api_id.h" // Custom API id and API hash
#else
static const int32 ApiId = 17349;
static const int32_t ApiId = 17349;
Copy link
Member

Choose a reason for hiding this comment

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

(Just a note: this is an App ID. We will use your own here after moving from legacy)

Copy link
Member

Choose a reason for hiding this comment

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

@leha-bot, please file an issue for that!

Copy link
Member Author

Choose a reason for hiding this comment

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

Filed #37 as follow-up item.


#define BETA_VERSION_MACRO (0ULL)

constexpr int AppVersion = 1001023;
constexpr str_const AppVersionStr = "1.1.23";
constexpr str_const AppVersionStr = "1.1.23-procxx";
Copy link
Member

Choose a reason for hiding this comment

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

todo: use the CMake as a source for version number

Copy link
Member Author

@berkus berkus Dec 20, 2017

Choose a reason for hiding this comment

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

Created #34 as follow-up.

@@ -1396,7 +1396,7 @@ void InnerWidget::performDrag() {
// ) {
// uponSelected = false;
// } else {
// uint16 selFrom = _selected.cbegin().value().from, selTo = _selected.cbegin().value().to;
// uint16_t selFrom = _selected.cbegin().value().from, selTo = _selected.cbegin().value().to;
Copy link
Member

Choose a reason for hiding this comment

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

May be we should remove the whole commented piece of code


signals:

void saved(QString host, quint32 port, QString username, QString password);
Copy link
Member

Choose a reason for hiding this comment

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

Fucked pass by value!!!

Copy link
Member Author

Choose a reason for hiding this comment

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

This is fine :finnadie:

void play(const AudioMsgId &audio, int64 position = 0);
void play(const AudioMsgId &audio, std::unique_ptr<VideoSoundData> videoData, int64 position = 0);
void play(const AudioMsgId &audio, int64_t position = 0);
void play(const AudioMsgId &audio, std::unique_ptr<VideoSoundData> videoData, int64_t position = 0);
Copy link
Member

Choose a reason for hiding this comment

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

unique_ptr by value?

Copy link
Member Author

Choose a reason for hiding this comment

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

What if it's moved?

@@ -22,23 +22,24 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org

#include "core/basic_types.h"
#include "base/flags.h"
#include <cstdint>
Copy link
Member

Choose a reason for hiding this comment

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

Is it need? I saw the in core/basic_types.h

Copy link
Member Author

@berkus berkus Dec 4, 2017

Choose a reason for hiding this comment

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

We want to get rid of basic_types.h

<key>CFBundleGetInfoString</key>
<string>Telegram Desktop messaging app</string>
<string>pro.cxx Telegram messaging app</string>
Copy link
Member

Choose a reason for hiding this comment

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

TODO: I think that we should use the CMake features for app naming on each platform build

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok

Copy link
Member Author

Choose a reason for hiding this comment

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

Created #34 as follow-up.

Copy link
Member

@leha-bot leha-bot left a comment

Choose a reason for hiding this comment

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

Pretty cool. @crackedmind , @xvitaly , @mymedia2 , please check build on Windows, Fedora, Debian respectively

@berkus berkus merged commit 6ffc8d3 into procxx:dev Dec 20, 2017
@berkus berkus deleted the updated-cmake branch December 20, 2017 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:Enhancement This is a proposed improvement category:Help Wanted Volunteers to take this issue are sought after category:Infrastructure Related to build tools, automation category:Refactoring Related to code refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants