1foreach(TARGET ${LLVM_TARGETS_TO_BUILD}) 2 set(OCAML_LLVM_TARGET ${TARGET}) 3 4 foreach( ext ml mli ) 5 configure_file( 6 "${CMAKE_CURRENT_SOURCE_DIR}/llvm_backend.${ext}.in" 7 "${CMAKE_CURRENT_BINARY_DIR}/llvm_${TARGET}.${ext}") 8 endforeach() 9 10 configure_file( 11 "${CMAKE_CURRENT_SOURCE_DIR}/backend_ocaml.c" 12 "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_ocaml.c") 13 14 add_ocaml_library(llvm_${TARGET} 15 OCAML llvm_${TARGET} 16 C ${TARGET}_ocaml 17 CFLAGS -DTARGET=${TARGET} 18 LLVM ${TARGET} 19 NOCOPY) 20 21 configure_file( 22 "${CMAKE_CURRENT_SOURCE_DIR}/META.llvm_backend.in" 23 "${LLVM_LIBRARY_DIR}/ocaml/META.llvm_${TARGET}") 24 25 install(FILES "${LLVM_LIBRARY_DIR}/ocaml/META.llvm_${TARGET}" 26 DESTINATION lib/ocaml) 27endforeach() 28