source: trunk/lib_ir/CMakeLists.txt @ 3923

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

copy xmlwf in and compile it with ir lib

File size: 1.2 KB
Line 
1cmake_minimum_required (VERSION 2.8)
2project (IR_Library)
3
4set(CXX_SSE_FLAGS "-msse2")
5set(CMAKE_CXX_FLAGS "${CXX_SSE_FLAGS} -O3 -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
18# compile s2p.ll, and make sure test_s2p depends on it.
19add_custom_command(
20  OUTPUT  s2p_optimized.o
21  COMMAND ${LLVM_OPT} -O3 ${LLVM_SSE_FLAGS} ${PROJECT_SOURCE_DIR}/s2p.ll -o s2p_optimized.bc
22  COMMAND ${LLVM_LLC} -O3 ${LLVM_SSE_FLAGS} -filetype=obj s2p_optimized.bc
23  DEPENDS ${PROJECT_SOURCE_DIR}/s2p.ll)
24
25enable_testing()
26add_test(
27  NAME ctest_s2p
28  COMMAND python ${PROJECT_SOURCE_DIR}/test_s2p.py)
29add_test(
30  NAME ctest_link
31  COMMAND python ${PROJECT_SOURCE_DIR}/test_link.py)
32add_test(
33  NAME ctest_pack
34  COMMAND ./test_pack)
35add_test(
36  NAME ctest_xmlwf
37  COMMAND python ${PROJECT_SOURCE_DIR}/xmlwf/run_all.py)
38
39add_custom_target (check
40  COMMAND ${CMAKE_CTEST_COMMAND}
41  DEPENDS test_s2p test_link test_pack xmlwf)
Note: See TracBrowser for help on using the repository browser.