forked from honggyukim/heaptrace
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Add CMakeLists.txt for cmake build
This patch adds cmake build support and basic usages are as follows. $ cmake -B out $ make -C out If you want to change the depth of stacktrace, then DEPTH variable can be provided as follows. $ cmake -B out -DDEPTH=32 $ make -C out If DEPTH is not given, then the default depth is 8 as written in CMakeLists.txt. We don't remove the existing Make build until we're sure that cmake looks stable enough. Signed-off-by: Honggyu Kim <[email protected]>
- Loading branch information
1 parent
9cc0413
commit 7638841
Showing
3 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,6 @@ heaptrace | |
*.out | ||
*.patch | ||
*.swp | ||
CMake* | ||
cmake_install.cmake | ||
compile_commands.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# SPDX-License-Identifier: GPL-2.0 | ||
|
||
cmake_minimum_required(VERSION 3.10) | ||
|
||
project(heaptrace) | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
|
||
add_compile_options("-Wno-psabi") | ||
|
||
if(NOT DEFINED DEPTH) | ||
set(DEPTH 8) | ||
endif(NOT DEFINED DEPTH) | ||
add_compile_definitions(DEPTH=${DEPTH}) | ||
|
||
add_library(libheaptrace SHARED src/libheaptrace.cc src/stacktrace.cc | ||
src/sighandler.cc src/utils.cc) | ||
set_property(TARGET libheaptrace PROPERTY OUTPUT_NAME heaptrace) | ||
|
||
add_executable(heaptrace src/heaptrace.cc) |