forked from jbreitbart/malloc_bt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
30 lines (23 loc) · 784 Bytes
/
CMakeLists.txt
File metadata and controls
30 lines (23 loc) · 784 Bytes
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
# General project settings
project(malloc_bt)
cmake_minimum_required(VERSION 2.8)
set(CMAKE_BUILD_TYPE Release)
########
# Compiler/linker options based on the different compilers
find_package(OpenMP)
if (OPENMP_FOUND)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
ADD_DEFINITIONS(-g -Ofast -march=native -std=c++11)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# Using GCC
ADD_DEFINITIONS(-g -O2 -march=native -std=c++11)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
# Using Intel C++
ADD_DEFINITIONS(-g -fast -std=c++11)
endif()
########
add_library(malloc_bt SHARED malloc_bt.cpp)
add_executable(test test.cpp)