From 0a6b09de9ccfef26e58c673dad9e976ff03e78a8 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Thu, 9 Nov 2023 21:05:10 -0800 Subject: [PATCH 1/2] Check windows options are not passed to non-Windows build --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index b72e58a963..7116c3a85f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -248,6 +248,10 @@ set(OTELCPP_PROTO_PATH if(WIN32) option(WITH_ETW "Whether to include the ETW Exporter in the SDK" ON) +else() + if(DEFINED(WITH_ETW)) + message(FATAL_ERROR "WITH_ETW is only supported on Windows") + endif() endif(WIN32) # Do not convert deprecated message to error @@ -629,6 +633,9 @@ endif() include(CMakePackageConfigHelpers) if(DEFINED OPENTELEMETRY_BUILD_DLL) + if(NOT WIN32) + message(FATAL_ERROR "Build DLL is only supported on Windows!") + endif() if(NOT MSVC) message(WARNING "Build DLL is supposed to work with MSVC!") endif() From 63d23d91187f86fe2b4b4316795f47d32c693c21 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Sun, 12 Nov 2023 16:57:31 +0100 Subject: [PATCH 2/2] format CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c08142f58..f795eadbb7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -249,7 +249,7 @@ set(OTELCPP_PROTO_PATH if(WIN32) option(WITH_ETW "Whether to include the ETW Exporter in the SDK" ON) else() - if(DEFINED(WITH_ETW)) + if(DEFINED (WITH_ETW)) message(FATAL_ERROR "WITH_ETW is only supported on Windows") endif() endif(WIN32)