-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
216 changed files
with
189 additions
and
98 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 |
---|---|---|
@@ -1,70 +1,34 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
project(ursadb VERSION 1.3.0) | ||
project(ursadb VERSION 1.3.0 | ||
LANGUAGES CXX) | ||
|
||
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) | ||
include(ClangFormat) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_FLAGS "-Wall") | ||
|
||
message("Looking for clang-format") | ||
find_program(CLANG_FORMAT_EXEC clang-format) | ||
if(NOT EXISTS ${CLANG_FORMAT_EXEC}) | ||
message(WARNING "clang-format not found! Target 'format' won't be available") | ||
else() | ||
file(GLOB FORMAT_SOURCES *.cpp *.h) | ||
add_custom_target(format | ||
COMMAND | ||
${CLANG_FORMAT_EXEC} | ||
-style=file | ||
-i | ||
${FORMAT_SOURCES} | ||
WORKING_DIRECTORY | ||
${CMAKE_SOURCE_DIR} | ||
COMMENT | ||
"Formatting..." | ||
) | ||
endif() | ||
|
||
configure_file(Version.h.in Version.h) | ||
|
||
add_library( | ||
ursa | ||
STATIC | ||
Utils.cpp | ||
OnDiskDataset.cpp | ||
OnDiskIterator.cpp | ||
DatasetBuilder.cpp | ||
Database.cpp | ||
Trim.cpp | ||
OnDiskIndex.cpp | ||
FlatIndexBuilder.cpp | ||
BitmapIndexBuilder.cpp | ||
MemMap.cpp | ||
Query.cpp | ||
QueryParser.cpp | ||
ExclusiveFile.cpp | ||
DatabaseSnapshot.cpp | ||
Task.cpp | ||
Indexer.cpp | ||
DatabaseHandle.cpp | ||
ZHelpers.cpp | ||
Responses.cpp | ||
RawFile.cpp | ||
OnDiskFileIndex.cpp | ||
) | ||
target_include_directories(ursa PRIVATE ${PROJECT_BINARY_DIR}) | ||
target_link_libraries(ursa -lstdc++fs -lzmq -pthread) | ||
add_subdirectory(libursa) | ||
|
||
add_executable(ursadb Daemon.cpp NetworkService.cpp) | ||
add_executable(ursadb src/Daemon.cpp | ||
src/Daemon.h | ||
src/NetworkService.cpp | ||
src/NetworkService.h) | ||
target_include_directories(ursadb PUBLIC ${CMAKE_SOURCE_DIR}) | ||
target_link_libraries(ursadb ursa) | ||
|
||
add_executable(ursadb_new NewDatabase.cpp) | ||
add_executable(ursadb_new src/NewDatabase.cpp) | ||
target_include_directories(ursadb_new PUBLIC ${CMAKE_SOURCE_DIR}) | ||
target_link_libraries(ursadb_new ursa) | ||
|
||
add_executable(ursadb_trim Trim.cpp) | ||
add_executable(ursadb_trim src/Trim.cpp) | ||
target_include_directories(ursadb_trim PUBLIC ${CMAKE_SOURCE_DIR}) | ||
target_link_libraries(ursadb_trim ursa) | ||
|
||
add_executable(ursadb_test Tests.cpp) | ||
add_executable(ursadb_test src/Tests.cpp) | ||
target_include_directories(ursadb_test PUBLIC ${CMAKE_SOURCE_DIR}) | ||
target_link_libraries(ursadb_test ursa) | ||
|
||
add_executable(ursadb_bench Benchmark.cpp) | ||
target_link_libraries(ursadb_bench ursa) | ||
add_executable(ursadb_bench src/Benchmark.cpp) | ||
target_include_directories(ursadb_bench PUBLIC ${CMAKE_SOURCE_DIR}) | ||
target_link_libraries(ursadb_bench ursa) |
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,48 @@ | ||
# Copyright Tomas Zeman 2019. | ||
# Distributed under the Boost Software License, Version 1.0. | ||
# (See accompanying file LICENSE_1_0.txt or copy at | ||
# http://www.boost.org/LICENSE_1_0.txt) | ||
|
||
function(clangformat_setup) | ||
if(NOT CLANGFORMAT_EXECUTABLE) | ||
set(CLANGFORMAT_EXECUTABLE clang-format) | ||
endif() | ||
|
||
if(NOT EXISTS ${CLANGFORMAT_EXECUTABLE}) | ||
find_program(clangformat_executable_tmp ${CLANGFORMAT_EXECUTABLE}) | ||
if(clangformat_executable_tmp) | ||
set(CLANGFORMAT_EXECUTABLE ${clangformat_executable_tmp}) | ||
unset(clangformat_executable_tmp) | ||
else() | ||
message(FATAL_ERROR "ClangFormat: ${CLANGFORMAT_EXECUTABLE} not found! Aborting") | ||
endif() | ||
endif() | ||
|
||
foreach(clangformat_source ${ARGV}) | ||
get_filename_component(clangformat_source ${clangformat_source} ABSOLUTE) | ||
list(APPEND clangformat_sources ${clangformat_source}) | ||
endforeach() | ||
|
||
add_custom_target(${PROJECT_NAME}_clangformat | ||
COMMAND | ||
${CLANGFORMAT_EXECUTABLE} | ||
-style=file | ||
-i | ||
${clangformat_sources} | ||
WORKING_DIRECTORY | ||
${CMAKE_SOURCE_DIR} | ||
COMMENT | ||
"Formating with ${CLANGFORMAT_EXECUTABLE} ..." | ||
) | ||
|
||
if(TARGET clangformat) | ||
add_dependencies(clangformat ${PROJECT_NAME}_clangformat) | ||
else() | ||
add_custom_target(clangformat DEPENDS ${PROJECT_NAME}_clangformat) | ||
endif() | ||
endfunction() | ||
|
||
function(target_clangformat_setup target) | ||
get_target_property(target_sources ${target} SOURCES) | ||
clangformat_setup(${target_sources}) | ||
endfunction() |
File renamed without changes.
File renamed without changes.
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,57 @@ | ||
add_library( | ||
ursa | ||
STATIC | ||
BitmapIndexBuilder.cpp | ||
Database.h | ||
DatasetBuilder.h | ||
IndexBuilder.h | ||
OnDiskDataset.cpp | ||
OnDiskIterator.cpp | ||
RawFile.cpp | ||
Task.h | ||
BitmapIndexBuilder.h | ||
DatabaseHandle.cpp | ||
ExclusiveFile.cpp | ||
Indexer.cpp | ||
OnDiskDataset.h | ||
OnDiskIterator.h | ||
RawFile.h | ||
Utils.cpp | ||
DatabaseHandle.h | ||
ExclusiveFile.h | ||
Indexer.h | ||
OnDiskFileIndex.cpp | ||
Query.cpp | ||
Responses.cpp | ||
Utils.h | ||
Command.h | ||
DatabaseSnapshot.cpp | ||
Json.h | ||
OnDiskFileIndex.h | ||
Query.h | ||
Responses.h | ||
Version.h.in | ||
Core.h | ||
DatabaseSnapshot.h | ||
FlatIndexBuilder.cpp | ||
MemMap.cpp | ||
OnDiskIndex.cpp | ||
QueryParser.cpp | ||
ResultWriter.h | ||
ZHelpers.cpp | ||
Database.cpp | ||
DatasetBuilder.cpp | ||
FlatIndexBuilder.h | ||
MemMap.h | ||
OnDiskIndex.h | ||
QueryParser.h | ||
Task.cpp | ||
ZHelpers.h | ||
) | ||
configure_file(Version.h.in | ||
${PROJECT_BINARY_DIR}/generated/Version.h) | ||
|
||
target_include_directories(ursa PRIVATE . | ||
PRIVATE ${PROJECT_BINARY_DIR}/generated) | ||
target_link_libraries(ursa -lstdc++fs -lzmq -pthread) | ||
target_clangformat_setup(ursa) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#pragma once | ||
|
||
#include "lib/Json.h" | ||
#include "extern/json/Json.h" | ||
|
||
using json = nlohmann::json; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,22 @@ | ||
add_executable(ursadb Daemon.cpp | ||
Daemon.h | ||
NetworkService.cpp | ||
NetworkService.h) | ||
target_link_libraries(ursadb ursa) | ||
target_clangformat_setup(ursadb) | ||
|
||
add_executable(ursadb_new NewDatabase.cpp) | ||
target_link_libraries(ursadb_new ursa) | ||
target_clangformat_setup(ursadb_new) | ||
|
||
add_executable(ursadb_trim Trim.cpp) | ||
target_link_libraries(ursadb_trim ursa) | ||
target_clangformat_setup(ursadb_trim) | ||
|
||
add_executable(ursadb_test Tests.cpp) | ||
target_link_libraries(ursadb_test ursa) | ||
target_clangformat_setup(ursadb_test) | ||
|
||
add_executable(ursadb_bench Benchmark.cpp) | ||
target_link_libraries(ursadb_bench ursa) | ||
target_clangformat_setup(ursadb_bench) |
File renamed without changes.
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
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
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
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