Skip to content

Commit

Permalink
Remove dependency on C++23
Browse files Browse the repository at this point in the history
  • Loading branch information
lpugin committed Nov 14, 2024
1 parent 1cf372c commit b06d097
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Verovio.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5169,7 +5169,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "c++23";
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
Expand Down Expand Up @@ -5229,7 +5229,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "c++23";
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
Expand Down
6 changes: 2 additions & 4 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ if(MSVC)
add_definitions(/wd4244) # suppress warning of possible loss of precision
add_definitions(-DNO_PAE_SUPPORT) # regex is working differently under Windows so PAE is not supported (yet)
add_definitions(-DUSE_PAE_OLD_PARSER)
add_definitions(/std:c++latest)
add_definitions(/std:c++20)
include_directories(../include/win32)
else()
if(CMAKE_BUILD_TYPE MATCHES Debug)
Expand All @@ -64,9 +64,7 @@ else()
# jsonxx raises -Wdollar-in-identifier-extension
# gcc 8.3.1 does not like -Wdollar-in-identifier-extension option.
add_definitions(-Wall -W -pedantic -Wno-unused-parameter -Wno-dollar-in-identifier-extension)
add_definitions(-std=c++23)
add_definitions(-std=c++2b)
add_definitions(-std=gnu++2b)
add_definitions(-std=c++20)

# extra warnings similar to Xcode compiling settings (most probably covered by -Wall):
# https://github.com/llvm-mirror/clang/blob/master/include/clang/Basic/DiagnosticGroups.td
Expand Down
2 changes: 1 addition & 1 deletion emscripten/buildToolkit
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ my ($lightQ, $version, $chattyQ, $helpQ, $exclusion, $wasmQ, $makeQ, $modularize
my ($nopae, $nohumdrum, $nomusicxml, $nodarms);
my ($FLAGS_NAME, $VERSION, $CHATTY);

my $cpp = 23; # c++ version to compile (11, 14, 17)
my $cpp = 20; # c++ version to compile (11, 14, 17)
my $VEROVIO_ROOT = "..";

Getopt::Long::Configure("bundling");
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ def get_version() -> str:
# extra compile arguments
EXTRA_COMPILE_ARGS = ['-DPYTHON_BINDING']
if platform.system() != 'Windows':
EXTRA_COMPILE_ARGS += ['-std=c++23',
EXTRA_COMPILE_ARGS += ['-std=c++20',
'-Wno-write-strings', '-Wno-overloaded-virtual', '-g0']
else:
EXTRA_COMPILE_ARGS += ['/std:c++23',
EXTRA_COMPILE_ARGS += ['/std:c++20',
'-DNO_PAE_SUPPORT']

verovio_module = Extension('verovio._verovio',
Expand Down
9 changes: 6 additions & 3 deletions src/doc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1365,10 +1365,13 @@ void Doc::ConvertToCmnDoc()
ListOfObjects systems = contentPage->FindAllDescendantsByType(SYSTEM, false, 1);
ListOfObjects scores = contentPage->FindAllDescendantsByType(SCORE, false, 1);
assert(systems.size() == scores.size());
for (const auto [systemItem, scoreItem] : std::ranges::zip_view(systems, scores)) {
System *system = vrv_cast<System *>(systemItem);

ListOfObjects::iterator systemsIt = systems.begin();
ListOfObjects::iterator scoresIt = scores.begin();
for (; systemsIt != systems.end(); ++systemsIt, ++scoresIt) {
System *system = vrv_cast<System *>(*systemsIt);
assert(system);
Score *score = vrv_cast<Score *>(scoreItem);
Score *score = vrv_cast<Score *>(*scoresIt);
assert(score);
System *convertedSystem = new System();
ConvertToCmnFunctor convertToCmn(this, convertedSystem, score);
Expand Down

0 comments on commit b06d097

Please sign in to comment.