Skip to content

Commit

Permalink
Workaround an ICE when using modules with gcc 14.2 and earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Jan 12, 2025
1 parent 8303d14 commit c43da35
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ function(add_module_library name)
target_compile_options(${name} PUBLIC -fmodules-ts)
endif ()

target_compile_definitions(${name} PRIVATE FMT_MODULE)

if (FMT_USE_CMAKE_MODULES)
target_sources(${name} PUBLIC FILE_SET fmt TYPE CXX_MODULES
FILES ${sources})
Expand Down
2 changes: 1 addition & 1 deletion include/fmt/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@

// Enable minimal optimizations for more compact code in debug mode.
FMT_PRAGMA_GCC(push_options)
#if !defined(__OPTIMIZE__) && !defined(__CUDACC__)
#if !defined(__OPTIMIZE__) && !defined(__CUDACC__) && !defined(FMT_MODULE)
FMT_PRAGMA_GCC(optimize("Og"))
#endif
FMT_PRAGMA_CLANG(diagnostic push)
Expand Down
2 changes: 2 additions & 0 deletions src/fmt.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module;

#define FMT_MODULE

#ifdef _MSVC_LANG
# define FMT_CPLUSPLUS _MSVC_LANG
#else
Expand Down

0 comments on commit c43da35

Please sign in to comment.