-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Getting benchmark environment set up
- Loading branch information
Gabriele A. Ron
committed
Aug 16, 2022
1 parent
9f9c930
commit bfcecda
Showing
5 changed files
with
62 additions
and
0 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 |
---|---|---|
|
@@ -74,3 +74,5 @@ compile_commands.json | |
CTestTestfile.cmake | ||
_deps | ||
|
||
### Python stuff | ||
venv/ |
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,3 @@ | ||
[submodule "benchmark/extern/CppBenchmark"] | ||
path = benchmark/extern/CppBenchmark | ||
url = https://github.com/chronoxor/CppBenchmark |
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,44 @@ | ||
cmake_minimum_required(VERSION 3.20) | ||
project(HeapBenchmark VERSION 0.0.0 LANGUAGES CXX) | ||
|
||
find_package(FibonacciHeap 1.0.0 REQUIRED) | ||
|
||
add_executable(${PROJECT_NAME} app/main.cpp) | ||
target_link_libraries(${PROJECT_NAME} PRIVATE GRon::FibonacciHeap) | ||
|
||
find_package(Git QUIET) | ||
if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/../.git") | ||
# Update submodules as needed | ||
option(GIT_SUBMODULE "Check submodules during build" ON) | ||
if(GIT_SUBMODULE) | ||
message(STATUS "Submodule update") | ||
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
RESULT_VARIABLE GIT_SUBMOD_RESULT) | ||
if(NOT GIT_SUBMOD_RESULT EQUAL "0") | ||
message(FATAL_ERROR "git submodule update --init --recursive failed with ${GIT_SUBMOD_RESULT}, please checkout submodules") | ||
endif() | ||
endif() | ||
endif() | ||
|
||
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/extern/CppBenchmark/CMakeLists.txt") | ||
message(FATAL_ERROR "The submodules were not downloaded! GIT_SUBMODULE was turned off or failed. Please update submodules and try again.") | ||
endif() | ||
|
||
add_subdirectory(extern/CppBenchmark) | ||
target_link_libraries(${PROJECT_NAME} PRIVATE CppBenchmark) | ||
|
||
set_target_properties(${PROJECT_NAME} PROPERTIES | ||
CXX_STANDARD 20 | ||
CXX_STANDARD_REQUIRED ON | ||
CXX_EXTENSIONS OFF | ||
PREFIX "" | ||
) | ||
|
||
target_include_directories(${PROJECT_NAME} | ||
INTERFACE | ||
$<INSTALL_INTERFACE:include/> | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
) | ||
|
||
|
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,12 @@ | ||
#include "GRon/FibonacciHeap/FibonacciHeap.hpp" | ||
|
||
|
||
#include <iostream> | ||
#include <queue> | ||
|
||
|
||
int main(int argc, char* argv[]) { | ||
std::cout << "Hello World!" << std::endl; | ||
|
||
return 0; | ||
} |
Submodule CppBenchmark
added at
936a5b