Home | History | Annotate | Download | only in SPIRV
      1 //
      2 // Copyright (C) 2016 The Android Open Source Project
      3 //
      4 // Licensed under the Apache License, Version 2.0 (the "License");
      5 // you may not use this file except in compliance with the License.
      6 // You may obtain a copy of the License at
      7 //
      8 //      http://www.apache.org/licenses/LICENSE-2.0
      9 //
     10 // Unless required by applicable law or agreed to in writing, software
     11 // distributed under the License is distributed on an "AS IS" BASIS,
     12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13 // See the License for the specific language governing permissions and
     14 // limitations under the License.
     15 //
     16 
     17 
     18 //=====================================================================
     19 // Shared Library libSPIRV
     20 //=====================================================================
     21 
     22 cc_library_shared {
     23     name: "libSPIRV",
     24     host_supported: true,
     25 
     26     srcs: [
     27         "libSPIRV/SPIRVBasicBlock.cpp",
     28         "libSPIRV/SPIRVDebug.cpp",
     29         "libSPIRV/SPIRVDecorate.cpp",
     30         "libSPIRV/SPIRVEntry.cpp",
     31         "libSPIRV/SPIRVFunction.cpp",
     32         "libSPIRV/SPIRVInstruction.cpp",
     33         "libSPIRV/SPIRVModule.cpp",
     34         "libSPIRV/SPIRVStream.cpp",
     35         "libSPIRV/SPIRVType.cpp",
     36         "libSPIRV/SPIRVValue.cpp",
     37         "Mangler/FunctionDescriptor.cpp",
     38         "Mangler/Mangler.cpp",
     39         "Mangler/ManglingUtils.cpp",
     40         "Mangler/ParameterType.cpp",
     41         "OCL20To12.cpp",
     42         "OCL20ToSPIRV.cpp",
     43         "OCL21ToSPIRV.cpp",
     44         "OCLTypeToSPIRV.cpp",
     45         "OCLUtil.cpp",
     46         "SPIRVLowerBool.cpp",
     47         "SPIRVLowerConstExpr.cpp",
     48         "SPIRVLowerOCLBlocks.cpp",
     49         "SPIRVReader.cpp",
     50         "SPIRVRegularizeLLVM.cpp",
     51         "SPIRVToOCL20.cpp",
     52         "SPIRVUtil.cpp",
     53         "SPIRVWriter.cpp",
     54         "SPIRVWriterPass.cpp",
     55         "TransOCLMD.cpp",
     56     ],
     57 
     58     export_include_dirs: [
     59         ".",
     60         "libSPIRV",
     61         "Mangler",
     62     ],
     63 
     64     header_libs: ["llvm-headers"],
     65 
     66     compile_multilib: "first",
     67 
     68     target: {
     69         android: {
     70             cflags: ["-Wno-error=non-virtual-dtor"],
     71         },
     72         host: {
     73             cflags: [
     74                 "-fno-rtti",
     75                 "-fno-exceptions",
     76             ],
     77         },
     78         linux: {
     79             host_ldlibs: [
     80                 "-lrt",
     81                 "-ldl",
     82                 "-lpthread",
     83             ],
     84         },
     85         darwin: {
     86             host_ldlibs: [
     87                 "-ldl",
     88                 "-lpthread",
     89             ],
     90         },
     91     },
     92 
     93     shared_libs: ["libLLVM"],
     94 
     95     cflags: [
     96         "-D_SPIRV_LLVM_API",
     97         "-D__STDC_LIMIT_MACROS",
     98         "-D__STDC_CONSTANT_MACROS",
     99         "-Wall",
    100         "-Werror",
    101         "-Wno-unused-parameter",
    102     ],
    103 
    104     product_variables: {
    105         unbundled_build: {
    106             // Don't build for unbundled branches
    107             enabled: false,
    108         },
    109     },
    110 }
    111