# Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved.
#
# This source file is part of the Cangjie project, licensed under Apache-2.0
# with Runtime Library Exception.
#
# See https://cangjie-lang.cn/pages/LICENSE for license information.

[package]
  cjc-version = "1.0.5"
  name = "stdx"
  organization = ""
  description = "Extension modules provided by the Cangjie programming language"
  version = "1.0.5"
  target-dir = ""
  script-dir = ""
  documentation = "https://gitcode.com/Cangjie/cangjie_stdx"
  repository = "https://gitcode.com/Cangjie/cangjie_stdx.git"
  homepage = "https://gitcode.com/Cangjie/cangjie_stdx"
  src-dir = "src/stdx"
  output-type = "static"
  compile-option = "-Woff=all"
  link-option = "-L target/release/stdx -L target/debug/stdx -L target/mock/release/stdx -L target/mock/debug/stdx"
  exclude = ["build_temp", "third_party/zlib", "third_party/flatbuffers"]

[package.package-configuration."stdx.compress.zlib"]
  compile-option = "-lstdx.compress.zlibFFI"

[package.package-configuration."stdx.compress.tar"]
  compile-option = "-lstdx.compress.tarFFI"

[package.package-configuration."stdx"]
  compile-option = "-lcangjie-dynamicLoader-opensslFFI"

[package.package-configuration."stdx.crypto.keys"]
  compile-option = "-lstdx.crypto.keysFFI -lcangjie-dynamicLoader-opensslFFI"

[package.package-configuration."stdx.crypto.x509"]
  compile-option = "-lstdx.crypto.x509FFI -lcangjie-dynamicLoader-opensslFFI"

[package.package-configuration."stdx.crypto.digest"]
  compile-option = "-lcangjie-dynamicLoader-opensslFFI"

[package.package-configuration."stdx.crypto.crypto"]
  compile-option = "-lcangjie-dynamicLoader-opensslFFI"

[package.package-configuration."stdx.encoding.json"]
  compile-option = "-lstdx.encoding.jsonFFI"

[package.package-configuration."stdx.encoding.json.stream"]
  compile-option = "-lstdx.encoding.json.streamFFI"

[package.package-configuration."stdx.net.tls"]
  compile-option = "-lcangjie-dynamicLoader-opensslFFI -lstdx.net.tlsFFI -lstdx.crypto.keysFFI -lstdx.crypto.x509FFI"

[package.package-configuration."stdx.net.http"]
  compile-option = "-lcangjie-dynamicLoader-opensslFFI"

[target.x86_64-unknown-linux-gnu]
  link-option = "-L target/linux_ohos_aarch64_cjnative/static/stdx -L target/linux_x86_64_cjnative/static/stdx -L target/mock/linux_x86_64_cjnative/static/stdx -lstdx.fuzzFFI"

[target.aarch64-unknown-linux-gnu]
  link-option = "-L target/linux_ohos_aarch64_cjnative/static/stdx -L target/linux_aarch64_cjnative/static/stdx -L target/mock/linux_aarch64_cjnative/static/stdx -lstdx.fuzzFFI"

[target.aarch64-apple-darwin]
  link-option = "-L target/darwin_aarch64_cjnative/static/stdx -L /tmp/stdx/target/release/stdx -L target/mock/darwin_aarch64_cjnative/static/stdx -undefined suppress -flat_namespace -lstdx.fuzzFFI"

[target.x86_64-apple-darwin]
  link-option = "-L target/darwin_x86_64_cjnative/static/stdx -L /tmp/stdx/target/release/stdx -L target/mock/darwin_x86_64_cjnative/static/stdx -undefined suppress -flat_namespace -lstdx.fuzzFFI"

[target.x86_64-w64-mingw32]
  link-option = "-L target/windows_x86_64_cjnative/static/stdx -L target/mock/windows_x86_64_cjnative/static/stdx -lpthread -lws2_32 -lcrypt32"

[target.x86_64-linux-ohos]
  compile-option = "-B \"${DEVECO_CANGJIE_HOME}/build-tools/third_party/llvm/bin\" -B \"${DEVECO_OH_NATIVE_HOME}/sysroot/usr/lib/x86_64-linux-ohos\" -L \"${DEVECO_OH_NATIVE_HOME}/sysroot/usr/lib/x86_64-linux-ohos\" -L \"${DEVECO_OH_NATIVE_HOME}/llvm/lib/clang/15.0.4/lib/x86_64-linux-ohos\" -L \"${DEVECO_OH_NATIVE_HOME}/llvm/lib/x86_64-linux-ohos\" --sysroot \"${DEVECO_OH_NATIVE_HOME}/sysroot\""

[target.aarch64-linux-ohos]
  compile-option = "-L target/release/stdx -L target/debug/stdx -B \"${DEVECO_CANGJIE_HOME}/build-tools/third_party/llvm/bin\" -B \"${DEVECO_OH_NATIVE_HOME}/sysroot/usr/lib/aarch64-linux-ohos\" -L \"${DEVECO_OH_NATIVE_HOME}/sysroot/usr/lib/aarch64-linux-ohos\" -L \"${DEVECO_OH_NATIVE_HOME}/llvm/lib/clang/15.0.4/lib/aarch64-linux-ohos\" -L \"${DEVECO_OH_NATIVE_HOME}/llvm/lib/aarch64-linux-ohos\" --sysroot \"${DEVECO_OH_NATIVE_HOME}/sysroot\""