-
-
Notifications
You must be signed in to change notification settings - Fork 201
feat: Add C++ modules support #1530
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
base: dev
Are you sure you want to change the base?
Changes from 7 commits
cc86cef
b9e4215
868782b
1d41aa9
ce88aff
7defeb8
15dbf83
6c828af
349c958
2eb60f1
6d39166
531227d
d887c03
8cf7f90
55eadfb
d87cb46
b1699de
ac09477
4a12d0c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,19 +28,41 @@ | |
| # libmpg123-dev | ||
| # dpp latest master with -DDPP_CORO=ON installed sytemwide | ||
|
|
||
| cmake_minimum_required (VERSION 3.16) | ||
| cmake_minimum_required (VERSION 3.28) | ||
|
braindigitalis marked this conversation as resolved.
|
||
| project(documentation_tests) | ||
|
|
||
| include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/colour.cmake") | ||
|
|
||
| set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDPP_CORO -std=c++20 -pthread -O0 -fPIC -rdynamic -DFMT_HEADER_ONLY -Wall -Wextra -Wpedantic -Werror -Wno-unused-parameter -Wno-deprecated-declarations") | ||
|
Jaskowicz1 marked this conversation as resolved.
|
||
| option(DPP_MODULES "Build examples with C++20 modules support" ON) | ||
|
|
||
| set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDPP_CORO -std=c++20 -pthread -O0 -fPIC -DFMT_HEADER_ONLY -Wall -Wextra -Wpedantic -Werror -Wno-unused-parameter -Wno-deprecated-declarations") | ||
| set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0") | ||
|
|
||
| # Create gcm.cache directory and symlink to the main build's dpp.gcm | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes I can see that, but why?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clang obtains the BMI paths through
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this necessary? I've not had to do this with any of my other projects |
||
| if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | ||
| file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/gcm.cache") | ||
| file(CREATE_LINK "${CMAKE_SOURCE_DIR}/../../build/library/CMakeFiles/dpp.dir/dpp.gcm" | ||
| "${CMAKE_BINARY_DIR}/gcm.cache/dpp.gcm" SYMBOLIC) | ||
| endif() | ||
|
|
||
| file(GLOB example_list ./*.cpp) | ||
| foreach (example ${example_list}) | ||
| get_filename_component(examplename ${example} NAME) | ||
| message(STATUS "Found example '${BoldBlue}${examplename}${ColourReset}'") | ||
| add_executable(${examplename}_out ${example}) | ||
| target_link_libraries(${examplename}_out dl dpp mpg123 oggz ogg opusfile opus) | ||
| include_directories(/usr/include/opus) | ||
|
|
||
| target_compile_definitions(${examplename}_out PRIVATE DPP_MODULES) | ||
| set_target_properties(${examplename}_out PROPERTIES CXX_SCAN_FOR_MODULES ON) | ||
|
|
||
| if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | ||
| target_compile_options(${examplename}_out PRIVATE -fmodules-ts) | ||
| elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") | ||
| target_compile_options(${examplename}_out PRIVATE | ||
| -fmodules | ||
| -mavx2 | ||
|
Jaskowicz1 marked this conversation as resolved.
Outdated
|
||
| -fprebuilt-module-path=${CMAKE_SOURCE_DIR}/../../build/library/CMakeFiles/dpp.dir | ||
| ) | ||
| endif() | ||
| endforeach(example) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,7 +23,7 @@ int main() | |
| }); | ||
|
|
||
| /* The interaction create event is fired when someone issues your commands */ | ||
| bot.on_slashcommand([&bot](const dpp::slashcommand_t & event) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need to change all the examples, it makes the PR much harder to review, so many files to go through.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've moved these changes into a separate PR, #1604 |
||
| bot.on_slashcommand([](const dpp::slashcommand_t & event) { | ||
|
|
||
| /* Check which command they ran */ | ||
| if (event.command.get_command_name() == "blep") { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.