Skip to content

Commit 7275cf7

Browse files
committed
BLD: Upgrade CMake version
1 parent a18cf58 commit 7275cf7

File tree

10 files changed

+40
-53
lines changed

10 files changed

+40
-53
lines changed

CHANGELOG.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,20 @@
77
messages
88
- Converting a `v1::SystemMsg` to a `v2::SystemMsg` now sets to `code` to the heartbeat
99
value
10-
- Introduced `kAssetCstrLen` constant containing the size of `asset` field in `InstrumentDefMsg`
10+
- Introduced `kAssetCstrLen` constant containing the size of `asset` field in
11+
`InstrumentDefMsg`
1112

1213
### Breaking changes
14+
- Increased the size of `asset` field in `v3::InstrumentDefMsg` from 7 to 11. The
15+
`v3::InstrumentDefMsg` message size remains 520 bytes.
16+
- Set minimum CMake version to 3.24
1317
- Changed type of `code` field in `SystemMsg` to `SystemCode`
1418
- Changed type of `code` field in `ErrorMsg` to `ErrorCode`
15-
- Increased the size of `asset` field in `v3::InstrumentDefMsg` from 7 to 11. The `v3::InstrumentDefMsg` message size remains 520 bytes.
1619

1720
### Bug fixes
1821
- Changed `TriState` to a regular enum to handle unexpected values
22+
- Fixed `ccache` support
23+
- Changed to explicitly only support being built as a static library
1924

2025
## 0.33.0 - 2025-04-15
2126

CMakeLists.txt

Lines changed: 24 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
cmake_minimum_required(VERSION 3.14)
1+
cmake_minimum_required(VERSION 3.24..4.0)
22

33
#
44
# Project details
55
#
66

7-
project("databento" VERSION 0.33.0 LANGUAGES CXX)
7+
project(
8+
databento
9+
VERSION 0.33.0
10+
LANGUAGES CXX
11+
DESCRIPTION "Official Databento client library"
12+
)
813
string(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPERCASE)
914

1015
#
@@ -83,6 +88,7 @@ endif()
8388

8489
add_library(
8590
${PROJECT_NAME}
91+
STATIC
8692
${headers}
8793
${sources}
8894
)
@@ -101,6 +107,7 @@ message(STATUS "Added all header and implementation files.")
101107
#
102108

103109
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17)
110+
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_EXTENSIONS OFF)
104111
include(cmake/CompilerWarnings.cmake)
105112
set_target_warnings(${PROJECT_NAME})
106113
include(cmake/Sanitizers.cmake)
@@ -143,19 +150,11 @@ else()
143150
set(json_version 3.11.3)
144151
# Required to correctly install nlohmann_json
145152
set(JSON_Install ON)
146-
if(CMAKE_VERSION VERSION_LESS 3.24)
147-
FetchContent_Declare(
148-
json
149-
URL https://github.com/nlohmann/json/releases/download/v${json_version}/json.tar.xz
150-
)
151-
else()
152-
# DOWNLOAD_EXTRACT_TIMESTAMP added in 3.24
153-
FetchContent_Declare(
154-
json
155-
URL https://github.com/nlohmann/json/releases/download/v${json_version}/json.tar.xz
156-
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
157-
)
158-
endif()
153+
FetchContent_Declare(
154+
json
155+
URL https://github.com/nlohmann/json/releases/download/v${json_version}/json.tar.xz
156+
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
157+
)
159158
FetchContent_MakeAvailable(json)
160159
# Ignore compiler warnings in headers
161160
add_system_include_property(nlohmann_json)
@@ -175,19 +174,11 @@ if(${PROJECT_NAME_UPPERCASE}_USE_EXTERNAL_HTTPLIB)
175174
endif()
176175
else()
177176
set(httplib_version 0.20.0)
178-
if(CMAKE_VERSION VERSION_LESS 3.24)
179-
FetchContent_Declare(
180-
httplib
181-
URL https://github.com/yhirose/cpp-httplib/archive/refs/tags/v${httplib_version}.tar.gz
182-
)
183-
else()
184-
# DOWNLOAD_EXTRACT_TIMESTAMP added in 3.24
185-
FetchContent_Declare(
186-
httplib
187-
URL https://github.com/yhirose/cpp-httplib/archive/refs/tags/v${httplib_version}.tar.gz
188-
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
189-
)
190-
endif()
177+
FetchContent_Declare(
178+
httplib
179+
URL https://github.com/yhirose/cpp-httplib/archive/refs/tags/v${httplib_version}.tar.gz
180+
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
181+
)
191182
FetchContent_MakeAvailable(httplib)
192183
# Ignore compiler warnings in headers
193184
add_system_include_property(httplib)
@@ -207,19 +198,11 @@ if(${PROJECT_NAME_UPPERCASE}_USE_EXTERNAL_DATE)
207198
endif()
208199
else()
209200
set(date_version 3.0.3)
210-
if(CMAKE_VERSION VERSION_LESS 3.24)
211-
FetchContent_Declare(
212-
date_src
213-
URL https://github.com/HowardHinnant/date/archive/refs/tags/v${date_version}.tar.gz
214-
)
215-
else()
216-
# DOWNLOAD_EXTRACT_TIMESTAMP added in 3.24
217-
FetchContent_Declare(
218-
date_src
219-
URL https://github.com/HowardHinnant/date/archive/refs/tags/v${date_version}.tar.gz
220-
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
221-
)
222-
endif()
201+
FetchContent_Declare(
202+
date_src
203+
URL https://github.com/HowardHinnant/date/archive/refs/tags/v${date_version}.tar.gz
204+
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
205+
)
223206
FetchContent_MakeAvailable(date_src)
224207
# Ignore compiler warnings in headers
225208
add_system_include_property(date)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The client supports both streaming real-time and historical market data through
99

1010
## Usage
1111

12-
The minimum C++ standard is C++17 and the minimum CMake version is 3.14.
12+
The minimum C++ standard is C++17 and the minimum CMake version is 3.24.
1313

1414
### Integration
1515

@@ -18,7 +18,7 @@ Your `CMakeLists.txt` should look something like the following:
1818

1919
```cmake
2020
# CMakeLists.txt
21-
cmake_minimum_required(VERSION 3.14)
21+
cmake_minimum_required(VERSION 3.24)
2222
2323
project(databento_example)
2424
include(FetchContent)

cmake/StandardSettings.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ if(${PROJECT_NAME_UPPERCASE}_ENABLE_CCACHE)
7575
find_program(CCACHE_FOUND ccache)
7676
if(CCACHE_FOUND)
7777
message(STATUS "Found and enabled ccache")
78-
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
79-
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
78+
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
8079
endif()
8180
endif()

examples/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14)
1+
cmake_minimum_required(VERSION 3.24)
22

33
project(
44
${CMAKE_PROJECT_NAME}Examples

examples/historical/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14)
1+
cmake_minimum_required(VERSION 3.24)
22

33
add_example_target(batch batch.cpp)
44
add_example_target(metadata metadata.cpp)

examples/live/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14)
1+
cmake_minimum_required(VERSION 3.24)
22

33
add_example_target(live-readme readme.cpp)
44
add_example_target(simple simple.cpp)

tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14)
1+
cmake_minimum_required(VERSION 3.24)
22

33
#
44
# Project details

tests/cmake_fetch_content/project/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14)
1+
cmake_minimum_required(VERSION 3.24)
22

33
project(DummyImport LANGUAGES CXX)
44

tests/cmake_import/project/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14)
1+
cmake_minimum_required(VERSION 3.24)
22

33
project(DummyImport LANGUAGES CXX)
44

0 commit comments

Comments
 (0)