mesa: Move compile of common Mesa core files to a static lib.
We were compiling them twice, costing extra build time. Reduces my ccache-hot clean build time by a second (24.3s to 23.3s, 3 runs each). The windows args are a little strange -- it's not clear to me that they're actually used for building these files, but keep them in place just in case, since we don't have a good windows CI story yet. We should want them on both gallium and classic regardless: Only osmesa could be built for windows in classic, and classic OSMesa's scons build defines these flags too. Closes: #2052 Acked-by: Dylan Baker <dylan@pnwbakers.com>
This commit is contained in:
+32
-18
@@ -697,6 +697,10 @@ files_libmesa_common += [
|
||||
main_remap_helper_h,
|
||||
sha1_h,
|
||||
]
|
||||
files_libmesa_gallium += [
|
||||
ir_expression_operation_h,
|
||||
sha1_h,
|
||||
]
|
||||
|
||||
if with_sse41
|
||||
libmesa_sse41 = static_library(
|
||||
@@ -709,36 +713,46 @@ else
|
||||
libmesa_sse41 = []
|
||||
endif
|
||||
|
||||
libmesa_classic = static_library(
|
||||
'mesa_classic',
|
||||
[files_libmesa_common, files_libmesa_classic],
|
||||
c_args : [c_vis_args, c_msvc_compat_args],
|
||||
cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
|
||||
include_directories : [inc_common, inc_libmesa_asm, include_directories('main')],
|
||||
link_with : [libglsl, libmesa_sse41],
|
||||
dependencies : idep_nir_headers,
|
||||
build_by_default : false,
|
||||
)
|
||||
|
||||
_mesa_gallium_args = []
|
||||
_mesa_windows_args = []
|
||||
if with_platform_windows
|
||||
_mesa_gallium_args += [
|
||||
_mesa_windows_args += [
|
||||
'-D_GDI32_', # prevent gl* being declared __declspec(dllimport) in MS headers
|
||||
'-DBUILD_GL32' # declare gl* as __declspec(dllexport) in Mesa headers
|
||||
]
|
||||
if not with_shared_glapi
|
||||
# prevent _glapi_* from being declared __declspec(dllimport)
|
||||
_mesa_gallium_args += '-D_GLAPI_NO_EXPORTS'
|
||||
_mesa_windows_args += '-D_GLAPI_NO_EXPORTS'
|
||||
endif
|
||||
endif
|
||||
|
||||
libmesa_common = static_library(
|
||||
'mesa_common',
|
||||
files_libmesa_common,
|
||||
c_args : [c_vis_args, c_msvc_compat_args, _mesa_windows_args],
|
||||
cpp_args : [cpp_vis_args, cpp_msvc_compat_args, _mesa_windows_args],
|
||||
include_directories : [inc_common, inc_libmesa_asm, include_directories('main')],
|
||||
dependencies : idep_nir_headers,
|
||||
build_by_default : false,
|
||||
)
|
||||
|
||||
libmesa_classic = static_library(
|
||||
'mesa_classic',
|
||||
files_libmesa_classic,
|
||||
c_args : [c_vis_args, c_msvc_compat_args],
|
||||
cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
|
||||
include_directories : [inc_common, inc_libmesa_asm, include_directories('main')],
|
||||
link_with : [libmesa_common, libglsl, libmesa_sse41],
|
||||
dependencies : idep_nir_headers,
|
||||
build_by_default : false,
|
||||
)
|
||||
|
||||
libmesa_gallium = static_library(
|
||||
'mesa_gallium',
|
||||
[files_libmesa_common, files_libmesa_gallium],
|
||||
c_args : [c_vis_args, c_msvc_compat_args, _mesa_gallium_args],
|
||||
cpp_args : [cpp_vis_args, cpp_msvc_compat_args, _mesa_gallium_args],
|
||||
files_libmesa_gallium,
|
||||
c_args : [c_vis_args, c_msvc_compat_args, _mesa_windows_args],
|
||||
cpp_args : [cpp_vis_args, cpp_msvc_compat_args, _mesa_windows_args],
|
||||
include_directories : [inc_common, inc_libmesa_asm, include_directories('main')],
|
||||
link_with : [libglsl, libmesa_sse41],
|
||||
link_with : [libmesa_common, libglsl, libmesa_sse41],
|
||||
dependencies : [idep_nir_headers, dep_vdpau],
|
||||
build_by_default : false,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user