diff -Naur flang-11.0.0rc2.src.orig/.CMakeLists.txt.swp flang-11.0.0rc2.src.gtest/.CMakeLists.txt.swp
--- flang-11.0.0rc2.src.orig/.CMakeLists.txt.swp	1970-01-01 00:00:00.000000000 +0000
+++ flang-11.0.0rc2.src.gtest/.CMakeLists.txt.swp	2020-09-03 19:39:33.985733909 +0000
@@ -0,0 +1,40 @@
+b0VIM 8.2FQ_«@Ú*llvmfedora~llvm/fedpkg/flang/flang-11.0.0rc2.src.gtest/CMakeLists.txtutf-8
3210#"! Utpe$f?†jÆo0Ÿad+ÛeÚÙ£�oC;:þëËÃÂžŠjba('ô
Î
°
¯
}
|
;

Áv*üôóÈ}kjÎ
+Å
+�
+X
+G
+&
+%
+ñ	Ý	©	ƒ	U	(			ê±„ƒ=&ü¾{z[H+üæ¿„O Áª Ÿz9ÆÅÄqÍ|.ßÀ�feÛÚ  # We look for it here and remove it from Flang's compile flags to  # LLVM's cmake configuration files currently sneak in a c++11 flag.  add_definitions(${LLVM_DEFINITIONS})  include_directories(SYSTEM ${LLVM_INCLUDE_DIRS})  # should not be suppressed).  # LLVM_INCLUDE_DIRS when merging in the monorepo (Warning from flang headers  # This may have to be fine-tuned if flang headers are consider part of this  # ignored while keeping -Wunused-parameter a fatal error inside f18 code base.  # compilers (ifdefs are involved). This allows warnings from LLVM headers to be  # parameter issues that may or may not appear depending on the environments and  # Add LLVM include files as if they were SYSTEM because there are complex unused    "Set to ON to force using an old, unsupported host toolchain." OFF)  option(LLVM_FORCE_USE_OLD_HOST_TOOLCHAIN    "Only include toolchain files in the 'install' target." OFF)  option(LLVM_INSTALL_TOOLCHAIN_ONLY  endif()      NO_DEFAULT_PATH)    find_program(MLIR_TABLEGEN_EXE "mlir-tblgen" ${LLVM_TOOLS_BINARY_DIR}    include(AddMLIR)    list(APPEND CMAKE_MODULE_PATH ${MLIR_DIR})    include_directories(SYSTEM ${MLIR_INCLUDE_DIRS})    # Use SYSTEM for the same reasons as for LLVM includes    find_package(MLIR REQUIRED CONFIG)    include(TableGen)  if(LINK_WITH_FIR)  include(VersionFromVCS)  include(HandleLLVMOptions)  include(AddLLVM)  include(CMakeParseArguments)  option(LLVM_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)  option(LLVM_ENABLE_WARNINGS "Enable compiler warnings." ON)  endif()    find_package(ZLIB REQUIRED)  if(LLVM_ENABLE_ZLIB)  # If LLVM links to zlib we need the imported targets so we can too.  list(APPEND CMAKE_MODULE_PATH ${LLVM_DIR})  find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_PATH}")  # We need a pre-built/installed version of LLVM.  endif()    mark_as_advanced(LLVM_ENABLE_ASSERTIONS)    # Assertions follow llvm's configuration.      CACHE BOOL "Enable assertions")    set(LLVM_ENABLE_ASSERTIONS ${ENABLE_ASSERTIONS}  if (NOT MSVC_IDE)  set(FLANG_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})  set(FLANG_STANDALONE_BUILD ON)  project(Flang)  message("Building Flang as a standalone project.")if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)# there.# Check for a standalone build and configure as appropriate fromoption(FLANG_ENABLE_WERROR "Fail and stop building flang if a warning is triggered." OFF)include(AddFlang)list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")# Add Flang-centric modules to cmake path.endif()          `CMakeFiles'. Please delete them.")          This process created the file `CMakeCache.txt' and the directory\          passing the path to this source directory as the last argument.\          Please create a directory and run cmake from there,\  message(FATAL_ERROR "In-source builds are not allowed. \if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT MSVC_IDE)set(FLANG_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})set(CMAKE_CXX_EXTENSIONS OFF)set(CMAKE_CXX_STANDARD_REQUIRED TRUE)set(CMAKE_CXX_STANDARD 17)# Flang requires C++17.option(LINK_WITH_FIR "Link driver with FIR and LLVM" ON)endif()  cmake_policy(SET CMP0077 NEW)if (POLICY CMP0077)# option() honors normal variables.endif()  cmake_policy(SET CMP0075 NEW)if(POLICY CMP0075)# Include file check macros honor CMAKE_REQUIRED_LIBRARIES.endif()  set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON)  cmake_policy(SET CMP0068 NEW)if (POLICY CMP0068)# RPATH settings on macOS do not affect INSTALL_NAME.cmake_minimum_required(VERSION 3.9.0)ad\´ø÷Ò°˜|iUC/ýÞ¼´³endif()    PATTERN "CMakeFiles" EXCLUDE)    PATTERN ".git"     EXCLUDE    PATTERN "config.h" EXCLUDE    PATTERN "*.td"    PATTERN "*.inc"    PATTERN "*.h"    PATTERN "*.def"    FILES_MATCHING    COMPONENT flang-headers    DESTINATION include  install(DIRECTORY include/flangif (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)endif()ad5?èžzGõéÜÂŒVJ!á
²
±
Ÿ
x
Q
E
&
èžgY:/©Š~t[Ø
+Î
+·
+”
+Š
+‰
+‚
+`
+C
+
+ç	Ì	Ë	“	a	L	þ¯f0üÀ¶®­›o5õµ  set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/bin)  # tc  set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/bin)  # tc  set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/bin)  # tco tool and FIR lib output directoriesif(LINK_WITH_FIR)endif()  endif()    include_directories(SYSTEM ${MLIR_TABLEGEN_OUTPUT_DIR})    include_directories(SYSTEM ${MLIR_INCLUDE_DIR})    set(MLIR_TABLEGEN_EXE $<TARGET_FILE:mlir-tblgen>)    set(MLIR_TABLEGEN_OUTPUT_DIR ${CMAKE_BINARY_DIR}/tools/mlir/include)    set(MLIR_INCLUDE_DIR ${LLVM_MAIN_SRC_DIR}/../mlir/include ) # --includedir    set(MLIR_MAIN_SRC_DIR ${LLVM_MAIN_SRC_DIR}/../mlir/include ) # --src-root  if (LINK_WITH_FIR)  set(BACKEND_PACKAGE_STRING "${PACKAGE_STRING}")  set(FLANG_BINARY_DIR ${CMAKE_BINARY_DIR}/tools/flang)  set(FLANG_GTEST_AVAIL 1)         ${LLVM_INCLUDE_TESTS})         "Generate build targets for the Flang unit tests."  option(FLANG_INCLUDE_TESTS  set(FLANG_STANDALONE_BUILD OFF)else()  endif()    add_custom_target(doxygen ALL)  if (LLVM_BUILD_DOCS)  endif()    add_custom_target(check-all DEPENDS check-flang )  else()    add_custom_target(check-all DEPENDS check-flang FlangUnitTests)  if (FLANG_GTEST_AVAIL)  endif()    endif()      set(FLANG_GTEST_AVAIL 0)      "Unit-tests will be skipped as LLVM install does not include google-test related headers and libraries.")      message(WARNING    else()      set(FLANG_GTEST_AVAIL 1)      endif()        target_link_libraries(gtest_main PUBLIC gtest)        add_library(gtest_main ${UNITTEST_DIR}/UnitTestMain/TestMain.cpp)         target_link_libraries(gtest PUBLIC Threads::Threads)         find_package(Threads)          )          "${UNITTEST_DIR}/googlemock"          "${UNITTEST_DIR}/googletest"          PRIVATE          "${UNITTEST_DIR}/googlemock/include"          "${UNITTEST_DIR}/googletest/include"          PUBLIC        target_include_directories(gtest          )          ${UNITTEST_DIR}/googlemock/src/gmock-all.cc          ${UNITTEST_DIR}/googletest/src/gtest-all.cc        add_library(gtest      else()          )          "${UNITTEST_DIR}/googletest/include;${UNITTEST_DIR}/googlemock/include"          PROPERTIES INTERFACE_INCLUDE_DIRECTORIES        set_target_properties(gtest        # LLVM Doesn't export gtest's include directorys, so do that here      if (TARGET gtest)ad	Ä	$¶šT,í¸~(è
Ü
Ò
Ñ
§
¦
h
C

ìº¹|ø¼¯®‹J/Ú
+›
+.
+û	Ä	„	‰	}	p	V	 	êÞµ¤uFE3åÙº|2ûíÎÃ­=ï«¢lbK(ô×›{`_'õà’CúÄ�TJBA/ÉÈ  set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/bin)  # tco tool and FIR lib output directoriesif(LINK_WITH_FIR)endif()  endif()    include_directories(SYSTEM ${MLIR_TABLEGEN_OUTPUT_DIR})    include_directories(SYSTEM ${MLIR_INCLUDE_DIR})    set(MLIR_TABLEGEN_EXE $<TARGET_FILE:mlir-tblgen>)    set(MLIR_TABLEGEN_OUTPUT_DIR ${CMAKE_BINARY_DIR}/tools/mlir/include)    set(MLIR_INCLUDE_DIR ${LLVM_MAIN_SRC_DIR}/../mlir/include ) # --includedir    set(MLIR_MAIN_SRC_DIR ${LLVM_MAIN_SRC_DIR}/../mlir/include ) # --src-root  if (LINK_WITH_FIR)  set(BACKEND_PACKAGE_STRING "${PACKAGE_STRING}")  set(FLANG_BINARY_DIR ${CMAKE_BINARY_DIR}/tools/flang)  set(FLANG_GTEST_AVAIL 1)         ${LLVM_INCLUDE_TESTS})         "Generate build targets for the Flang unit tests."  option(FLANG_INCLUDE_TESTS  set(FLANG_STANDALONE_BUILD OFF)else()  endif()    add_custom_target(doxygen ALL)  if (LLVM_BUILD_DOCS)  endif()    add_custom_target(check-all DEPENDS check-flang )  else()    add_custom_target(check-all DEPENDS check-flang FlangUnitTests)  if (FLANG_GTEST_AVAIL)  endif()    endif()      set(FLANG_GTEST_AVAIL 0)      "Unit-tests will be skipped as LLVM install does not include google-test related headers and libraries.")      message(WARNING    else()      set(FLANG_GTEST_AVAIL 1)      endif()        target_link_libraries(gtest_main PUBLIC gtest)        add_library(gtest_main ${UNITTEST_DIR}/UnitTestMain/TestMain.cpp)         target_link_libraries(gtest PUBLIC Threads::Threads)         find_package(Threads)          )          "${UNITTEST_DIR}/googlemock"          "${UNITTEST_DIR}/googletest"          PRIVATE          "${UNITTEST_DIR}/googlemock/include"          "${UNITTEST_DIR}/googletest/include"          PUBLIC        target_include_directories(gtest          )          ${UNITTEST_DIR}/googlemock/src/gmock-all.cc          ${UNITTEST_DIR}/googletest/src/gtest-all.cc        add_library(gtest      else()           set(UNITTEST_DIR ${LLVM_BUILD_MAIN_SRC_DIR}/utils/unittest)      add_subdirectory(${UNITTEST_DIR} utils/unittest)        AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)        AND NOT EXISTS ${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}    if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h    set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest)  if (FLANG_INCLUDE_TESTS)  set(FLANG_GTEST_AVAIL 0)#LLVM_BUILD_MAIN_SRC_DIR - Path to llvm source when out-of-tree.#Handle unittests when out-of-tree         ON)         "Generate build targets for the Flang unit tests."  option(FLANG_INCLUDE_TESTS  set(LLVM_EXTERNAL_LIT "${LLVM_TOOLS_BINARY_DIR}/llvm-lit" CACHE STRING "Command used to spawn lit")  set(BACKEND_PACKAGE_STRING "LLVM ${LLVM_PACKAGE_VERSION}")    ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX})  set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY    ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX})  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)  link_directories("${LLVM_LIBRARY_DIR}")  endif()    endif()      message("    [NEW] CMAKE_CXX_FLAGS='${CMAKE_CXX_FLAGS}'")      string(REPLACE " -std=${LLVM_CXX_STD}" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")      message("    CMAKE_CXX_FLAGS='${CMAKE_CXX_FLAGS}'")      message("    removing '-std=${LLVM_CXX_STD}'")      message("Flang: Overriding LLVM's 'cxx_std' setting...")    if (NOT LLVM_CXX_STD EQUAL "c++17")    message("LLVM configuration set a C++ standard: ${LLVM_CXX_STD}")  if (DEFINED LLVM_CXX_STD)  # avoid some mixed compilation flangs (e.g. -std=c++11 ... -std=c++17).adÒjÆ¬‘\ èàß´™{\[ö
Ò
t
l
k
K

þýÔ~}UíìÂj@õ
+í
+ì
+ë
+ê
+»
+•
+s
+Q
+/
+.
+-
+
+×	Ï	Î	©	x	p	o	E				¸Y'ã¹sV,ëê¦¥uEø÷å°¨§{,Å½¼–†KäÔšedKØË›‘h4ÛÓÒÑendif()  endif( LLVM_COMPILER_IS_GCC_COMPATIBLE )    append("-Wno-error" CMAKE_REQUIRED_FLAGS)    append("-Werror" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)  if ( LLVM_COMPILER_IS_GCC_COMPATIBLE )  endif()    append("/WX" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)  if( MSVC )  # Keep this up-to-date with that file  # The following is taken from llvm/cmake/modules/HandleLLVMOptions.cmakeif (FLANG_ENABLE_WERROR)  ${FLANG_BINARY_DIR}/include/flang/Config/config.h)  ${FLANG_SOURCE_DIR}/include/flang/Config/config.h.cmakeconfigure_file(# Configure Flang's version info header file.  ${CMAKE_CURRENT_BINARY_DIR}/include/flang/Version.inc)  ${CMAKE_CURRENT_SOURCE_DIR}/include/flang/Version.inc.inconfigure_file(# Configure Flang's Version.inc file.endif()  add_definitions(-DFLANG_REPOSITORY_STRING="${FLANG_REPOSITORY_STRING}")if (FLANG_REPOSITORY_STRING)  "Vendor-specific text for showing the repository the source is taken from.")set(FLANG_REPOSITORY_STRING "" CACHE STRINGendif()  add_definitions(-DFLANG_VENDOR="${FLANG_VENDOR} ")if (FLANG_VENDOR)  "Vendor-specific uti.")set(FLANG_VENDOR_UTI "org.llvm.flang" CACHE STRING  "Vendor-specific Flang version information.")set(FLANG_VENDOR ${PACKAGE_VENDOR} CACHE STRINGmark_as_advanced(FLANG_EXECUTABLE_VERSION LIBFLANG_LIBRARY_VERSION)    "Major version number to appended to the libflang library.")    "${FLANG_VERSION_MAJOR}" CACHE STRINGset(LIBFLANG_LIBRARY_VERSION    "Major version number to appended to the flang executable name.")    "${FLANG_VERSION_MAJOR}" CACHE STRINGset(FLANG_EXECUTABLE_VERSION# Flang executable version informationmessage(STATUS "Flang version: ${FLANG_VERSION}")set(FLANG_VERSION "${FLANG_VERSION_MAJOR}.${FLANG_VERSION_MINOR}.${FLANG_VERSION_PATCHLEVEL}")# Unlike PACKAGE_VERSION, FLANG_VERSION does not include LLVM_VERSION_SUFFIX.endif()  set(FLANG_VERSION_PATCHLEVEL ${LLVM_VERSION_PATCH})if (NOT DEFINED FLANG_VERSION_PATCHLEVEL)endif()  set(FLANG_VERSION_MINOR ${LLVM_VERSION_MINOR})if (NOT DEFINED FLANG_VERSION_MINOR)endif()  set(FLANG_VERSION_MAJOR ${LLVM_VERSION_MAJOR})if (NOT DEFINED FLANG_VERSION_MAJOR)set(FLANG_VERSION_PATCHLEVEL "0")set(FLANG_VERSION_MINOR      "1")set(FLANG_VERSION_MAJOR      "0")# Override LLVM versioning for now...set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")endif()      "Default runtime library to use (empty for platform default)" FORCE)  set(FLANG_DEFAULT_RTLIB "" CACHE STRING  message(WARNING "Resetting Flang's default runtime library to use platform default.")if (NOT(FLANG_DEFAULT_RTLIB STREQUAL ""))   "Default Fortran runtime library to use (\"libFortranRuntime\"), leave empty for platform default.")set(FLANG_DEFAULT_RTLIB "" CACHE STRING  "Default linker to use (linker name or absolute path, empty for platform default)")set(FLANG_DEFAULT_LINKER "" CACHE STRINGendif()  set(ENABLE_LINKER_BUILD_ID OFF CACHE BOOL "pass --build-id to ld")if (NOT ENABLE_LINKER_BUILD_ID)endif()    "The <path> to use for the system root for all compiler invocations (--sysroot=<path>).")  set(DEFAULT_SYSROOT "" CACHE PATHif (NOT DEFAULT_SYSROOT)list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")  ${FLANG_SOURCE_DIR}/include)  ${FLANG_BINARY_DIR}/includeinclude_directories(BEFORE# Add Flang-centric modules to cmake path.endif()  message(STATUS "LLVM libraries: ${LLVM_COMMON_LIBS}")  llvm_map_components_to_libnames(LLVM_COMMON_LIBS support)  message(STATUS "Linking driver with FIR and LLVM")  set(LLVM_BUILD_TOOLS ON)  # Always build tco tool  set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/lib)adào¿•yG<;â¸woñ
®
¦
¥
…
`
_
)
ÊÁ]8$#Ã•PFE(å
+�
+�
+F
+ú	±	X	N	M	E	D			òÛÐ½ªtV5 é‘Vþòéž”Œ‹n\[Z@*
+	ð¬•{sYX?,úÚÏÇÆbJ1)(üÙ™˜L1
+ÖÆ¡„W:ûïàß  endforeach()    endif()      add_dependencies(install-flang-libraries install-${lib})    if (NOT LLVM_ENABLE_IDE)    add_dependencies(flang-libraries ${lib})  foreach(lib ${FLANG_LIBS})  list(REMOVE_DUPLICATES FLANG_LIBS)if (FLANG_LIBS)get_property(FLANG_LIBS GLOBAL PROPERTY FLANG_LIBS)endif()   COMPONENT flang-libraries)   DEPENDS flang-libraries  add_llvm_install_targets(install-flang-librariesif (NOT LLVM_ENABLE_IDE)set_target_properties(flang-libraries PROPERTIES FOLDER "Misc")add_custom_target(flang-libraries)# Custom target to install Flang libraries.endif()  add_subdirectory(docs)if (FLANG_INCLUDE_DOCS)       ${LLVM_INCLUDE_DOCS})option(FLANG_INCLUDE_DOCS "Generate build targets for the Flang docs."endif()  endif ()    add_subdirectory(unittests)  if (FLANG_GTEST_AVAIL)  add_subdirectory(test)  enable_testing()if (FLANG_INCLUDE_TESTS)add_subdirectory(runtime)endif()  add_subdirectory(tools)if (FLANG_BUILD_TOOLS)  "Build the Flang tools. If OFF, just generate build targets." ON)option(FLANG_BUILD_TOOLSadd_subdirectory(cmake/modules)add_subdirectory(lib)add_subdirectory(include)include(AddFlang)include(CMakeParseArguments)endif()  endif()    message(FATAL_ERROR "${CMAKE_LINKER} failed with status ${HAD_ERROR}")  else()    endif()      string(REGEX REPLACE "[^0-9]*([0-9.]+).*" "\\1" HOST_LINK_VERSION ${LD_V_OUTPUT})    elseif ("${LD_V_OUTPUT}" MATCHES "[^0-9]*([0-9.]+).*")      string(REGEX REPLACE ".*ld64-([0-9.]+).*" "\\1" HOST_LINK_VERSION ${LD_V_OUTPUT})    if ("${LD_V_OUTPUT}" MATCHES ".*ld64-([0-9.]+).*")  if (NOT HAD_ERROR)    OUTPUT_VARIABLE LD_V_OUTPUT)    RESULT_VARIABLE HAD_ERROR    COMMAND sh -c "${CMAKE_LINKER} -v 2>&1 | head -1"  execute_process(  set(LD_V_OUTPUT)if (APPLE)set(HOST_LINK_VERSION)# Determine HOST_LINK_VERSION on Darwin.list(REMOVE_DUPLICATES CMAKE_CXX_FLAGS)endif()  endif()   set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-semantic-interposition")  if (BUILD_SHARED_LIBS AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))  # due to the need to preserve the right to override external entry points  # Building shared libraries is bad for performance with GCC by default  set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -DCHECK=\"(void)\"")  set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUGF18")  # Add to build type flags.  endif()    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-nested-anon-types")  if (CXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG)  check_cxx_compiler_flag("-Werror -Wnested-anon-types" CXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG)  endif()  # Clang.          -Wcovered-switch-default")    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-command-line-argument -Wstring-conversion \  else()    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing -fno-semantic-interposition")  if (NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")if (LLVM_COMPILER_IS_GCC_COMPATIBLE)# Add appropriate flags for GCCendif()  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-string-conversion")if (CXX_SUPPORTS_NO_STRING_CONVERSION_FLAG)check_compiler_flag("-Wstring-conversion" CXX_SUPPORTS_NO_STRING_CONVERSION_FLAG)endif()  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-copy")if (CXX_SUPPORTS_NO_DEPRECATED_COPY_FLAG)check_compiler_flag("-Werror -Wno-deprecated-copy" CXX_SUPPORTS_NO_DEPRECATED_COPY_FLAG)endmacro()  check_cxx_compiler_flag("${flag}" ${resultVar})  unset(${resultVar} CACHE)macro(check_compiler_flag flag resultVar)# Builtin check_cxx_compiler_flag doesn't seem to work correctly
\ No newline at end of file
diff -Naur flang-11.0.0rc2.src.orig/CMakeLists.txt flang-11.0.0rc2.src.gtest/CMakeLists.txt
--- flang-11.0.0rc2.src.orig/CMakeLists.txt	2020-09-03 12:01:15.252222897 +0000
+++ flang-11.0.0rc2.src.gtest/CMakeLists.txt	2020-09-03 19:39:33.982733862 +0000
@@ -130,8 +130,11 @@
 #LLVM_BUILD_MAIN_SRC_DIR - Path to llvm source when out-of-tree.
   set(FLANG_GTEST_AVAIL 0)
   if (FLANG_INCLUDE_TESTS)
-    set(UNITTEST_DIR ${LLVM_BUILD_MAIN_SRC_DIR}/utils/unittest)
-    if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h)
+    set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest)
+    if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h
+        AND NOT EXISTS ${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
+        AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
+      add_subdirectory(${UNITTEST_DIR} utils/unittest)
       if (TARGET gtest)
         # LLVM Doesn't export gtest's include directorys, so do that here
         set_target_properties(gtest
