diff --git a/.bazelrc b/.bazelrc index 53cb5e58c7..f11e3aa2f7 100644 --- a/.bazelrc +++ b/.bazelrc @@ -4,19 +4,6 @@ build --cxxopt='-std=c++14' build --copt='-w' build --swiftcopt='-Xcc' build --swiftcopt='-w' -build --features=swift.enable_batch_mode -build --features=swift.use_global_module_cache -build --features=swift.cacheable_swiftmodules build --spawn_strategy=local - -#build --swiftcopt=-wmo -#build --swiftcopt='-num-threads' -#build --swiftcopt='16' -build --swiftcopt=-j14 -#build --jobs 16 - -#build --remote_executor=grpc://localhost:8980 -#build --spawn_strategy=remote -#build --strategy=SwiftCompile=worker -#build --strategy=SwiftCompile=remote build --strategy=SwiftCompile=local + diff --git a/.bazelrc.swp b/.bazelrc.swp deleted file mode 100644 index 4f6e5472b0..0000000000 Binary files a/.bazelrc.swp and /dev/null differ diff --git a/.gitignore b/.gitignore index f003d00dcb..b0487bbc48 100644 --- a/.gitignore +++ b/.gitignore @@ -59,6 +59,7 @@ bazel-telegram-ios/* bazel-testlogs bazel-testlogs/* */*.swp +*.swp build-input/data build-input/data/* build-input/gen diff --git a/Makefile b/Makefile index 6d02c28e93..e35940b7f0 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,8 @@ include Utils.makefile APP_VERSION="5.15.1" +CORE_COUNT=$(shell sysctl -n hw.logicalcpu) +CORE_COUNT_MINUS_ONE=$(shell expr ${CORE_COUNT} \- 1) BUCK_OPTIONS=\ --config custom.appVersion="${APP_VERSION}" \ @@ -44,10 +46,21 @@ BUCK_OPTIONS=\ BAZEL=$(shell which bazel) ifneq ($(BAZEL_CACHE_DIR),) - export BAZEL_CACHE_OPTIONS=\ + export BAZEL_CACHE_FLAGS=\ --disk_cache="${BAZEL_CACHE_DIR}" endif + +BAZEL_COMMON_FLAGS=\ + --features=swift.use_global_module_cache \ +BAZEL_DEBUG_FLAGS=\ + --features=swift.enable_batch_mode \ + --swiftcopt=-j${CORE_COUNT_MINUS_ONE} \ + +BAZEL_OPT_FLAGS=\ + --swiftcopt=-whole-module-optimization \ + --swiftcopt='-num-threads' --swiftcopt='16' \ + build_arm64: check_env $(BUCK) build \ @@ -408,18 +421,17 @@ temp_project: check_env kill_xcode bazel_app_debug_arm64: APP_VERSION="${APP_VERSION}" \ build-system/prepare-build.sh distribution - "${BAZEL}" build Telegram/Telegram \ + "${BAZEL}" build Telegram/Telegram ${BAZEL_CACHE_FLAGS} ${BAZEL_COMMON_FLAGS} ${BAZEL_DEBUG_FLAGS} \ -c dbg \ --ios_multi_cpus=arm64 \ --watchos_cpus=armv7k,arm64_32 \ - --verbose_failures \ - -s + --verbose_failures bazel_app_arm64: APP_VERSION="${APP_VERSION}" \ BAZEL_CACHE_DIR="${BAZEL_CACHE_DIR}" \ build-system/prepare-build.sh distribution - "${BAZEL}" build Telegram/Telegram ${BAZEL_CACHE_OPTIONS} \ + "${BAZEL}" build Telegram/Telegram ${BAZEL_CACHE_FLAGS} ${BAZEL_COMMON_FLAGS} ${BAZEL_OPT_FLAGS} \ -c opt \ --ios_multi_cpus=arm64 \ --watchos_cpus=armv7k,arm64_32 \ diff --git a/build-system/generate-xcode-project.sh b/build-system/generate-xcode-project.sh index 99e1d3d1d2..4fbcc74111 100755 --- a/build-system/generate-xcode-project.sh +++ b/build-system/generate-xcode-project.sh @@ -36,12 +36,17 @@ GEN_DIRECTORY="build-input/gen/project" rm -rf "$GEN_DIRECTORY" mkdir -p "$GEN_DIRECTORY" +CORE_COUNT=$(sysctl -n hw.logicalcpu) +CORE_COUNT_MINUS_ONE=$(expr ${CORE_COUNT} \- 1) + BAZEL_OPTIONS=(\ --features=swift.use_global_module_cache \ --spawn_strategy=standalone \ --strategy=SwiftCompile=standalone \ + --features=swift.enable_batch_mode \ + --swiftcopt=-j${CORE_COUNT_MINUS_ONE} \ ) -set -x + if [ "$BAZEL_CACHE_DIR" != "" ]; then BAZEL_OPTIONS=("${BAZEL_OPTIONS[@]}" --disk_cache="$(echo $BAZEL_CACHE_DIR | sed -e 's/[\/&]/\\&/g')") fi diff --git a/submodules/Display/Source/Nodes/ButtonNode.swift b/submodules/Display/Source/Nodes/ButtonNode.swift index 9b68afc19f..a7d6c8035c 100644 --- a/submodules/Display/Source/Nodes/ButtonNode.swift +++ b/submodules/Display/Source/Nodes/ButtonNode.swift @@ -280,5 +280,6 @@ open class ASButtonNode: ASControlNode { self.highlightedBackgroundImageNode.frame = CGRect(origin: CGPoint(), size: size) } - func f2() {print("test5") } + func f2() { + } }