From 5bd9c65c64e402bf17f73528693a9b4afe5aed2f Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Sun, 12 Nov 2023 12:07:11 -0800 Subject: [PATCH] [BUILD] Check windows options are not passed to non-Windows build (#2399) --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index de5e714916..f795eadbb7 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 @@ -628,6 +632,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()