| // |
| // Copyright (C) 2010 The Android Open Source Project |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| // |
| |
| package { |
| default_applicable_licenses: ["frameworks_compile_slang_license"], |
| } |
| |
| // Added automatically by a large-scale-change that took the approach of |
| // 'apply every license found to every target'. While this makes sure we respect |
| // every license restriction, it may not be entirely correct. |
| // |
| // e.g. GPL in an MIT project might only apply to the contrib/ directory. |
| // |
| // Please consider splitting the single license below into multiple licenses, |
| // taking care not to lose any license_kind information, and overriding the |
| // default license using the 'licenses: [...]' property on targets as needed. |
| // |
| // For unused files, consider creating a 'fileGroup' with "//visibility:private" |
| // to attach the license to, and including a comment whether the files may be |
| // used in the current project. |
| // See: http://go/android-license-faq |
| license { |
| name: "frameworks_compile_slang_license", |
| visibility: [":__subpackages__"], |
| license_kinds: [ |
| "SPDX-license-identifier-Apache-2.0", |
| "SPDX-license-identifier-BSD", |
| "SPDX-license-identifier-MIT", |
| "SPDX-license-identifier-NCSA", |
| "legacy_unencumbered", |
| ], |
| license_text: [ |
| "NOTICE", |
| ], |
| } |
| |
| cc_defaults { |
| name: "rs-version", |
| cflags: [ |
| "-DRS_VERSION=24", |
| ], |
| } |
| |
| cc_defaults { |
| name: "slang-defaults", |
| defaults: [ |
| "clang-defaults", |
| "rs-version", |
| ], |
| |
| cflags: [ |
| "-Wall", |
| "-Werror", |
| "-std=c++11", |
| |
| "-D__DISABLE_ASSERTS", |
| |
| "-DTARGET_BUILD_VARIANT=user", |
| ], |
| |
| product_variables: { |
| debuggable: { |
| cflags: [ |
| "-U__DISABLE_ASSERTS", |
| |
| "-UTARGET_BUILD_VARIANT", |
| "-DTARGET_BUILD_VARIANT=userdebug", |
| ], |
| }, |
| eng: { |
| cflags: [ |
| "-O0", |
| "-D__ENABLE_INTERNAL_OPTIONS", |
| |
| "-UTARGET_BUILD_VARIANT", |
| "-DTARGET_BUILD_VARIANT=eng", |
| ], |
| }, |
| }, |
| } |
| |
| static_libraries_needed_by_slang = [ |
| "libLLVMBitWriter_2_9", |
| "libLLVMBitWriter_2_9_func", |
| "libLLVMBitWriter_3_2", |
| "libStripUnkAttr", |
| ] |
| |
| // Exported header files |
| cc_library_headers { |
| name: "slang_headers", |
| vendor_available: true, |
| export_include_dirs: ["."], |
| host_supported: true, |
| // TODO(b/153609531): remove when no longer needed. |
| native_bridge_supported: true, |
| target: { |
| windows: { |
| enabled: true, |
| }, |
| }, |
| } |
| |
| // Static library libslang for host |
| // ======================================================== |
| cc_library_host_static { |
| name: "libslang", |
| defaults: ["slang-defaults"], |
| compile_multilib: "first", |
| |
| target: { |
| windows: { |
| // Skip missing-field-initializer warnings for mingw. |
| cflags: ["-Wno-error=missing-field-initializers"], |
| }, |
| }, |
| |
| srcs: [ |
| "slang.cpp", |
| "slang_bitcode_gen.cpp", |
| "slang_backend.cpp", |
| "slang_diagnostic_buffer.cpp", |
| ], |
| |
| shared_libs: ["libbcinfo"], |
| } |
| |
| // ======================================================== |
| |
| cc_binary_host { |
| name: "llvm-rs-as", |
| defaults: ["slang-defaults"], |
| |
| srcs: ["llvm-rs-as.cpp"], |
| |
| static_libs: ["libslang"] + static_libraries_needed_by_slang, |
| shared_libs: ["libLLVM_android"], |
| |
| product_variables: { |
| unbundled_build: { |
| enabled: false, |
| }, |
| }, |
| } |
| |
| // Executable llvm-rs-cc for host |
| // ======================================================== |
| |
| // For build RSCCOptions.inc from RSCCOptions.td |
| llvm_tblgen { |
| name: "slang-gen-options", |
| in: "RSCCOptions.td", |
| outs: ["RSCCOptions.inc"], |
| } |
| |
| cc_binary_host { |
| name: "llvm-rs-cc", |
| defaults: ["slang-defaults"], |
| |
| generated_headers: ["slang-gen-options"], |
| srcs: [ |
| "llvm-rs-cc.cpp", |
| "rs_cc_options.cpp", |
| "slang_rs_foreach_lowering.cpp", |
| "slang_rs_ast_replace.cpp", |
| "slang_rs_check_ast.cpp", |
| "slang_rs_context.cpp", |
| "slang_rs_pragma_handler.cpp", |
| "slang_rs_exportable.cpp", |
| "slang_rs_export_type.cpp", |
| "slang_rs_export_element.cpp", |
| "slang_rs_export_var.cpp", |
| "slang_rs_export_func.cpp", |
| "slang_rs_export_foreach.cpp", |
| "slang_rs_export_reduce.cpp", |
| "slang_rs_object_ref_count.cpp", |
| "slang_rs_reflection.cpp", |
| "slang_rs_reflection_cpp.cpp", |
| "slang_rs_reflection_state.cpp", |
| "slang_rs_reflect_utils.cpp", |
| "slang_rs_special_func.cpp", |
| "slang_rs_special_kernel_param.cpp", |
| ], |
| |
| static_libs: ["libslang"] + static_libraries_needed_by_slang, |
| |
| shared_libs: [ |
| "libbcinfo", |
| "libclang_android", |
| "libLLVM_android", |
| ], |
| |
| target: { |
| windows: { |
| host_ldlibs: [ |
| "-limagehlp", |
| "-lpsapi", |
| ], |
| cflags: [ |
| // Skip missing-field-initializer warnings for mingw. |
| "-Wno-error=missing-field-initializers", |
| ], |
| }, |
| }, |
| } |
| |
| cc_binary_host { |
| name: "lld", |
| srcs: ["lld_main.cpp"], |
| ldflags: ["-static"], |
| stl: "libc++_static", |
| target: { |
| darwin: { |
| enabled: false, |
| }, |
| linux: { |
| enabled: false, |
| }, |
| windows: { |
| enabled: true, |
| }, |
| }, |
| } |
| |
| subdirs = [ |
| "BitWriter_2_9", |
| "BitWriter_2_9_func", |
| "BitWriter_3_2", |
| "StripUnkAttr", |
| ] |