From: Ehsan Nasiri Date: Thu, 17 Oct 2019 19:14:20 +0000 (-0400) Subject: Make it work on Windows. X-Git-Tag: upstream/11.4.0~376^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dccaa59c98dac1122fc806060825e1e4feef274d;p=platform%2Fupstream%2Fglslang.git Make it work on Windows. --- diff --git a/BUILD.bazel b/BUILD.bazel index 550dde1..4bb6b6b 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -10,21 +10,24 @@ licenses(["notice"]) # Mixed: BSD, MIT, Khronos, Apache 2.0 exports_files(["LICENSE"]) -COMMON_COPTS = [ - "-Wall", - "-Wuninitialized", - "-Wunused", - "-Wunused-local-typedefs", - "-Wunused-parameter", - "-Wunused-value", - "-Wunused-variable", - "-Wno-reorder", - "-std=c++11", - "-fvisibility=hidden", - "-fvisibility-inlines-hidden", - "-fno-exceptions", - "-fno-rtti", -] +COMMON_COPTS = select({ + "@bazel_tools//src/conditions:windows": [""], + "//conditions:default": [ + "-Wall", + "-Wuninitialized", + "-Wunused", + "-Wunused-local-typedefs", + "-Wunused-parameter", + "-Wunused-value", + "-Wunused-variable", + "-Wno-reorder", + "-std=c++11", + "-fvisibility=hidden", + "-fvisibility-inlines-hidden", + "-fno-exceptions", + "-fno-rtti", + ], +}) cc_library( name = "glslang", @@ -43,8 +46,12 @@ cc_library( ], ) + [ "OGLCompilersDLL/InitializeDll.cpp", - "glslang/OSDependent/Unix/ossource.cpp", - ], + ] + select({ + "@bazel_tools//src/conditions:windows": + ["glslang/OSDependent/Windows/ossource.cpp"], + "//conditions:default": + ["glslang/OSDependent/Unix/ossource.cpp"], + }), hdrs = glob([ "glslang/Include/*.h", "glslang/MachineIndependent/*.h", @@ -61,13 +68,12 @@ cc_library( "AMD_EXTENSIONS", "ENABLE_HLSL=0", "ENABLE_OPT=0", - "GLSLANG_OSINCLUDE_UNIX", "NV_EXTENSIONS", ], - linkopts = [ - "-lm", - "-lpthread", - ], + linkopts = select({ + "@bazel_tools//src/conditions:windows": [""], + "//conditions:default": ["-lm", "-lpthread"], + }), linkstatic = 1, ) @@ -125,7 +131,10 @@ cc_library( ], copts = COMMON_COPTS, includes = ["SPIRV"], - linkopts = ["-lm"], + linkopts = select({ + "@bazel_tools//src/conditions:windows": [""], + "//conditions:default": ["-lm"], + }), linkstatic = 1, deps = [ ":SPIRV_headers",