1include_directories(${CMAKE_HOME_DIRECTORY}) 2 3 4macro(add_code_gen_executable name) 5 add_executable(${name} ${name}.cpp) 6 target_link_libraries(${name} yap) 7 if (clang_on_linux) 8 target_link_libraries(${name} c++) 9 endif () 10endmacro() 11 12add_code_gen_executable(code_gen_samples) 13add_code_gen_executable(map_assign_code_gen) 14add_code_gen_executable(lazy_vector_perf) 15 16 17macro(add_perf_executable name) 18 add_executable(${name} ${name}.cpp) 19 add_dependencies(${name} benchmark) 20 target_link_libraries(${name} yap benchmark) 21 if (clang_on_linux) 22 target_link_libraries(${name} c++) 23 endif () 24endmacro() 25 26add_perf_executable(map_assign_perf) 27add_perf_executable(arithmetic_perf) 28 29include(Disassemble) 30set(disassemble_dump_targets) 31foreach(fun eval_as_cpp_expr eval_as_yap_expr eval_as_cpp_expr_4x eval_as_yap_expr_4x) 32 disassemble(disassemble.arithmetic_perf.${fun} EXECUTABLE arithmetic_perf FUNCTION ${fun}) 33 disassemble(disassemble.code_gen_samples.${fun} EXECUTABLE code_gen_samples FUNCTION ${fun}) 34 35 add_custom_target(disass_dump.${fun} 36 COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target disassemble.arithmetic_perf.${fun} 37 COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target disassemble.code_gen_samples.${fun} 38 ) 39 list(APPEND disassemble_dump_targets disass_dump.${fun}) 40endforeach() 41 42foreach(fun get_d1_with_yap get_d1_by_hand update_v1_with_yap update_v1_by_hand) 43 disassemble(disassemble.lazy_vector_perf.${fun} EXECUTABLE lazy_vector_perf FUNCTION ${fun}) 44 45 add_custom_target(disass_dump.${fun} 46 COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target disassemble.lazy_vector_perf.${fun} 47 ) 48 list(APPEND disassemble_dump_targets disass_dump.${fun}) 49endforeach() 50 51add_custom_target(perf 52 COMMAND map_assign_perf 53 COMMAND arithmetic_perf 54 55 DEPENDS ${disassemble_dump_targets} 56) 57