File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change 1313
1414namespace  helper  {
1515
16- #if  defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || defined(__MINGW32__) \
17-         || defined (__MINGW64__)
16+ #if  defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) 
1817    //  "WinUser.h" defines "#define MessageBox  MessageBoxA"
1918    //  which breaks this valid code, I love windows xD.
2019#ifdef  MessageBox
Original file line number Diff line number Diff line change @@ -23,10 +23,26 @@ graphics_lib = {
2323    ' deps'  : [],
2424}
2525
26+ c =  meson .get_compiler(' c'  )
27+ 
28+ # Detect if compiling in an MSYS2-based MinGW/Clang environment 
29+ host_is_msys2 =  host_machine .system() ==  ' windows'   and  c.get_argument_syntax() ==  ' gcc' 
30+ 
31+ ## since gcc-15 msys2 doesn't define "_WIN32" if it is a bug or intentional, but it is needed by a few things, e.g. spdlog 
32+ if  host_is_msys2
33+     add_global_arguments (
34+         ' -D_WIN32'  ,
35+         language : ' c'  ,
36+     )
37+     add_global_arguments (
38+         ' -D_WIN32'  ,
39+         language : ' cpp'  ,
40+     )
41+ endif 
42+ 
2643# check if running in CI, than we only support certain versions, this helps in checking if the Ci installs the correct tool version in e.g. msys2 
2744if  get_option (' run_in_ci'  )
2845
29-     c =  meson .get_compiler(' c'  )
3046
3147    system_name =  host_machine .system()
3248
@@ -35,8 +51,6 @@ if get_option('run_in_ci')
3551
3652    endif 
3753
38-     # Detect if compiling in an MSYS2-based MinGW/Clang environment 
39-     host_is_msys2 =  host_machine .system() ==  ' windows'   and  c.get_argument_syntax() ==  ' gcc' 
4054    if  host_is_msys2
4155        system_name =  ' msys2' 
4256    endif 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments