-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTracerConfig.cmake
56 lines (45 loc) · 1.94 KB
/
TracerConfig.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# In two-number form only. LLVM-Tracer will determine the patch version for you.
if(NOT DEFINED LLVM_RECOMMEND_VERSION)
SET(LLVM_RECOMMEND_VERSION 6.0)
# This is really poorly done in my opinion. It will search for one version of llvm and fails if it isn't the version recommended
# despite the fact it supports two version and hopefully three if this works. In any event, this needs to be set to the correct version
# that you're running before you proceed. You can check the clang version to find the version you're running. I recommend 6.0 because
# it's the newest.
endif()
# TODO : not used now
# the llvm libraries which the executable need.
SET(NEED_LLVM_LIB mcjit native bitwriter jit interpreter
nativecodegen linker irreader)
SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -Wall -W -Wno-unused-parameter
-Wwrite-strings -pedantic -Wno-long-long -std=c++11)
STRING(REPLACE ";" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
# sets debug level to g3, which contains more infomation than g2.
# to use it : cmake /where/source/code -DCMAKE_BUILD_TYPE=DEBUG
set(CMAKE_CXX_FLAGS_DEBUG "-g3 -O0")
# Builds an optimized tracer for release.
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
# If we don't specify a build type, build for release.
if (CMAKE_BUILD_TYPE STREQUAL "")
set (CMAKE_BUILD_TYPE RELEASE)
endif()
if(NOT DEFINED TEST_CMAKE)
SET(TEST_CMAKE FALSE)
endif()
SET(RECOMMAND_LLVM_PREFIX ${CMAKE_BINARY_DIR}/lib/llvm-${LLVM_RECOMMEND_VERSION})
if(NOT DEFINED AUTOINSTALL)
SET(AUTOINSTALL FALSE)
endif()
if(DEFINED LLVM_ROOT)
get_filename_component(LLVM_ROOT ${LLVM_ROOT} ABSOLUTE)
elseif("$ENV{LLVM_HOME}" STREQUAL "")
set(LLVM_ROOT ${RECOMMAND_LLVM_PREFIX})
else()
if(${AUTOINSTALL})
message(FATAL_ERROR "please specify LLVM_ROOT explicitly if you ready want to autoinstall LLVM")
endif()
set(LLVM_ROOT "$ENV{LLVM_HOME}")
endif()
message(STATUS "use LLVM_ROOT : ${LLVM_ROOT}")
if(NOT DEFINED GEN_HEADER_DEPENDENCY)
SET(GEN_HEADER_DEPENDENCY FALSE)
endif()