summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-09-12 15:20:14 +0200
committerSven Gothel <[email protected]>2020-09-12 15:20:14 +0200
commit1422a7f0f3c846f71af1eb0ac610a3a9950f9ac2 (patch)
treeace1bcc6cc814c3494202f0e057631cd92d3316c
parent03496e50475f834bba564a7e59288652384ca952 (diff)
CMake Build: Use C++17 (C++20 not yet supported on all target platforms, i.e. Debian 10 Buster with GCC 8.3)
GCC 10.1 mostly covers C++20 and is default on Debian 11 Bullseye, we will move there when established. For now let's use C++17 at least, especially since GCC C++ ABI fixes a few code generation issues and we intend to further simplify our C++ codebase.
-rw-r--r--examples/CMakeLists.txt9
-rw-r--r--java/jni/direct_bt/CMakeLists.txt3
-rw-r--r--src/direct_bt/CMakeLists.txt3
-rw-r--r--test/direct_bt/CMakeLists.txt18
-rw-r--r--test/ieee11073/CMakeLists.txt4
5 files changed, 25 insertions, 12 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index b6336c3c..d0d05fa5 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -66,19 +66,22 @@ endif()
add_executable (dbt_scanner00 direct_bt_scanner00/dbt_scanner00.cpp)
set_target_properties(dbt_scanner00
PROPERTIES
- CXX_STANDARD 11
+ CXX_STANDARD 17
+ CXX_STANDARD_REQUIRED ON
COMPILE_FLAGS "-Wall -Wextra -Werror")
add_executable (dbt_scanner01 direct_bt_scanner01/dbt_scanner01.cpp)
set_target_properties(dbt_scanner01
PROPERTIES
- CXX_STANDARD 11
+ CXX_STANDARD 17
+ CXX_STANDARD_REQUIRED ON
COMPILE_FLAGS "-Wall -Wextra -Werror")
add_executable (dbt_scanner10 direct_bt_scanner10/dbt_scanner10.cpp)
set_target_properties(dbt_scanner10
PROPERTIES
- CXX_STANDARD 11
+ CXX_STANDARD 17
+ CXX_STANDARD_REQUIRED ON
COMPILE_FLAGS "-Wall -Wextra -Werror")
target_link_libraries (dbt_scanner00 direct_bt)
diff --git a/java/jni/direct_bt/CMakeLists.txt b/java/jni/direct_bt/CMakeLists.txt
index 9fd40026..d508c3c0 100644
--- a/java/jni/direct_bt/CMakeLists.txt
+++ b/java/jni/direct_bt/CMakeLists.txt
@@ -45,7 +45,8 @@ set_target_properties(
PROPERTIES
SOVERSION ${tinyb_VERSION_MAJOR}
VERSION ${tinyb_VERSION_STRING}
- CXX_STANDARD 11
+ CXX_STANDARD 17
+ CXX_STANDARD_REQUIRED ON
COMPILE_FLAGS "-Wall -Wextra -Werror"
)
diff --git a/src/direct_bt/CMakeLists.txt b/src/direct_bt/CMakeLists.txt
index c8b90ebe..05cbd4be 100644
--- a/src/direct_bt/CMakeLists.txt
+++ b/src/direct_bt/CMakeLists.txt
@@ -47,7 +47,8 @@ set_target_properties(
PROPERTIES
SOVERSION ${tinyb_VERSION_MAJOR}
VERSION ${tinyb_VERSION_STRING}
- CXX_STANDARD 11
+ CXX_STANDARD 17
+ CXX_STANDARD_REQUIRED ON
COMPILE_FLAGS "-Wall -Wextra -Werror"
)
install (DIRECTORY ${PROJECT_SOURCE_DIR}/api/direct_bt/ DESTINATION include/direct_bt)
diff --git a/test/direct_bt/CMakeLists.txt b/test/direct_bt/CMakeLists.txt
index 80bbe827..4d9e3b51 100644
--- a/test/direct_bt/CMakeLists.txt
+++ b/test/direct_bt/CMakeLists.txt
@@ -12,32 +12,38 @@ add_executable (test_lfringbuffer11 test_lfringbuffer11.cpp)
set_target_properties(test_functiondef01
PROPERTIES
- CXX_STANDARD 11
+ CXX_STANDARD 17
+ CXX_STANDARD_REQUIRED ON
COMPILE_FLAGS "-Wall -Wextra -Werror"
)
set_target_properties(test_uuid
PROPERTIES
- CXX_STANDARD 11
+ CXX_STANDARD 17
+ CXX_STANDARD_REQUIRED ON
COMPILE_FLAGS "-Wall -Wextra -Werror"
)
set_target_properties(test_basictypes01
PROPERTIES
- CXX_STANDARD 11
+ CXX_STANDARD 17
+ CXX_STANDARD_REQUIRED ON
COMPILE_FLAGS "-Wall -Wextra -Werror"
)
set_target_properties(test_attpdu01
PROPERTIES
- CXX_STANDARD 11
+ CXX_STANDARD 17
+ CXX_STANDARD_REQUIRED ON
COMPILE_FLAGS "-Wall -Wextra -Werror"
)
set_target_properties(test_lfringbuffer01
PROPERTIES
- CXX_STANDARD 11
+ CXX_STANDARD 17
+ CXX_STANDARD_REQUIRED ON
COMPILE_FLAGS "-Wall -Wextra -Werror"
)
set_target_properties(test_lfringbuffer11
PROPERTIES
- CXX_STANDARD 11
+ CXX_STANDARD 17
+ CXX_STANDARD_REQUIRED ON
COMPILE_FLAGS "-Wall -Wextra -Werror"
)
diff --git a/test/ieee11073/CMakeLists.txt b/test/ieee11073/CMakeLists.txt
index 1f144641..3b8f9b38 100644
--- a/test/ieee11073/CMakeLists.txt
+++ b/test/ieee11073/CMakeLists.txt
@@ -7,7 +7,9 @@ add_executable (test_datatypes01 test_datatypes01.cpp)
set_target_properties(test_datatypes01
PROPERTIES
- CXX_STANDARD 11)
+ CXX_STANDARD 17
+ CXX_STANDARD_REQUIRED ON
+)
target_link_libraries (test_datatypes01 direct_bt)