Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0a5f8ea6bc | |||
| 5ab176fdf0 |
@ -1,18 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
project(mLogger)
|
||||
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
add_library(${PROJECT_NAME} SHARED)
|
||||
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC include)
|
||||
|
||||
file(GLOB prj_src src/*)
|
||||
|
||||
target_sources(${PROJECT_NAME} PRIVATE ${prj_src})
|
||||
|
||||
# target_compile_options(${PROJECT_NAME} PRIVATE -fsanitize=thread)
|
||||
# target_link_options(${PROJECT_NAME} PRIVATE -fsanitize=thread)
|
||||
|
||||
add_subdirectory(bench)
|
||||
add_subdirectory(tests)
|
||||
@ -1,10 +0,0 @@
|
||||
{
|
||||
"version": 4,
|
||||
"vendor": {
|
||||
"conan": {}
|
||||
},
|
||||
"include": [
|
||||
"build/Release/generators/CMakePresets.json",
|
||||
"build/Debug/generators/CMakePresets.json"
|
||||
]
|
||||
}
|
||||
12
README.md
Normal file
12
README.md
Normal file
@ -0,0 +1,12 @@
|
||||
## HOW TO RUN
|
||||
|
||||
```sh
|
||||
conan install . --build missing --output-folder=build
|
||||
```
|
||||
|
||||
This will create all necessary .pc file on build directory
|
||||
After that you can run meson setup command like below:
|
||||
|
||||
```sh
|
||||
meson setup build --native-file build/conan_meson_native.ini
|
||||
```
|
||||
@ -1,16 +0,0 @@
|
||||
|
||||
find_package(benchmark REQUIRED)
|
||||
find_package(glog REQUIRED)
|
||||
set(NAME ${PROJECT_NAME}_bench)
|
||||
|
||||
add_executable(${NAME} main.cc)
|
||||
|
||||
target_link_libraries(${NAME} PRIVATE
|
||||
benchmark::benchmark_main
|
||||
benchmark::benchmark
|
||||
glog::glog
|
||||
${PROJECT_NAME}
|
||||
)
|
||||
|
||||
# target_compile_options(${NAME} PRIVATE -fsanitize=thread)
|
||||
# target_link_options(${NAME} PRIVATE -fsanitize=thread)
|
||||
13
bench/meson.build
Normal file
13
bench/meson.build
Normal file
@ -0,0 +1,13 @@
|
||||
benchmark_dep = dependency('benchmark', required: true)
|
||||
glog_dep = dependency('libglog', required: true)
|
||||
|
||||
bench_exe = executable(
|
||||
'mLogger_bench',
|
||||
'main.cc',
|
||||
dependencies: [
|
||||
benchmark_dep,
|
||||
glog_dep,
|
||||
mLogger_dep
|
||||
],
|
||||
install: false
|
||||
)
|
||||
@ -12,7 +12,5 @@ boost/*:without_lockfree = False
|
||||
boost/*:without_* = True
|
||||
|
||||
[generators]
|
||||
CMakeDeps
|
||||
CMakeToolchain
|
||||
[layout]
|
||||
cmake_layout
|
||||
PkgConfigDeps
|
||||
MesonToolchain
|
||||
17
meson.build
Normal file
17
meson.build
Normal file
@ -0,0 +1,17 @@
|
||||
project('mLogger', 'cpp')
|
||||
|
||||
src_files = ['src/logger.cc']
|
||||
inc = include_directories('include')
|
||||
|
||||
mLogger_lib = library(
|
||||
'mLogger',
|
||||
src_files,
|
||||
include_directories: inc,
|
||||
install: false
|
||||
)
|
||||
|
||||
mLogger_dep = declare_dependency(link_with : mLogger_lib,
|
||||
include_directories : inc)
|
||||
|
||||
subdir('bench')
|
||||
subdir('tests')
|
||||
@ -1,19 +0,0 @@
|
||||
enable_testing()
|
||||
|
||||
find_package(GTest REQUIRED)
|
||||
include(GoogleTest)
|
||||
|
||||
find_package(Boost REQUIRED COMPONENTS thread)
|
||||
|
||||
set(NAME ${PROJECT_NAME}_tests)
|
||||
|
||||
add_executable(${NAME} main.cc)
|
||||
|
||||
target_link_libraries(${NAME} PRIVATE
|
||||
GTest::gtest
|
||||
Boost::thread
|
||||
${PROJECT_NAME}
|
||||
)
|
||||
gtest_discover_tests(${NAME})
|
||||
# target_compile_options(${NAME} PRIVATE -fsanitize=thread)
|
||||
# target_link_options(${NAME} PRIVATE -fsanitize=thread)
|
||||
15
tests/meson.build
Normal file
15
tests/meson.build
Normal file
@ -0,0 +1,15 @@
|
||||
gtest_dep = dependency('gtest', main: false, required: true)
|
||||
boost_thread_dep = dependency('boost', modules: ['thread'], required: true)
|
||||
|
||||
tests_exe = executable(
|
||||
'mLogger_tests',
|
||||
'main.cc',
|
||||
dependencies: [
|
||||
gtest_dep,
|
||||
boost_thread_dep,
|
||||
mLogger_dep
|
||||
],
|
||||
install: false
|
||||
)
|
||||
|
||||
test('gtest tests', tests_exe)
|
||||
Loading…
x
Reference in New Issue
Block a user