-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
54 lines (39 loc) · 1.99 KB
/
Copy pathCMakeLists.txt
File metadata and controls
54 lines (39 loc) · 1.99 KB
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
# Usage:
# Create initial cmake build folder: cmake -S . -B .\build
# Create build with desired config: cmake --build .\build --config [Debug/Release/RelWithDebInfo/MinSizeRel]
#
# Clean command: cmake --build .\build --target clean
# If you want to play around with scheduler, you can just enable BUILD_MAIN which builds main.cpp file.
# To enable tracy profiler, build project with FINDER_ENABLE_TRACY=ON and make sure to have debug symbols (e.g. RelWithDebugInfo)
# You will also need tracy server, GUI etc. installed, since we are not build it from scratch (I tried couple of times and it failed, so I gave up).
# For windows, found needed binaries under releases https://github.com/wolfpld/tracy. Note that server (downloaded binaries) and client version (one compiled by finder) needs to be the same.
# Also, on windows, make sure to run program as administrator so tracy can collect stack traces.
cmake_minimum_required(VERSION 3.10)
project(finder)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # -> compile_commands.json
# Separate bin directory from build directory.
#
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/$<CONFIG>)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/$<CONFIG>)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/$<CONFIG>)
include(cmake/project_config.cmake)
include(cmake/sanitizers.cmake)
include(cmake/compiler_options.cmake)
set(CPP_FILES console.cpp os.cpp main.cpp)
set(HPP_FILES console.hpp os.hpp files.hpp finder.hpp symbol_finder.hpp symbols.hpp tokens.hpp config.hpp)
set(ALL_FILES ${CPP_FILES} ${HPP_FILES})
add_executable(finder ${CPP_FILES})
include(cmake/stl.cmake)
add_subdirectory(third_party/ums)
target_link_libraries(finder PRIVATE ums)
target_include_directories(finder SYSTEM PUBLIC third_party)
include(cmake/profilers.cmake)
if (FINDER_ENABLE_TRACY)
add_tracy(finder)
endif()
include(CTest)
add_subdirectory(test)
add_subdirectory(benchmark)