From 0fcd615b5059b359d358533399a456da03e05524 Mon Sep 17 00:00:00 2001 From: Vladimir Morozov Date: Wed, 9 Feb 2022 17:37:35 -0800 Subject: [PATCH] Fix build break related to fetching GTest sources (#57) * Fix build break related to fetching GTest sources * Change files --- ...icrosoft-mso-2022-02-09-17-01-10-PR-FixGTestBuild.json | 8 ++++++++ external/gtest/CMakeLists.txt | 5 +---- libs/motifCpp/include/motifCpp/motifCppTest.h | 6 ++---- tools/cmake/liblet.cmake | 4 ++-- 4 files changed, 13 insertions(+), 10 deletions(-) create mode 100644 change/@microsoft-mso-2022-02-09-17-01-10-PR-FixGTestBuild.json diff --git a/change/@microsoft-mso-2022-02-09-17-01-10-PR-FixGTestBuild.json b/change/@microsoft-mso-2022-02-09-17-01-10-PR-FixGTestBuild.json new file mode 100644 index 0000000..4019bd8 --- /dev/null +++ b/change/@microsoft-mso-2022-02-09-17-01-10-PR-FixGTestBuild.json @@ -0,0 +1,8 @@ +{ + "type": "patch", + "comment": "Fix build break related to fetching GTest sources", + "packageName": "@microsoft/mso", + "email": "vmorozov@microsoft.com", + "dependentChangeType": "patch", + "date": "2022-02-10T01:01:10.496Z" +} \ No newline at end of file diff --git a/external/gtest/CMakeLists.txt b/external/gtest/CMakeLists.txt index 074b6ba..493a913 100644 --- a/external/gtest/CMakeLists.txt +++ b/external/gtest/CMakeLists.txt @@ -13,10 +13,7 @@ if(MSO_ENABLE_UNIT_TESTS) FetchContent_Declare( googletest - GIT_REPOSITORY https://github.com/google/googletest.git - GIT_TAG 7eae8de0da5774fa08ce350d9d470901b76b2834 - GIT_SHALLOW 1 - GIT_PROGRESS 1 + URL https://github.com/google/googletest/archive/06519cedc3159de8b36a504766ad6b7966555f10.zip ) FetchContent_GetProperties(googletest) diff --git a/libs/motifCpp/include/motifCpp/motifCppTest.h b/libs/motifCpp/include/motifCpp/motifCppTest.h index 8f137d6..f0a2300 100644 --- a/libs/motifCpp/include/motifCpp/motifCppTest.h +++ b/libs/motifCpp/include/motifCpp/motifCppTest.h @@ -101,8 +101,7 @@ inline void AreEqualAt( GTEST_ASSERT_AT_( file, line, - ::testing::internal::EqHelper::Compare( - expectedExpr, actualExpr, expected, actual), + ::testing::internal::EqHelper::Compare(expectedExpr, actualExpr, expected, actual), GTEST_FATAL_FAILURE_AT_) << FormatCustomMsg(line, message); } @@ -125,8 +124,7 @@ void AreEqualAt( GTEST_ASSERT_AT_( file, line, - ::testing::internal::EqHelper::Compare( - expectedExpr, actualExpr, expected, actual), + ::testing::internal::EqHelper::Compare(expectedExpr, actualExpr, expected, actual), GTEST_FATAL_FAILURE_AT_) << FormatCustomMsg(line, message); } diff --git a/tools/cmake/liblet.cmake b/tools/cmake/liblet.cmake index dcb1382..8250b11 100644 --- a/tools/cmake/liblet.cmake +++ b/tools/cmake/liblet.cmake @@ -47,8 +47,8 @@ endif() if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") set(WIN_TARGET_ARCH $ENV{VSCMD_ARG_TGT_ARCH}) - if(${WIN_TARGET_ARCH} STREQUAL "") - message(FATAL_ERROR "Error: environment variable VSCMD_ARG_TGT_ARCH is not set (required for Windows builds). Are you using a Visual Studio Tools Command Prompt?") + if("${WIN_TARGET_ARCH}" STREQUAL "") + set(WIN_TARGET_ARCH "x64") endif() endif()