File: CMakeLists.txt

package info (click to toggle)
cpptrace 1.0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,996 kB
  • sloc: cpp: 15,646; python: 962; ansic: 155; sh: 103; makefile: 86
file content (48 lines) | stat: -rw-r--r-- 1,434 bytes parent folder | download
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
include(FetchContent)

FetchContent_Declare(
  lyra
  GIT_SHALLOW    TRUE
  GIT_REPOSITORY "https://github.com/bfgroup/Lyra.git"
  GIT_TAG        "ee3c076fa6b9d64c9d249a21f5b9b5a8dae92cd8"
)
FetchContent_MakeAvailable(lyra)

FetchContent_Declare(
  fmt
  GIT_SHALLOW    TRUE
  GIT_REPOSITORY "https://github.com/fmtlib/fmt.git"
  GIT_TAG        "e69e5f977d458f2650bb346dadf2ad30c5320281" # v10.2.1
)
FetchContent_MakeAvailable(fmt)

set(
  COMMON_LIBS
  cpptrace::cpptrace
  bfg::lyra
  fmt::fmt
)

function(binary TARGET)
  cmake_parse_arguments(BINARY "" "" "SOURCES;LIBS;FLAGS;DEFS" ${ARGN})
  add_executable(${TARGET} main.cpp)
  if(BINARY_SOURCES)
    add_library(${TARGET}_OBJ OBJECT ${BINARY_SOURCES})
    target_link_libraries(${TARGET}_OBJ PUBLIC ${COMMON_LIBS})
  endif()
  target_link_libraries(${TARGET} PUBLIC ${COMMON_LIBS})
  target_link_libraries(${TARGET} PUBLIC ${BINARY_LIBS})
  target_compile_definitions(${TARGET} PUBLIC ${BINARY_DEFS})
  target_compile_options(${TARGET} PUBLIC ${BINARY_FLAGS} ${debug} ${warning_options} $<$<CXX_COMPILER_ID:MSVC>:/Zc:__cplusplus>)
  target_include_directories(${TARGET} PUBLIC "${PROJECT_SOURCE_DIR}/src")
  target_compile_features(${TARGET} PRIVATE cxx_std_20)
  set_target_properties(
    ${TARGET}
    PROPERTIES
    RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
  )
endfunction()

add_subdirectory(dwarfdump)
add_subdirectory(symbol_tables)
add_subdirectory(resolver)