source: trunk/lib_ir/CMakeLists.txt @ 3909

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

initial commit of lib_ir

File size: 903 bytes
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 "")
10
11add_executable(test_s2p test_s2p.cpp s2p_optimized.o)
12add_executable(test_link test_link.cpp s2p_optimized.o)
13
14# compile s2p.ll, and make sure test_s2p depends on it.
15add_custom_command(
16  OUTPUT  s2p_optimized.o
17  COMMAND ${LLVM_OPT} -O3 ${LLVM_SSE_FLAGS} ${PROJECT_SOURCE_DIR}/s2p.ll -o s2p_optimized.bc
18  COMMAND ${LLVM_LLC} -O3 ${LLVM_SSE_FLAGS} -filetype=obj s2p_optimized.bc
19  DEPENDS ${PROJECT_SOURCE_DIR}/s2p.ll)
20
21enable_testing()
22add_test(
23  NAME ctest_s2p
24  COMMAND python ${PROJECT_SOURCE_DIR}/test_s2p.py)
25add_test(
26  NAME ctest_link
27  COMMAND python ${PROJECT_SOURCE_DIR}/test_link.py)
28
29add_custom_target (check
30  COMMAND ${CMAKE_CTEST_COMMAND}
31  DEPENDS test_s2p test_link)
Note: See TracBrowser for help on using the repository browser.