aboutsummaryrefslogtreecommitdiffstats
path: root/build/export_generators/hardcoded-cmake/cmake
diff options
context:
space:
mode:
authorAlexSm <alex@ydb.tech>2024-01-18 11:28:56 +0100
committerGitHub <noreply@github.com>2024-01-18 11:28:56 +0100
commit9d0a3761b3201e0d9db879a7adf91876ebdb0564 (patch)
tree541d11ac878c18efd7ebca81e35112aa0fef995b /build/export_generators/hardcoded-cmake/cmake
parent404ef8886ecc9736bc58ade6da2fbd83b486a408 (diff)
downloadydb-9d0a3761b3201e0d9db879a7adf91876ebdb0564.tar.gz
Library import 8 (#1074)
* Library import 8 * Add contrib/libs/cxxsupp/libcxx/include/__verbose_abort
Diffstat (limited to 'build/export_generators/hardcoded-cmake/cmake')
-rw-r--r--build/export_generators/hardcoded-cmake/cmake/conan-profiles/android.arm64.profile15
-rw-r--r--build/export_generators/hardcoded-cmake/cmake/conan-profiles/android.armv7.profile15
-rw-r--r--build/export_generators/hardcoded-cmake/cmake/conan-profiles/android.x86.profile15
-rw-r--r--build/export_generators/hardcoded-cmake/cmake/conan-profiles/android.x86_64.profile15
-rw-r--r--build/export_generators/hardcoded-cmake/cmake/conan-profiles/linux.aarch64.profile28
-rw-r--r--build/export_generators/hardcoded-cmake/cmake/conan-profiles/linux.ppc64le.profile28
-rw-r--r--build/export_generators/hardcoded-cmake/cmake/conan-profiles/macos.arm64.profile11
-rw-r--r--build/export_generators/hardcoded-cmake/cmake/conan.cmake11
-rw-r--r--build/export_generators/hardcoded-cmake/cmake/global_flags.compiler.gnu.cmake32
-rw-r--r--build/export_generators/hardcoded-cmake/cmake/global_flags.compiler.gnu.march.cmake34
-rw-r--r--build/export_generators/hardcoded-cmake/cmake/global_flags.compiler.msvc.cmake21
11 files changed, 192 insertions, 33 deletions
diff --git a/build/export_generators/hardcoded-cmake/cmake/conan-profiles/android.arm64.profile b/build/export_generators/hardcoded-cmake/cmake/conan-profiles/android.arm64.profile
new file mode 100644
index 0000000000..6147d99225
--- /dev/null
+++ b/build/export_generators/hardcoded-cmake/cmake/conan-profiles/android.arm64.profile
@@ -0,0 +1,15 @@
+include(default)
+[settings]
+arch=armv8
+build_type=Release
+compiler=clang
+compiler.libcxx=libc++
+compiler.version=14
+compiler.cppstd=20
+os=Android
+os.api_level=21
+[tool_requires]
+android-ndk/r25
+[options]
+[env]
+
diff --git a/build/export_generators/hardcoded-cmake/cmake/conan-profiles/android.armv7.profile b/build/export_generators/hardcoded-cmake/cmake/conan-profiles/android.armv7.profile
new file mode 100644
index 0000000000..57d8f55785
--- /dev/null
+++ b/build/export_generators/hardcoded-cmake/cmake/conan-profiles/android.armv7.profile
@@ -0,0 +1,15 @@
+include(default)
+[settings]
+arch=armv7
+build_type=Release
+compiler=clang
+compiler.libcxx=libc++
+compiler.version=14
+compiler.cppstd=20
+os=Android
+os.api_level=21
+[tool_requires]
+android-ndk/r25
+[options]
+[env]
+
diff --git a/build/export_generators/hardcoded-cmake/cmake/conan-profiles/android.x86.profile b/build/export_generators/hardcoded-cmake/cmake/conan-profiles/android.x86.profile
new file mode 100644
index 0000000000..d8b73b992c
--- /dev/null
+++ b/build/export_generators/hardcoded-cmake/cmake/conan-profiles/android.x86.profile
@@ -0,0 +1,15 @@
+include(default)
+[settings]
+arch=x86
+build_type=Release
+compiler=clang
+compiler.libcxx=libc++
+compiler.version=14
+compiler.cppstd=20
+os=Android
+os.api_level=21
+[tool_requires]
+android-ndk/r25
+[options]
+[env]
+
diff --git a/build/export_generators/hardcoded-cmake/cmake/conan-profiles/android.x86_64.profile b/build/export_generators/hardcoded-cmake/cmake/conan-profiles/android.x86_64.profile
new file mode 100644
index 0000000000..50ad337afa
--- /dev/null
+++ b/build/export_generators/hardcoded-cmake/cmake/conan-profiles/android.x86_64.profile
@@ -0,0 +1,15 @@
+include(default)
+[settings]
+arch=x86_64
+build_type=Release
+compiler=clang
+compiler.libcxx=libc++
+compiler.version=14
+compiler.cppstd=20
+os=Android
+os.api_level=21
+[tool_requires]
+android-ndk/r25
+[options]
+[env]
+
diff --git a/build/export_generators/hardcoded-cmake/cmake/conan-profiles/linux.aarch64.profile b/build/export_generators/hardcoded-cmake/cmake/conan-profiles/linux.aarch64.profile
new file mode 100644
index 0000000000..6945b1d777
--- /dev/null
+++ b/build/export_generators/hardcoded-cmake/cmake/conan-profiles/linux.aarch64.profile
@@ -0,0 +1,28 @@
+include(default)
+
+target_host=aarch64-linux-gnu
+
+[settings]
+arch=armv8
+build_type=Release
+compiler=gcc
+compiler.libcxx=libstdc++11
+compiler.version=12
+compiler.cppstd=20
+os=Linux
+[options]
+
+[env]
+CONAN_CMAKE_FIND_ROOT_PATH=/usr/$target_host
+CONAN_CMAKE_SYSROOT=/usr/$target_host
+SYSROOT=/usr/$target_host
+CC=$target_host-gcc
+CXX=$target_host-g++
+CXXFLAGS="-I/usr/$target_host/include/"
+CFLAGS="-I/usr/$target_host/include/"
+CHOST=$target_host
+AR=$target_host-ar
+AS=$target_host-as
+RANLIB=$target_host-ranlib
+LD=$target_host-ld
+STRIP=$target_host-strip
diff --git a/build/export_generators/hardcoded-cmake/cmake/conan-profiles/linux.ppc64le.profile b/build/export_generators/hardcoded-cmake/cmake/conan-profiles/linux.ppc64le.profile
new file mode 100644
index 0000000000..5ecd24d6ce
--- /dev/null
+++ b/build/export_generators/hardcoded-cmake/cmake/conan-profiles/linux.ppc64le.profile
@@ -0,0 +1,28 @@
+include(default)
+
+target_host=powerpc64le-linux-gnu
+
+[settings]
+arch=ppc64le
+build_type=Release
+compiler=gcc
+compiler.libcxx=libstdc++11
+compiler.version=12
+compiler.cppstd=20
+os=Linux
+[options]
+
+[env]
+CONAN_CMAKE_FIND_ROOT_PATH=/usr/$target_host
+CONAN_CMAKE_SYSROOT=/usr/$target_host
+SYSROOT=/usr/$target_host
+CC=$target_host-gcc
+CXX=$target_host-g++
+CXXFLAGS="-I/usr/$target_host/include/"
+CFLAGS="-I/usr/$target_host/include/"
+CHOST=$target_host
+AR=$target_host-ar
+AS=$target_host-as
+RANLIB=$target_host-ranlib
+LD=$target_host-ld
+STRIP=$target_host-strip
diff --git a/build/export_generators/hardcoded-cmake/cmake/conan-profiles/macos.arm64.profile b/build/export_generators/hardcoded-cmake/cmake/conan-profiles/macos.arm64.profile
new file mode 100644
index 0000000000..52ba46ab97
--- /dev/null
+++ b/build/export_generators/hardcoded-cmake/cmake/conan-profiles/macos.arm64.profile
@@ -0,0 +1,11 @@
+include(default)
+[settings]
+arch=armv8
+build_type=Release
+compiler=clang
+compiler.libcxx=libc++
+compiler.version=14
+compiler.cppstd=20
+os=Macos
+[options]
+[env]
diff --git a/build/export_generators/hardcoded-cmake/cmake/conan.cmake b/build/export_generators/hardcoded-cmake/cmake/conan.cmake
index d6a8b5e8c4..9a5dee5d81 100644
--- a/build/export_generators/hardcoded-cmake/cmake/conan.cmake
+++ b/build/export_generators/hardcoded-cmake/cmake/conan.cmake
@@ -170,7 +170,10 @@ macro(_conan_detect_compiler)
conan_cmake_detect_unix_libcxx(_LIBCXX)
set(_CONAN_SETTING_COMPILER_LIBCXX ${_LIBCXX})
endif ()
- elseif (${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL Clang)
+ elseif (${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL Clang
+ AND NOT "${CMAKE_${LANGUAGE}_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC"
+ AND NOT "${CMAKE_${LANGUAGE}_SIMULATE_ID}" STREQUAL "MSVC")
+
string(REPLACE "." ";" VERSION_LIST ${CMAKE_${LANGUAGE}_COMPILER_VERSION})
list(GET VERSION_LIST 0 MAJOR)
list(GET VERSION_LIST 1 MINOR)
@@ -190,7 +193,11 @@ macro(_conan_detect_compiler)
conan_cmake_detect_unix_libcxx(_LIBCXX)
set(_CONAN_SETTING_COMPILER_LIBCXX ${_LIBCXX})
endif ()
- elseif(${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL MSVC)
+ elseif(${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL MSVC
+ OR (${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL Clang
+ AND "${CMAKE_${LANGUAGE}_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC"
+ AND "${CMAKE_${LANGUAGE}_SIMULATE_ID}" STREQUAL "MSVC"))
+
set(_VISUAL "Visual Studio")
_get_msvc_ide_version(_VISUAL_VERSION)
if("${_VISUAL_VERSION}" STREQUAL "")
diff --git a/build/export_generators/hardcoded-cmake/cmake/global_flags.compiler.gnu.cmake b/build/export_generators/hardcoded-cmake/cmake/global_flags.compiler.gnu.cmake
index 3dcde4027f..c5d0013b20 100644
--- a/build/export_generators/hardcoded-cmake/cmake/global_flags.compiler.gnu.cmake
+++ b/build/export_generators/hardcoded-cmake/cmake/global_flags.compiler.gnu.cmake
@@ -48,37 +48,9 @@ if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm.*|aarch64|ppc64le)")
string(APPEND _GNU_COMMON_C_CXX_FLAGS " -fsigned-char")
endif()
-if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(i686|x86_64|AMD64)$")
- if (CMAKE_SYSTEM_PROCESSOR STREQUAL "i686")
- string(APPEND _GNU_COMMON_C_CXX_FLAGS " -m32")
- elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64)$")
- string(APPEND _GNU_COMMON_C_CXX_FLAGS " -m64")
- endif()
- string(APPEND _GNU_COMMON_C_CXX_FLAGS "\
- -msse2 \
- -msse3 \
- -mssse3 \
- ")
+include(global_flags.compiler.gnu.march)
+string(APPEND _GNU_COMMON_C_CXX_FLAGS " ${_GNU_MARCH_C_CXX_FLAGS}")
- if ((CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64)$") OR (NOT ANDROID))
- string(APPEND _GNU_COMMON_C_CXX_FLAGS "\
- -msse4.1 \
- -msse4.2 \
- -mpopcnt \
- ")
- if (NOT ANDROID)
- # older clang versions did not support this feature on Android:
- # https://reviews.llvm.org/rGc32d307a49f5255602e7543e64e6c38a7f536abc
- string(APPEND _GNU_COMMON_C_CXX_FLAGS " -mcx16")
- endif()
- endif()
-
- if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
- string(APPEND _GNU_COMMON_C_CXX_FLAGS " -D_YNDX_LIBUNWIND_ENABLE_EXCEPTION_BACKTRACE")
- endif()
-elseif (ANDROID AND (CMAKE_ANDROID_ARCH_ABI STREQUAL "armeabi-v7a"))
- string(APPEND _GNU_COMMON_C_CXX_FLAGS " -mfloat-abi=softfp")
-endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_GNU_COMMON_C_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_GNU_COMMON_C_CXX_FLAGS} \
diff --git a/build/export_generators/hardcoded-cmake/cmake/global_flags.compiler.gnu.march.cmake b/build/export_generators/hardcoded-cmake/cmake/global_flags.compiler.gnu.march.cmake
new file mode 100644
index 0000000000..a81af88c70
--- /dev/null
+++ b/build/export_generators/hardcoded-cmake/cmake/global_flags.compiler.gnu.march.cmake
@@ -0,0 +1,34 @@
+
+set(_GNU_MARCH_C_CXX_FLAGS "")
+
+if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(i686|x86_64|AMD64)$")
+ if (CMAKE_SYSTEM_PROCESSOR STREQUAL "i686")
+ string(APPEND _GNU_MARCH_C_CXX_FLAGS " -m32")
+ elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64)$")
+ string(APPEND _GNU_MARCH_C_CXX_FLAGS " -m64")
+ endif()
+ string(APPEND _GNU_MARCH_C_CXX_FLAGS "\
+ -msse2 \
+ -msse3 \
+ -mssse3 \
+ ")
+
+ if ((CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64)$") OR (NOT ANDROID))
+ string(APPEND _GNU_MARCH_C_CXX_FLAGS "\
+ -msse4.1 \
+ -msse4.2 \
+ -mpopcnt \
+ ")
+ if (NOT ANDROID)
+ # older clang versions did not support this feature on Android:
+ # https://reviews.llvm.org/rGc32d307a49f5255602e7543e64e6c38a7f536abc
+ string(APPEND _GNU_MARCH_C_CXX_FLAGS " -mcx16")
+ endif()
+ endif()
+
+ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ string(APPEND _GNU_MARCH_C_CXX_FLAGS " -D_YNDX_LIBUNWIND_ENABLE_EXCEPTION_BACKTRACE")
+ endif()
+elseif (ANDROID AND (CMAKE_ANDROID_ARCH_ABI STREQUAL "armeabi-v7a"))
+ string(APPEND _GNU_MARCH_C_CXX_FLAGS " -mfloat-abi=softfp")
+endif()
diff --git a/build/export_generators/hardcoded-cmake/cmake/global_flags.compiler.msvc.cmake b/build/export_generators/hardcoded-cmake/cmake/global_flags.compiler.msvc.cmake
index ffbd2e033c..1541beb834 100644
--- a/build/export_generators/hardcoded-cmake/cmake/global_flags.compiler.msvc.cmake
+++ b/build/export_generators/hardcoded-cmake/cmake/global_flags.compiler.msvc.cmake
@@ -1,3 +1,9 @@
+set(_IS_CLANG_CL_COMPILER
+ ${CMAKE_CXX_COMPILER_ID} STREQUAL Clang
+ AND "${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC"
+ AND "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC"
+)
+
set(_WARNS_ENABLED
4018 # 'expression' : signed/unsigned mismatch
4265 # 'class' : class has virtual functions, but destructor is not virtual
@@ -64,9 +70,13 @@ set (_MSVC_COMMON_C_CXX_FLAGS " \
/permissive- \
/D_WIN32_WINNT=0x0601 \
/D_MBCS \
- /MP \
")
+if (NOT _IS_CLANG_CL_COMPILER)
+ # unused by clang-cl
+ string(APPEND _MSVC_COMMON_C_CXX_FLAGS " /MP")
+endif()
+
if (CMAKE_GENERATOR MATCHES "Visual.Studio.*")
string(APPEND _MSVC_COMMON_C_CXX_FLAGS "\
/DY_UCRT_INCLUDE=\"$(UniversalCRT_IncludePath.Split(';')[0].Replace('\\','/'))\" \
@@ -127,6 +137,15 @@ if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64)$")
")
endif()
+if (_IS_CLANG_CL_COMPILER)
+ # clang-cl works slighly differently than MSVC compiler when specifying arch options, so we have to set them differently
+ # https://github.com/llvm/llvm-project/issues/56722
+
+ include(global_flags.compiler.gnu.march)
+ string(APPEND _MSVC_COMMON_C_CXX_FLAGS " ${_GNU_MARCH_C_CXX_FLAGS}")
+endif()
+
+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_MSVC_COMMON_C_CXX_FLAGS} \
")