Add check to prevent attaching a profiler when one is already present (#25520)
[platform/upstream/coreclr.git] / configure.cmake
1 include(CheckCXXSourceCompiles)
2 include(CheckCXXCompilerFlag)
3
4 # VC++ guarantees support for LTCG (LTO's equivalent)
5 if(NOT WIN32)
6   # Function required to give CMAKE_REQUIRED_* local scope
7   function(check_have_lto)
8     set(CMAKE_REQUIRED_FLAGS -flto)
9     set(CMAKE_REQUIRED_LIBRARIES -flto -fuse-ld=gold)
10     check_cxx_source_compiles("int main() { return 0; }" HAVE_LTO)
11   endfunction(check_have_lto)
12   check_have_lto()
13
14   check_cxx_compiler_flag(-faligned-new COMPILER_SUPPORTS_F_ALIGNED_NEW)
15 endif(NOT WIN32)