import("${tizen_core}/native/toolchains/toolchain.gni")

tizen_toolchain("x86") {
    gcc_prefix = "i586-linux-gnueabi"
    gcc_path = "${tizen_studio}/tools/i586-linux-gnueabi-gcc-9.2"

    llvm_target = "i586-tizen-linux-gnueabi"
    llvm_path  = "${tizen_studio}/tools/llvm-10"

    llvm_flags = [
        "-march=i586",
        "-Wno-gnu",
        "-fstack-protector-strong",
        "-Wno-unused-command-line-argument",
    ]
}

tizen_toolchain("arm") {
    gcc_prefix = "arm-linux-gnueabi"
    gcc_path = "${tizen_studio}/tools/arm-linux-gnueabi-gcc-9.2"

    llvm_target = "arm-tizen-linux-gnueabi"
    llvm_path  = "${tizen_studio}/tools/llvm-10"

    llvm_flags = [
        "-march=armv7-a",
        "-mfloat-abi=softfp",
        "-mfpu=vfpv3-d16",
        "-mtune=cortex-a8",
        "-Wno-gnu",
        "-fstack-protector-strong",
        "-Wno-unused-command-line-argument",
    ]
}

tizen_toolchain("aarch64") {
    gcc_prefix = "aarch64-linux-gnu"
    gcc_path = "${tizen_studio}/tools/aarch64-linux-gnu-gcc-9.2"

    llvm_target = "aarch64-tizen-linux-gnu"
    llvm_path  = "${tizen_studio}/tools/llvm-10"

    llvm_flags = [
        "-march=armv8-a+fp+simd+crc+crypto",
        "-Wno-gnu",
        "-fstack-protector-strong",
        "-Wno-unused-command-line-argument",
    ]
}

tizen_toolchain("x86_64") {
    gcc_prefix = "x86_64-linux-gnu"
    gcc_path = "${tizen_studio}/tools/x86_64-linux-gnu-gcc-9.2"

    llvm_target = "x86_64-tizen-linux-gnu"
    llvm_path  = "${tizen_studio}/tools/llvm-10"

    llvm_flags = [
        "-march=nehalem",
        "-msse4.2",
        "-mfpmath=sse",
        "-Wno-gnu",
        "-fstack-protector-strong",
        "-Wno-unused-command-line-argument",
    ]
}