From 2d8822de9ebc44e33e34f1ac804acb161a325f75 Mon Sep 17 00:00:00 2001 From: Tony Gorez Date: Wed, 28 Feb 2024 17:02:31 +0100 Subject: [PATCH] fix: use compile option conditionaly Signed-off-by: Tony Gorez --- cmake/FindGoogleTest.cmake | 4 +++- vendor/googletest/CMakeLists.txt | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/FindGoogleTest.cmake b/cmake/FindGoogleTest.cmake index da995e75..f9fd1899 100644 --- a/cmake/FindGoogleTest.cmake +++ b/cmake/FindGoogleTest.cmake @@ -8,4 +8,6 @@ endif() # We want to disable the unsigned shift base sanitizer for gtest # because it triggers on the gtest code. -target_compile_options(gtest PRIVATE "-fno-sanitize=unsigned-shift-base") +if(INCLUDEJS_ADDRESS_SANITIZER) + target_compile_options(gtest PRIVATE "-fno-sanitize=unsigned-shift-base") +endif() diff --git a/vendor/googletest/CMakeLists.txt b/vendor/googletest/CMakeLists.txt index 489b590d..089ac987 100644 --- a/vendor/googletest/CMakeLists.txt +++ b/vendor/googletest/CMakeLists.txt @@ -25,4 +25,3 @@ if(BUILD_GMOCK) else() add_subdirectory( googletest ) endif() -