diff --git a/CMakeLists.txt b/CMakeLists.txt index 7dc89b845..f96ee282d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,6 +121,7 @@ output" OFF # clang-cl shared build crashes with extern constants so force to inline constants 😕🤔 # only one option with the clang-cl is inline constants for both shared/static builds # Look at NOTES.txt[inline constants] how this funckin machinery works 😎 +# Related issue: https://github.com/llvm/llvm-project/issues/55938 if(NOT (MINGW AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND BUILD_SHARED_LIBS)) feature_option_dependent(INLINE_CONSTANTS "Use inline constants instead of extern constants in the shared build. \ diff --git a/NOTES.txt b/NOTES.txt index d95edb53c..f855bed53 100644 --- a/NOTES.txt +++ b/NOTES.txt @@ -1157,9 +1157,11 @@ inline constants: - default is to provide/show this INLINE_CONSTANTS cmake option with the default value OFF, so extern constants are enabled by default - MinGW clang shared build crashes with inline constants - so don't show INLINE_CONSTANTS cmake option and value is NOT DEFINED in this case so the default will be used and it's extern constants + - related issue: https://github.com/llvm/llvm-project/issues/55938 - MinGW clang static build is not supported, problem with inline constants :/ - this is different than qmake build, it compiles (qmake has problem with duplicit symbols) but it crashes - so throw cmake message(FATAL_ERROR) with a nice message in TinyHelpers tiny_check_unsupported_build() + - related issue: https://github.com/llvm/llvm-project/issues/55938 - clang-cl shared build crashes with extern constants, so force to inline constants 😕🤔 - don't show INLINE_CONSTANTS cmake option and provide the default value ON using feature_option_dependent(INLINE_CONSTANTS) depends option, so inline constants is the default - so inline constants are only one option with clang-cl diff --git a/cmake/CommonModules/TinyHelpers.cmake b/cmake/CommonModules/TinyHelpers.cmake index 9c42da0cb..60974d891 100644 --- a/cmake/CommonModules/TinyHelpers.cmake +++ b/cmake/CommonModules/TinyHelpers.cmake @@ -267,6 +267,8 @@ endmacro() # Throw a fatal error for unsupported environments function(tiny_check_unsupported_build) + # Related issue: https://github.com/llvm/llvm-project/issues/55938 + if(MINGW AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT BUILD_SHARED_LIBS) message(FATAL_ERROR "MinGW clang static build is not supported, it has problems \ with inline constants :/.") diff --git a/qmake/features/inline_constants.prf b/qmake/features/inline_constants.prf index dd5907afc..4cd1cebac 100644 --- a/qmake/features/inline_constants.prf +++ b/qmake/features/inline_constants.prf @@ -1,3 +1,4 @@ +# Related issue: https://github.com/llvm/llvm-project/issues/55938 !build_pass:win32-clang-g++: \ if(CONFIG(dll, dll|shared|static|staticlib) | \ CONFIG(shared, dll|shared|static|staticlib)): \