Commit b94db86c by Sylvain Defresne Committed by Corentin Wallez

Explicitly filter assigments to sources variable

set_sources_assignment_filter() is considered as a mis-feature of gn (as it makes it difficult to reason about the BUILD.gn files individually). Change BUILD.gn in SwiftShader to check the platform before adding plaform-specific source files to "sources" variable. This will allow removing the global sources assignment filter from Chromium codebase. Bug: chromium:1018739 Change-Id: Icf357de347b09dccce8c031d84ae7d8ce0ec396b Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/48668Tested-by: 's avatarCorentin Wallez <cwallez@google.com> Reviewed-by: 's avatarCorentin Wallez <cwallez@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com>
parent a0940624
...@@ -61,12 +61,17 @@ swiftshader_shared_library("swiftshader_libEGL") { ...@@ -61,12 +61,17 @@ swiftshader_shared_library("swiftshader_libEGL") {
"Display.cpp", "Display.cpp",
"Surface.cpp", "Surface.cpp",
"libEGL.cpp", "libEGL.cpp",
"libEGL.def",
"libEGL.rc",
"main.cpp", "main.cpp",
"resource.h", "resource.h",
] ]
if (is_win) {
sources += [
"libEGL.def",
"libEGL.rc",
]
}
if (is_mac) { if (is_mac) {
sources += [ "OSXUtils.mm" ] sources += [ "OSXUtils.mm" ]
frameworks = [ frameworks = [
......
...@@ -118,11 +118,14 @@ swiftshader_shared_library("swiftshader_libGLESv2") { ...@@ -118,11 +118,14 @@ swiftshader_shared_library("swiftshader_libGLESv2") {
deps = [ ":swiftshader_libGLESv2_static" ] deps = [ ":swiftshader_libGLESv2_static" ]
sources = [ sources = [ "entry_points.cpp" ]
"entry_points.cpp",
"libGLESv2.def", if (is_win) {
"libGLESv2.rc", sources += [
] "libGLESv2.def",
"libGLESv2.rc",
]
}
if (is_mac) { if (is_mac) {
ldflags = [ ldflags = [
......
...@@ -139,11 +139,9 @@ swiftshader_shared_library("swiftshader_libvulkan") { ...@@ -139,11 +139,9 @@ swiftshader_shared_library("swiftshader_libvulkan") {
"VkShaderModule.cpp", "VkShaderModule.cpp",
"VkSpecializationInfo.cpp", "VkSpecializationInfo.cpp",
"VkStringify.cpp", "VkStringify.cpp",
"Vulkan.rc",
"libVulkan.cpp", "libVulkan.cpp",
"main.cpp", "main.cpp",
"resource.h", "resource.h",
"vk_swiftshader.def",
] ]
configs = [ ":swiftshader_libvulkan_private_config" ] configs = [ ":swiftshader_libvulkan_private_config" ]
...@@ -155,6 +153,13 @@ swiftshader_shared_library("swiftshader_libvulkan") { ...@@ -155,6 +153,13 @@ swiftshader_shared_library("swiftshader_libvulkan") {
output_name = "libvk_swiftshader" output_name = "libvk_swiftshader"
} }
if (is_win) {
sources += [
"Vulkan.rc",
"vk_swiftshader.def",
]
}
if (is_mac) { if (is_mac) {
ldflags = [ ldflags = [
"-Wl,-install_name,@rpath/libvk_swiftshader.dylib", "-Wl,-install_name,@rpath/libvk_swiftshader.dylib",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment