source: trunk/lib_ir/CMakeLists.txt @ 3925

Last change on this file since 3925 was 3925, checked in by linmengl, 5 years ago

document a little bit, seperate xmlwf and xmlwf_perf, since they use different compiler flags

File size: 1.5 KB
Line 
1cmake_minimum_required (VERSION 2.8)
2project (IR_Library)
3
4set(CXX_SSE_FLAGS "-msse2 -march=pentium4")
5set(CMAKE_CXX_FLAGS "${CXX_SSE_FLAGS} -std=c++11 ")
6
7set(LLVM_OPT "opt-svn")
8set(LLVM_LLC "llc-svn")
9set(LLVM_SSE_FLAGS "-mattr=+sse2,-avx,-avx2,-sse3,-sse4.1,-sse4.2,-sse4a,-ssse3")
10
11add_executable(test_s2p test_s2p.cpp s2p_optimized.o)
12add_executable(test_link test_link.cpp s2p_optimized.o)
13add_executable(test_pack test_pack.cpp s2p_optimized.o)
14
15include_directories("xmlwf/util" "xmlwf/lib")
16add_executable(xmlwf xmlwf/src/xmlwf.cpp s2p_optimized.o)
17
18add_executable(xmlwf_perf xmlwf/src/xmlwf.cpp s2p_optimized.o)
19set_target_properties(xmlwf_perf
20  PROPERTIES
21  COMPILE_FLAGS "-DBUFFER_PROFILING -DPERF_SCRIPT"
22  )
23
24# compile s2p.ll, and make sure test_s2p depends on it.
25add_custom_command(
26  OUTPUT  s2p_optimized.o
27  COMMAND ${LLVM_OPT} -O3 ${LLVM_SSE_FLAGS} ${PROJECT_SOURCE_DIR}/s2p.ll -o s2p_optimized.bc
28  COMMAND ${LLVM_LLC} -O3 ${LLVM_SSE_FLAGS} -filetype=obj s2p_optimized.bc
29  DEPENDS ${PROJECT_SOURCE_DIR}/s2p.ll)
30
31enable_testing()
32add_test(
33  NAME ctest_s2p
34  COMMAND python ${PROJECT_SOURCE_DIR}/test_s2p.py)
35add_test(
36  NAME ctest_link
37  COMMAND python ${PROJECT_SOURCE_DIR}/test_link.py)
38add_test(
39  NAME ctest_pack
40  COMMAND ./test_pack)
41add_test(
42  NAME ctest_xmlwf
43  COMMAND python ${PROJECT_SOURCE_DIR}/xmlwf/run_all.py)
44
45add_custom_target (check
46  COMMAND ${CMAKE_CTEST_COMMAND}
47  DEPENDS test_s2p test_link test_pack xmlwf)
48
49add_custom_target (perf_xmlwf
50  COMMAND python ${PROJECT_SOURCE_DIR}/xmlwf/perf_script.py
51  DEPENDS xmlwf_perf)
Note: See TracBrowser for help on using the repository browser.