Skip to content

feat: import dpp;#1400

Closed
Mishura4 wants to merge 7 commits intobrainboxdotcc:devfrom
Mishura4:modules
Closed

feat: import dpp;#1400
Mishura4 wants to merge 7 commits intobrainboxdotcc:devfrom
Mishura4:modules

Conversation

@Mishura4
Copy link
Member

proxy-image

There are still some things to iron out, but it works on clang, and almost works on MSVC...

Code change checklist

  • I have ensured that all methods and functions are fully documented using doxygen style comments.
  • My code follows the coding style guide.
  • I tested that my change works before raising the PR.
  • I have ensured that I did not break any existing API calls.
  • I have not built my pull request using AI, a static analysis tool or similar without any human oversight.

@netlify
Copy link

netlify bot commented Mar 13, 2025

Deploy Preview for dpp-dev ready!

Name Link
🔨 Latest commit 805ba6c
🔍 Latest deploy log https://app.netlify.com/sites/dpp-dev/deploys/67d33edfe660530007bebc88
😎 Deploy Preview https://deploy-preview-1400--dpp-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions github-actions bot added documentation Improvements or additions to documentation github_actions Pull requests that update GitHub Actions code build Issue or Pull Request related to the build process code Improvements or additions to code. labels Mar 13, 2025
@Mishura4
Copy link
Member Author

CONFLICTS? I just pulled the branch bruv

Also remind me to turn modules off by default in CMake before marking as ready

Copy link
Contributor

@braindigitalis braindigitalis left a comment

Choose a reason for hiding this comment

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

I know it's not part of this pr but I also think we should add a new CI entry for static link on Linux

option(DPP_USE_PCH "Use precompiled headers to speed up compilation" OFF)
option(AVX_TYPE "Force AVX type for speeding up audio mixing" OFF)
option(DPP_TEST_VCPKG "Force VCPKG build without VCPKG installed (for development use only!)" OFF)
option(DPP_MODULES "Support for C++20 modules" ON)
Copy link
Contributor

Choose a reason for hiding this comment

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

should this default to off? it is experimental

Copy link
Member Author

Choose a reason for hiding this comment

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

For sure yeah, that's just for my convenience while developing, I'll leave this unresolved so I don't forget to turn it off

@@ -0,0 +1,27 @@
cmake_minimum_required(VERSION 3.30)
Copy link
Contributor

Choose a reason for hiding this comment

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

the latest Ubuntu seems to only have 3.22, is this an acceptable version on msvc?

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe msvc ships with 3.30 yeah, although I can take it down to 3.28, 3.30 is import std; experimental support, I'll change it tomorrow

As for package managers, not my problem :kekw: but yeah that does mean OFF by default

* You can retrieve them with std::get().
*/
typedef std::variant<std::monostate, std::string, int64_t, bool, snowflake, double> command_value;
DPP_EXPORT typedef std::variant<std::monostate, std::string, int64_t, bool, snowflake, double> command_value;
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to export declarations that have no bodies in a cpp file?

Copy link
Member Author

Choose a reason for hiding this comment

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

The export in modules work a bit differently than Window's __declspec(dllexport) in that it's about names rather than definitions, a little bit like public and private in classes, so yes we need to export the names we introduce to be used as part of the API

* @param choice command_option_choice to be serialized
*/
void to_json(nlohmann::json& j, const command_option_choice& choice);
DPP_EXPORT void to_json(nlohmann::json& j, const command_option_choice& choice);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure these are supposed to be exported to the library user

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm I'll double check but if they're used by templates or if we want conversions from json etc they need to be visible which means exported

@ruslan-ilesik
Copy link
Contributor

First of all. Thank you for your contributions. All stuff u do is just crazy 👍.

I have a question. U specified that it works on clang and almost on MVSC. But what about g++? Is there issues porting it there. Or does g++
not support modules at the moment?

@Jaskowicz1
Copy link
Contributor

the fact this PR is "1400" too is satisfying

@Mishura4
Copy link
Member Author

Mishura4 commented Mar 13, 2025

@braindigitalis for sure I can add that

@ruslan-ilesik I believe g++14 has them experimental and g++15 (unreleased) has a lot of work in them, I'll test it as well, but I'm ready to ship it just for clang and msvc if it doesn't work on g++

@Mishura4
Copy link
Member Author

Mishura4 commented Apr 7, 2025

PR on hold, will reopen later

@Mishura4 Mishura4 closed this Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Issue or Pull Request related to the build process code Improvements or additions to code. documentation Improvements or additions to documentation github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants