Skip to content

Commit f1699e1

Browse files
authored
fix: DLL versioning for SDK usage as CMake subdirectory (#1086)
1 parent 4e61614 commit f1699e1

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
**Fixes**:
6+
7+
- Fix DLL versioning for projects that add the Native SDK as a CMake subdirectory. ([#1086](https://github.com/getsentry/sentry-native/pull/1086))
8+
39
## 0.7.14
410

511
**Features**:

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
2525
set(SENTRY_MAIN_PROJECT ON)
2626
endif()
2727

28+
# We have 4 source directories:
29+
# * `CMAKE_SOURCE_DIR`: points to the directory of the top-level CMakeLists.txt of the main project.
30+
# * `CMAKE_CURRENT_SOURCE_DIR`: points to the directory of any CMakeLists.txt in any subdirectories.
31+
# * `PROJECT_SOURCE_DIR`: points to the directory of any CMakeLists.txt in any subdirectories that defined a `project`.
32+
# * `SENTRY_SOURCE_DIR`: points to the directory of this `CMakeLists.txt` independent of whether it was added as a
33+
# subdirectory in another project or whether we access it from one of our subdirectories.
34+
set(SENTRY_SOURCE_DIR ${PROJECT_SOURCE_DIR})
35+
2836
if(NOT CMAKE_C_STANDARD)
2937
set(CMAKE_C_STANDARD 11)
3038
endif()

cmake/utils.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function(sentry_add_version_resource TGT FILE_DESCRIPTION)
1111
list(GET _SENTRY_VERSION_LIST 2 SENTRY_VERSION_PATCH)
1212

1313
# Produce the resource file with configure-time replacements
14-
configure_file("${CMAKE_SOURCE_DIR}/sentry.rc.in" "${RESOURCE_PATH_TMP}" @ONLY)
14+
configure_file("${SENTRY_SOURCE_DIR}/sentry.rc.in" "${RESOURCE_PATH_TMP}" @ONLY)
1515

1616
# Replace the `ORIGINAL_FILENAME` at generate-time using the generator expression `TARGET_FILE_NAME`
1717
file(GENERATE OUTPUT ${RESOURCE_PATH} INPUT ${RESOURCE_PATH_TMP})

0 commit comments

Comments
 (0)