aboutsummaryrefslogtreecommitdiffstats
path: root/build/ymake.core.conf
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.ru>2022-02-25 00:23:54 +0300
committerthegeorg <thegeorg@yandex-team.ru>2022-02-25 00:23:54 +0300
commit207b28a6021793cec36893b859eb01c76434e6b1 (patch)
tree406ddff6e841c13450a4c798f68e4fbebb57c3b4 /build/ymake.core.conf
parent9e08dc29988aa927698e62abd83d0930c730c464 (diff)
downloadydb-207b28a6021793cec36893b859eb01c76434e6b1.tar.gz
Implement SRC_CPP_NO_LTO and use it util/
`-flto` / `-fno-lto` is not available in clang-cl, so we should not use it in order to prevent `-Wunknown-argument` from being triggered Raw CFLAGS are not user-friendly, we should define a better macro for thi (somewhat popular) case. ref:6f969138dc8b6fe4c420eb2ef4c0e50c2503d184
Diffstat (limited to 'build/ymake.core.conf')
-rw-r--r--build/ymake.core.conf13
1 files changed, 13 insertions, 0 deletions
diff --git a/build/ymake.core.conf b/build/ymake.core.conf
index b0c390dfc3..fadc1cbd07 100644
--- a/build/ymake.core.conf
+++ b/build/ymake.core.conf
@@ -1250,10 +1250,12 @@ module _BASE_UNIT: _BARE_UNIT {
when ($GCC) {
CFLAGS+=-flto -fno-fat-lto-objects
LDFLAGS+=-flto
+ NO_LTO_CFLAGS=-fno-lto
}
when ($CLANG) {
CFLAGS+=-flto
LDFLAGS+=-flto
+ NO_LTO_CFLAGS=-fno-lto
}
}
@@ -1261,10 +1263,12 @@ module _BASE_UNIT: _BARE_UNIT {
when ($GCC) {
CFLAGS+=-flto=thin
LDFLAGS+=-flto=thin
+ NO_LTO_CFLAGS=-fno-lto
}
when ($CLANG) {
CFLAGS+=-flto=thin
LDFLAGS+=-flto=thin
+ NO_LTO_CFLAGS=-fno-lto
}
}
@@ -5705,6 +5709,8 @@ SSE_CFLAGS=
SSE4_DEFINES=
SSE4_CFLAGS=
+NO_LTO_CFLAGS=
+
# tag:cpu
when (($ARCH_X86_64 || $ARCH_I386) && $DISABLE_INSTRUCTION_SETS != "yes") {
when ($CLANG || $CLANG_CL || $GCC) {
@@ -6328,6 +6334,13 @@ macro SRC_CPP_PIC(FILE, FLAGS...) {
}
# tag:cpu tag:src-processing
+### @uage SRC_CPP_NO_LTO(File)
+### Compile single .cpp file with link-time-optimization disabled
+macro SRC_CPP_NO_LTO(FILE) {
+ _SRC(cpp $FILE $NO_LTO_CFLAGS)
+}
+
+# tag:cpu tag:src-processing
### @usage SRC_CPP_SSE2(File Flags...)
### Compile single .cpp-file with SSE2 and extra Flags.
macro SRC_CPP_SSE2(FILE, FLAGS...) {