initial implementation + example + cmake "build"
This commit is contained in:
parent
9c6722f99a
commit
8a1f29a44b
15 changed files with 1130 additions and 0 deletions
21
example/CMakeLists.txt
Normal file
21
example/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
set(PROJECT_CXX_FLAGS "--std=c++20")
|
||||
|
||||
add_definitions(${PROJECT_CXX_FLAGS})
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "")
|
||||
|
||||
#include(cmake/FindSphinx.cmake)
|
||||
|
||||
add_subdirectory(ex1)
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# make standard directories for std:: includes explicit
|
||||
# so that
|
||||
# (1) they appear in compile_commands.json.
|
||||
# (2) clangd (run from emacs lsp-mode) can find them
|
||||
#
|
||||
if(CMAKE_EXPORT_COMPILE_COMMANDS)
|
||||
set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES
|
||||
${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES})
|
||||
endif()
|
||||
3
example/ex1/CMakeLists.txt
Normal file
3
example/ex1/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
add_executable(ex1 ex1.cpp)
|
||||
|
||||
target_include_directories(ex1 PUBLIC ${PROJECT_SOURCE_DIR}/include)
|
||||
14
example/ex1/ex1.cpp
Normal file
14
example/ex1/ex1.cpp
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#include "nestlog/scope.hpp"
|
||||
|
||||
using namespace xo;
|
||||
|
||||
void A(int x) {
|
||||
XO_SCOPE(log);
|
||||
|
||||
log("x:", x);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char ** argv) {
|
||||
A(66);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue