Skip to content

Commit

Permalink
[meta] Move SSE/SSE2 enablement out of cross files
Browse files Browse the repository at this point in the history
Fixes Proton build, which uses an outdated Meson version.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
  • Loading branch information
doitsujin committed Jan 4, 2021
1 parent f337ad3 commit 7d67306
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 0 additions & 2 deletions build-win32.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ ar = 'i686-w64-mingw32-ar'
strip = 'i686-w64-mingw32-strip'

[built-in options]
c_args=['-msse', '-msse2']
cpp_args=['-msse', '-msse2']
c_link_args = ['-static', '-static-libgcc']
cpp_link_args = ['-static', '-static-libgcc', '-static-libstdc++']

Expand Down
4 changes: 4 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ if cpu_family == 'x86'
if dxvk_compiler.has_link_argument('-Wl,--enable-stdcall-fixup')
add_global_link_arguments('-Wl,--enable-stdcall-fixup', language: 'cpp')
endif
if dxvk_compiler.has_argument('-msse') and dxvk_compiler.has_argument('-msse2')
add_project_arguments('-msse', '-msse2', language: 'c')
add_project_arguments('-msse', '-msse2', language: 'cpp')
endif
endif

lib_vulkan = dxvk_compiler.find_library('vulkan-1', dirs : dxvk_library_path)
Expand Down

3 comments on commit 7d67306

@FireBurn
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is the old meson totally ignores the new [built-in options] for the c{pp}_args, is the same happening for the link args?

Does meson 0.56 actually ignore them set as [properties] ? If not it might be worth reverting 77af102 until more folk have moved over to 0.56 which was released on 30th October

@pchome
Copy link
Contributor

@pchome pchome commented on 7d67306 Jan 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FireBurn
Use generic cross-files, e.g. meson-cross-files-wine.zip

How to use them in Gentoo (ebuild):

cross_file() { [[ ${ABI} = amd64 ]] && echo "x86_64.winelib" || echo "x86.winelib" ; }
multilib_src_configure() {
        local emesonargs=(
                --cross-file="$(cross_file)"
                --libdir="$(get_libdir)/${PN}"
                --bindir="$(get_libdir)/${PN}/bin"
                -Dc_args="${CFLAGS}"
                -Dcpp_args="${CXXFLAGS}"
                -Dc_link_args="${LDFLAGS}"
                -Dcpp_link_args="${LDFLAGS}"
        )
        meson_src_configure
}

Multiple cross-files supported in recent meson versions, so add some more --cross-file= if you wish.
Note, -Dc_args=...like options will override cross-file's c_args.

For regular users: unpack files from dev-util/meson-cross-files-wine/files/ directory into ~/.local/share/meson/
use them e.g.:
meson builddir --buildtype "release" --cross-file x86.mingw32 --cross-file mingw32.flags.meson-0.55

Should work for most mingw32 projects (I guess, have no mingw to test this).
Feel free to add your own cross-file variants otherwise.

@SveSop
Copy link
Contributor

@SveSop SveSop commented on 7d67306 Jan 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is the old meson totally ignores the new [built-in options] for the c{pp}_args, is the same happening for the link args?

Does meson 0.56 actually ignore them set as [properties] ? If not it might be worth reverting 77af102 until more folk have moved over to 0.56 which was released on 30th October

Hmm.. would DXVK even work without ['-static', '-static-libgcc', '-static-libstdc++'] ?
If not... Could it just be declared with
add_global_link_arguments('-static', '-static-libgcc', language: 'c')
add_global_link_arguments('-static', '-static-libgcc', '-static-libstdc++', language: 'cpp')
in the meson.build file, since this does not change regardless of build type (i guess)?

That way, kinda remove the whole [built-in options] statement from the cross-files.

Then again, there should be no problem making meson >= 0.56 a hard requirement, the same as mingw-w64 >= 8.0 is imo.

Please sign in to comment.