
set(jit_file ${PADDLE_BINARY_DIR}/lite/backends/x86/jit/kernels.h)
file(WRITE ${jit_file} "// Generated by the lite/backends/x86/jit/CMakeLists.txt.  DO NOT EDIT!\n\n")
file(APPEND ${jit_file} "\#pragma once\n")
file(APPEND ${jit_file} "\#include \"lite/backends/x86/jit/helper.h\"\n")
file(APPEND ${jit_file} "\#include \"lite/backends/x86/jit/registry.h\"\n\n")

set(JIT_KERNEL_DEPS x86_cpu_info cblas gflags xxhash)

file(GLOB jit_kernel_cc_srcs RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.cc")
list(REMOVE_ITEM jit_kernel_cc_srcs test.cc benchmark.cc)
lite_cc_library(jit_kernel_base SRCS ${jit_kernel_cc_srcs} DEPS ${JIT_KERNEL_DEPS})

# refer must go first
add_subdirectory(refer)
add_subdirectory(more)
if(WITH_XBYAK)
    add_subdirectory(gen)
endif()

lite_cc_library(jit_kernel_helper SRCS ${jit_kernel_cc_srcs} DEPS ${JIT_KERNEL_DEPS})
#lite_cc_test(jit_kernel_test SRCS test.cc DEPS jit_kernel_helper)

#if(NOT WIN32)
    #lite_cc_binary(jit_kernel_benchmark SRCS benchmark.cc DEPS jit_kernel_helper tensor)
#endif()
