You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by pn...@apache.org on 2022/12/04 16:07:02 UTC
[celix] 03/06: Apply usage of CELIX_CXX17
This is an automated email from the ASF dual-hosted git repository.
pnoltes pushed a commit to branch feature/split_celix_cxx_option
in repository https://gitbox.apache.org/repos/asf/celix.git
commit 1fe272fe5dc5c87c17f602f94d9cc7982b1a27ed
Author: Pepijn Noltes <pe...@gmail.com>
AuthorDate: Sun Dec 4 16:33:45 2022 +0100
Apply usage of CELIX_CXX17
---
bundles/cxx_remote_services/CMakeLists.txt | 3 ++-
examples/celix-examples/CMakeLists.txt | 4 +++-
examples/celix-examples/readme_cxx_examples/CMakeLists.txt | 2 ++
libs/framework/benchmark/CMakeLists.txt | 3 ++-
libs/framework/gtest/CMakeLists.txt | 2 ++
libs/utils/CMakeLists.txt | 4 +++-
libs/utils/gtest/CMakeLists.txt | 2 ++
7 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/bundles/cxx_remote_services/CMakeLists.txt b/bundles/cxx_remote_services/CMakeLists.txt
index 78e2cf0a..022396f9 100644
--- a/bundles/cxx_remote_services/CMakeLists.txt
+++ b/bundles/cxx_remote_services/CMakeLists.txt
@@ -16,7 +16,8 @@
# under the License.
celix_subproject(CXX_REMOTE_SERVICE_ADMIN "Option to enable building the C++17 Remote Service Admin Service bundles" ON)
-if (CXX_REMOTE_SERVICE_ADMIN)
+if (CXX_REMOTE_SERVICE_ADMIN AND CELIX_CXX17)
+ set(CMAKE_CXX_STANDARD 17)
add_subdirectory(rsa_spi)
add_subdirectory(admin)
add_subdirectory(discovery_configured)
diff --git a/examples/celix-examples/CMakeLists.txt b/examples/celix-examples/CMakeLists.txt
index 671b9e2f..04d2c779 100644
--- a/examples/celix-examples/CMakeLists.txt
+++ b/examples/celix-examples/CMakeLists.txt
@@ -33,9 +33,11 @@ if (EXAMPLES)
add_subdirectory(hello_world_cxx)
add_subdirectory(dm_example_cxx)
add_subdirectory(services_example_cxx)
- add_subdirectory(readme_cxx_examples)
add_subdirectory(dependency_manager_example_cxx)
endif ()
+ if (CELIX_CXX17)
+ add_subdirectory(readme_cxx_examples)
+ endif ()
#TODO refactor export_import
#add_subdirectory(export_import)
diff --git a/examples/celix-examples/readme_cxx_examples/CMakeLists.txt b/examples/celix-examples/readme_cxx_examples/CMakeLists.txt
index 14d7fa6a..1656d373 100644
--- a/examples/celix-examples/readme_cxx_examples/CMakeLists.txt
+++ b/examples/celix-examples/readme_cxx_examples/CMakeLists.txt
@@ -15,6 +15,8 @@
# specific language governing permissions and limitations
# under the License.
+set(CMAKE_CXX_STANDARD 17)
+
#MyBundle example
#find_package(Celix REQUIRED) NOTE not usable inside Celix project
diff --git a/libs/framework/benchmark/CMakeLists.txt b/libs/framework/benchmark/CMakeLists.txt
index 53b71395..e1efb475 100644
--- a/libs/framework/benchmark/CMakeLists.txt
+++ b/libs/framework/benchmark/CMakeLists.txt
@@ -22,7 +22,8 @@ if (benchmark_FOUND)
endif ()
celix_subproject(FRAMEWORK_BENCHMARK "Option to enable Celix framework benchmark" ${FRAMEWORK_BENCHMARK_DEFAULT})
-if (FRAMEWORK_BENCHMARK)
+if (FRAMEWORK_BENCHMARK AND CELIX_CXX17)
+ set(CMAKE_CXX_STANDARD 17)
find_package(benchmark REQUIRED)
add_executable(celix_framework_benchmark
diff --git a/libs/framework/gtest/CMakeLists.txt b/libs/framework/gtest/CMakeLists.txt
index fe22ce19..3c845be3 100644
--- a/libs/framework/gtest/CMakeLists.txt
+++ b/libs/framework/gtest/CMakeLists.txt
@@ -15,6 +15,8 @@
# specific language governing permissions and limitations
# under the License.
+set(CMAKE_CXX_STANDARD 17)
+
add_celix_bundle(simple_test_bundle1 NO_ACTIVATOR VERSION 1.0.0)
celix_bundle_name(simple_test_bundle1 "Simple Test Bundle")
celix_bundle_group(simple_test_bundle1 "test/group")
diff --git a/libs/utils/CMakeLists.txt b/libs/utils/CMakeLists.txt
index cde5b588..f46e93f6 100644
--- a/libs/utils/CMakeLists.txt
+++ b/libs/utils/CMakeLists.txt
@@ -83,7 +83,9 @@ add_library(Celix::utils ALIAS utils)
if (ENABLE_TESTING)
- add_subdirectory(gtest)
+ if (CELIX_CXX17) #utils tests are C++17
+ add_subdirectory(gtest)
+ endif()
find_package(CppUTest)
diff --git a/libs/utils/gtest/CMakeLists.txt b/libs/utils/gtest/CMakeLists.txt
index acea7808..1d341e4a 100644
--- a/libs/utils/gtest/CMakeLists.txt
+++ b/libs/utils/gtest/CMakeLists.txt
@@ -15,6 +15,8 @@
# specific language governing permissions and limitations
# under the License.
+set(CMAKE_CXX_STANDARD 17)
+
set(CELIX_UTIL_TEST_SOURCES_FOR_CXX_HEADERS
src/CxxUtilsTestSuite.cc
src/CxxPropertiesTestSuite.cc