refactor(build): Using meson devenv makes copying libgcc unnecessary while cross-compiling
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				Ubuntu Cross to Win64 / Cross Compile with ming64 (1.4.0, ubuntu-latest) (push) Successful in 2m13s
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	Ubuntu Cross to Win64 / Cross Compile with ming64 (1.4.0, ubuntu-latest) (push) Successful in 2m13s
				
			This commit is contained in:
		
							parent
							
								
									9f94ac40ee
								
							
						
					
					
						commit
						92fbe1ece4
					
				@ -37,6 +37,7 @@ jobs:
 | 
				
			|||||||
                chmod +x ./scripts/download_dxc_cross.sh
 | 
					                chmod +x ./scripts/download_dxc_cross.sh
 | 
				
			||||||
                ./scripts/download_dxc_cross.sh
 | 
					                ./scripts/download_dxc_cross.sh
 | 
				
			||||||
                meson setup --cross-file scripts/x86_64-w64-mingw32.txt -Db_sanitize=none build
 | 
					                meson setup --cross-file scripts/x86_64-w64-mingw32.txt -Db_sanitize=none build
 | 
				
			||||||
 | 
					                cd build && meson devenv && cd ..
 | 
				
			||||||
            - name: Compile
 | 
					            - name: Compile
 | 
				
			||||||
              run: meson compile -C build
 | 
					              run: meson compile -C build
 | 
				
			||||||
            - name: Run Tests
 | 
					            - name: Run Tests
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										13
									
								
								meson.build
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								meson.build
									
									
									
									
									
								
							@ -58,7 +58,8 @@ if build_machine.system() == 'linux' and host_machine.system() == 'windows'
 | 
				
			|||||||
  message('Adding /usr/share/mingw-w64/include to the project include path.')
 | 
					  message('Adding /usr/share/mingw-w64/include to the project include path.')
 | 
				
			||||||
  add_project_arguments(['-isystem/usr/share/mingw-w64/include',
 | 
					  add_project_arguments(['-isystem/usr/share/mingw-w64/include',
 | 
				
			||||||
    '-DRT_CROSS_LINUX_WINDOWS',
 | 
					    '-DRT_CROSS_LINUX_WINDOWS',
 | 
				
			||||||
    '-D_WIN32_WINNT=0x600'],
 | 
					    '-D_WIN32_WINNT=0x600',
 | 
				
			||||||
 | 
					    '-lgcc'],
 | 
				
			||||||
    language: ['c', 'cpp'],
 | 
					    language: ['c', 'cpp'],
 | 
				
			||||||
    native: false)
 | 
					    native: false)
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
@ -133,13 +134,3 @@ if get_option('game_as_subdir')
 | 
				
			|||||||
  endforeach
 | 
					  endforeach
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# For Cross builds, we need libgcc from mingw
 | 
					 | 
				
			||||||
if build_machine.system() == 'linux' and host_machine.system() == 'windows'
 | 
					 | 
				
			||||||
  custom_target('copy libgcc',
 | 
					 | 
				
			||||||
    input : '/usr/lib/gcc/x86_64-w64-mingw32/10-win32/libgcc_s_seh-1.dll',
 | 
					 | 
				
			||||||
    output : 'libgcc_s_seh-1.dll',
 | 
					 | 
				
			||||||
    command : [copy_util, '@INPUT@', '@OUTPUT@'],
 | 
					 | 
				
			||||||
    build_by_default : true)
 | 
					 | 
				
			||||||
endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
				
			|||||||
@ -1,9 +1,15 @@
 | 
				
			|||||||
#include <meshoptimizer.h>
 | 
					#include <meshoptimizer.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef _MSC_VER
 | 
				
			||||||
#pragma warning(push)
 | 
					#pragma warning(push)
 | 
				
			||||||
#pragma warning(disable : 4530)
 | 
					#pragma warning(disable : 4530)
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define TINYOBJLOADER_IMPLEMENTATION
 | 
					#define TINYOBJLOADER_IMPLEMENTATION
 | 
				
			||||||
#include <tiny_obj_loader.h>
 | 
					#include <tiny_obj_loader.h>
 | 
				
			||||||
 | 
					#ifdef _MSC_VER
 | 
				
			||||||
#pragma warning(pop)
 | 
					#pragma warning(pop)
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "meshlet_generator.hpp"
 | 
					#include "meshlet_generator.hpp"
 | 
				
			||||||
#include <runtime/mem_arena.h>
 | 
					#include <runtime/mem_arena.h>
 | 
				
			||||||
@ -281,4 +287,4 @@ rt_result meshlet_generator::RunHierarchical(uint32_t mesh_idx, uint32_t *out_ro
 | 
				
			|||||||
        // vertex *vertices = new vertex[MESHLET_VERTICES * 8];
 | 
					        // vertex *vertices = new vertex[MESHLET_VERTICES * 8];
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    return RT_SUCCESS;
 | 
					    return RT_SUCCESS;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -98,7 +98,7 @@ shader shader::CompileFile(const char *compute_path) {
 | 
				
			|||||||
    fclose(f);
 | 
					    fclose(f);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    sh = CompileSource(buf);
 | 
					    sh = CompileSource(buf);
 | 
				
			||||||
    delete buf;
 | 
					    delete[] buf;
 | 
				
			||||||
    return sh;
 | 
					    return sh;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -386,4 +386,4 @@ void meshlet_renderer::SettingMenu() {
 | 
				
			|||||||
        ImGui::InputFloat3("Target", sett->target);
 | 
					        ImGui::InputFloat3("Target", sett->target);
 | 
				
			||||||
        ImGui::End();
 | 
					        ImGui::End();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -1,6 +1,6 @@
 | 
				
			|||||||
glfw_proj = subproject('glfw',  default_options: ['default_library=static', 'b_sanitize=none'])
 | 
					glfw_proj = subproject('glfw',  default_options: ['default_library=static', 'b_sanitize=none'])
 | 
				
			||||||
glfw_dep = glfw_proj.get_variable('glfw_dep')
 | 
					glfw_dep = glfw_proj.get_variable('glfw_dep')
 | 
				
			||||||
imgui_proj = subproject('imgui')
 | 
					imgui_proj = subproject('imgui', default_options: ['warning_level=0', 'werror=false'])
 | 
				
			||||||
imgui_dep = imgui_proj.get_variable('imgui_dep')
 | 
					imgui_dep = imgui_proj.get_variable('imgui_dep')
 | 
				
			||||||
glm_proj = subproject('glm')
 | 
					glm_proj = subproject('glm')
 | 
				
			||||||
glm_dep = glm_proj.get_variable('glm_dep')
 | 
					glm_dep = glm_proj.get_variable('glm_dep')
 | 
				
			||||||
@ -15,4 +15,4 @@ executable('meshlet_experiment',
 | 
				
			|||||||
  extra_files: ['flat_cull.glsl', 'hierarchical_cull.glsl'],
 | 
					  extra_files: ['flat_cull.glsl', 'hierarchical_cull.glsl'],
 | 
				
			||||||
  include_directories: [engine_incdir, contrib_incdir],
 | 
					  include_directories: [engine_incdir, contrib_incdir],
 | 
				
			||||||
  dependencies: [m_dep, meshoptimizer_dep, glfw_dep, imgui_dep, glm_dep],
 | 
					  dependencies: [m_dep, meshoptimizer_dep, glfw_dep, imgui_dep, glm_dep],
 | 
				
			||||||
  link_with: runtime_lib)
 | 
					  link_with: runtime_lib)
 | 
				
			||||||
 | 
				
			|||||||
@ -9,9 +9,20 @@
 | 
				
			|||||||
#pragma warning Are you sure that you want to include this file ?
 | 
					#pragma warning Are you sure that you want to include this file ?
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifndef _Maybenull_
 | 
				
			||||||
#define _Maybenull_
 | 
					#define _Maybenull_
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifndef _In_opt_count_
 | 
				
			||||||
#define _In_opt_count_(n)
 | 
					#define _In_opt_count_(n)
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifndef _In_bytecount_
 | 
				
			||||||
#define _In_bytecount_(n)
 | 
					#define _In_bytecount_(n)
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifndef _In_count_
 | 
				
			||||||
#define _In_count_(n)
 | 
					#define _In_count_(n)
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user