Skip to content

Commit

Permalink
(Issue 209, 275) Make library truly header-only (ZigRazor#276)
Browse files Browse the repository at this point in the history
* Remove CXXGraphConfig.h.in dependency.

* Streamline graph rw

* Add missing public API methods

* Match the current version for some files

* Match up some more things

* More cleanup

* Get things building

* Fixup documentation

---------

Co-authored-by: Alberto Merino Risueño <[email protected]>
  • Loading branch information
nrkramer and amerinor01 authored May 7, 2023
1 parent 5c68d55 commit 19cc5d7
Show file tree
Hide file tree
Showing 7 changed files with 281 additions and 195 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,5 @@
build/
# ignore the packaging folder contents from git
packaging/
# graph config is automatically setup, so we can ignore this
include/CXXGraphConfig.h
# ignore vscode files
.vscode
46 changes: 38 additions & 8 deletions benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,47 @@ if(BENCHMARK)
GIT_TAG origin/main
)

FetchContent_MakeAvailable(googlebenchmark)
FetchContent_Declare(
openssl
GIT_REPOSITORY https://github.com/janbar/openssl-cmake.git
GIT_TAG origin/master
OPTIONS "WITH_APPS OFF"
)

FetchContent_Declare(
zlib
GIT_REPOSITORY https://github.com/madler/zlib.git
GIT_TAG v1.2.13
OPTIONS "CMAKE_POSITION_INDEPENDENT_CODE True"
)

set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)

set(WITH_APPS OFF CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(openssl)

set(SAVE_CMAKE_POSITION_INDEPENDENT_CODE ${CMAKE_POSITION_INDEPENDENT_CODE})
set(CMAKE_POSITION_INDEPENDENT_CODE True)
FetchContent_MakeAvailable(zlib)
set(CMAKE_POSITION_INDEPENDENT_CODE ${SAVE_CMAKE_POSITION_INDEPENDENT_CODE})

file (GLOB BENCHMARK_FILES "*.cpp" "*.hpp")
add_executable(benchmark_exe ${BENCHMARK_FILES})

target_compile_definitions(benchmark_exe
PUBLIC WITH_COMPRESSION
)
target_include_directories(benchmark_exe PUBLIC
"${PROJECT_SOURCE_DIR}/include"
)
PUBLIC "${PROJECT_SOURCE_DIR}/include"
PUBLIC ${zlib_BINARY_DIR}
PUBLIC ${zlib_SOURCE_DIR}
PUBLIC ${openssl_SOURCE_DIR}/include
)
target_link_libraries(benchmark_exe
benchmark::benchmark
pthread
ssl
crypto
z)
PUBLIC benchmark::benchmark
PUBLIC pthread
PUBLIC ssl
PUBLIC crypto
PUBLIC zlibstatic)
endif(BENCHMARK)
4 changes: 4 additions & 0 deletions include/CXXGraphConfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// the configured options and settings for CXXGraph
#define CXXGraph_VERSION_MAJOR 1
#define CXXGraph_VERSION_MINOR 0
#define CXXGraph_VERSION_PATCH 0
Loading

0 comments on commit 19cc5d7

Please sign in to comment.