-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add KDBINDINGS_ENABLE_WARN_UNUSED as a cmake option
- Loading branch information
1 parent
e4770b5
commit f39723d
Showing
3 changed files
with
20 additions
and
5 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#pragma once | ||
|
||
// Check if KDBINDINGS_ENABLE_WARN_UNUSED option is set | ||
#cmakedefine KDBINDINGS_ENABLE_WARN_UNUSED | ||
|
||
#ifdef KDBINDINGS_ENABLE_WARN_UNUSED | ||
#define KDBINDINGS_WARN_UNUSED [[nodiscard]] | ||
#else | ||
#define KDBINDINGS_WARN_UNUSED | ||
#endif |
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 |
---|---|---|
|
@@ -6,6 +6,13 @@ | |
# Contact KDAB at <[email protected]> for commercial licensing options. | ||
# | ||
|
||
option(KDBINDINGS_ENABLE_WARN_UNUSED "Enable warnings for unused ConnectionHandles" OFF) | ||
|
||
configure_file( | ||
"${PROJECT_SOURCE_DIR}/cmake/KDBindingsConfig.h.in" | ||
"${CMAKE_BINARY_DIR}/include/KDBindingsConfig.h" | ||
) | ||
|
||
set(HEADERS | ||
binding.h | ||
binding_evaluator.h | ||
|
@@ -36,6 +43,7 @@ set_target_properties(KDBindings PROPERTIES | |
target_include_directories(KDBindings INTERFACE | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..> | ||
$<INSTALL_INTERFACE:include> | ||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> # Include the build directory for the configured header | ||
) | ||
|
||
# Generate library version files | ||
|
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