summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 366b4c409532a18307db60e854735ca29ca04413 (plain)
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
#
# Project configuration
#

cmake_minimum_required(VERSION 2.6)
project(pChase)

SET(CMAKE_BUILD_TYPE "Release")

set (pChase_VERSION_MAJOR 0)
set (pChase_VERSION_MINOR 4)

find_package(Threads)

find_library(LIBNUMA numa)
option(USE_LIBNUMA "Build against NUMA libraries" ON) 

include_directories(lib)
add_subdirectory(lib/AsmJit)


#
# Code compilation
#

add_library(experiment src/experiment.h src/experiment.cpp)

add_library(thread src/thread.h src/thread.cpp)

add_library(lock src/lock.h src/lock.cpp)

add_library(output src/output.h src/output.cpp)

add_library(run src/run.h src/run.cpp)
target_link_libraries(run lock thread)

add_library(spinbarrier src/spinbarrier.h src/spinbarrier.cpp)

add_library(timer src/timer.h src/timer.cpp)

add_executable (chase src/main.cpp)
target_link_libraries(chase run timer output experiment spinbarrier)
target_link_libraries(chase ${CMAKE_THREAD_LIBS_INIT})
if (USE_LIBNUMA)
	if(LIBNUMA)
		target_link_libraries(pChase ${LIBNUMA})
	else ()
		message(STATUS "WARNING: libnuma not found, not compiling against it")
	endif ()
endif ()
target_link_libraries(chase AsmJit)