Skip to content

Commit c592499

Browse files
committed
build: remove duplicate C++ standard flags from LIEF
LIEF's lief.gyp explicitly sets -std=gnu++17 in cflags_cc and xcode_settings, while common.gypi already sets -std=gnu++20 project-wide. This results in both flags being passed to the compiler (-std=gnu++20 -std=gnu++17). Since the last flag wins, LIEF was silently compiling as C++17 instead of the intended project-wide C++20. Remove the explicit -std=gnu++17 flags from cflags_cc and xcode_settings.OTHER_CPLUSPLUSFLAGS, and the msvs_settings LanguageStandard override (stdcpp17), so LIEF uses the project-wide C++20 standard. LIEF is compatible with C++20 because SPDLOG_USE_STD_FORMAT is not defined, so spdlog uses its bundled fmt library rather than std::format, avoiding any C++20 conflicts. Note: a separate issue with a stray debug string in the defines list is addressed in a follow-up PR. Fixes: #62129
1 parent 9f0a3e6 commit c592499

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

deps/LIEF/lief.gyp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -454,14 +454,7 @@
454454
'cflags': [
455455
'-fPIC'
456456
],
457-
# We need c++17 to compile without std::format and avoid conflicts with spdlog.
458-
'msvs_settings': {
459-
'VCCLCompilerTool': {
460-
'LanguageStandard': 'stdcpp17',
461-
},
462-
},
463457
'cflags_cc': [
464-
'-std=gnu++17',
465458
'-fPIC',
466459
'-fvisibility=hidden',
467460
'-fvisibility-inlines-hidden',
@@ -474,7 +467,6 @@
474467
],
475468
'xcode_settings': {
476469
'OTHER_CPLUSPLUSFLAGS': [
477-
'-std=gnu++17',
478470
'-fPIC',
479471
'-fvisibility=hidden',
480472
'-fvisibility-inlines-hidden',

0 commit comments

Comments
 (0)