diff --git a/.github/workflows/meson.yml b/.github/workflows/meson.yml index 67fd8e0..1e4cb2f 100644 --- a/.github/workflows/meson.yml +++ b/.github/workflows/meson.yml @@ -67,6 +67,7 @@ jobs: os: windows-latest, cc: "clang.exe", cxx: "clang++.exe", + meson_opts: "--native-file=./meson_crosscompile/Windows-Clang.txt", release_name: "win-x86_64-clang", release_extension: ".zip", archive_command: "7z a -tzip -mmt" diff --git a/meson.build b/meson.build index 4a1cda7..16a5f3a 100644 --- a/meson.build +++ b/meson.build @@ -154,7 +154,7 @@ add_project_link_arguments(c.get_supported_link_arguments(linker_flags), languag small_code_cc_flags = [] small_code_link_flags = [] -if (c.get_id() == 'gcc' or c.get_id() == 'clang') +if (c.get_id() == 'gcc' or c.get_id() == 'clang') and target_machine.system() != 'windows' small_code_cc_flags = [ '-ffunction-sections', diff --git a/meson_crosscompile/Windows-Clang.txt b/meson_crosscompile/Windows-Clang.txt new file mode 100644 index 0000000..ab72538 --- /dev/null +++ b/meson_crosscompile/Windows-Clang.txt @@ -0,0 +1,32 @@ +#See https://mesonbuild.com/Cross-compilation.html +#and https://mesonbuild.com/Machine-files.html +#and https://mesonbuild.com/Reference-tables.html#cpu-families +#example usage of this file: +# meson setup --buildtype=release --native-file=./meson_crosscompile/Windows-Clang.txt nativebuild_win_clang +# ninja -C nativebuild_win_clang + +#NOTE: This is for the LLVM.exe installer from github. + +[binaries] +c = 'clang.exe' +cpp = 'clang++.exe' +ar = 'llvm-ar.exe' +c_ld = 'lld-link.exe' +cpp_ld = 'lld-link.exe' +strip = 'llvm-strip.exe' +windres = 'llvm-rc.exe' +llvm-config = 'llvm-config.exe' + +[properties] +has_function_printf = true + +[host_machine] +system = 'windows' +subsystem = 'windows' +kernel = 'nt' +endian = 'little' +cpu_family = 'x86_64' +cpu = '' + +[built-in options] +default_library='static'