Skip to content

Commit 020dbc8

Browse files
authored
Merge pull request #1562 from ton-blockchain/testnet
Merge improvements for builds
2 parents 0439613 + e3a8a77 commit 020dbc8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+24
-255
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ crypto/smartcont/auto/
1111
test/regression-tests.cache/
1212
*.swp
1313
**/*build*/
14+
.cache
1415
.idea
1516
.vscode
1617
.DS_Store

CMakeLists.txt

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
22

33
project(TON VERSION 0.5 LANGUAGES C CXX)
44
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
@@ -159,6 +159,9 @@ if (TON_USE_ROCKSDB)
159159
set(FAIL_ON_WARNINGS OFF CACHE BOOL "fail on warnings")
160160
message("Add rocksdb")
161161
add_subdirectory(third-party/rocksdb EXCLUDE_FROM_ALL)
162+
# Broken CMake in rocksdb alters properties it has no business changing.
163+
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE)
164+
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK)
162165
endif()
163166

164167
option(USE_COROUTINES "experimental support of coroutines" OFF)
@@ -188,11 +191,12 @@ include(BuildSECP256K1)
188191

189192
# Configure CCache if available
190193
find_program(CCACHE_FOUND ccache)
191-
#set(CCACHE_FOUND 0)
192194
if (CCACHE_FOUND)
193-
message(STATUS "Found ccache")
194-
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
195-
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
195+
if (NOT DEFINED CMAKE_C_COMPILER_LAUNCHER AND NOT DEFINED CMAKE_CXX_COMPILER_LAUNCHER)
196+
message(STATUS "Using ccache")
197+
set(CMAKE_C_COMPILER_LAUNCHER ccache)
198+
set(CMAKE_CXX_COMPILER_LAUNCHER ccache)
199+
endif()
196200
else()
197201
message(STATUS "Could NOT find ccache")
198202
endif()
@@ -341,6 +345,14 @@ add_cxx_compiler_flag("-Qunused-arguments")
341345
add_cxx_compiler_flag("-Wno-unused-private-field")
342346
add_cxx_compiler_flag("-Wno-redundant-move")
343347

348+
if (GCC OR CLANG)
349+
if (CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo")
350+
# For historical reasons, CMake falls back to -O2 optimization level when CMAKE_BUILD_TYPE is
351+
# set to RelWithDebInfo.
352+
add_compile_options(-O3)
353+
endif()
354+
endif()
355+
344356
#add_cxx_compiler_flag("-Wno-unused-function")
345357
#add_cxx_compiler_flag("-Wno-unused-variable")
346358
#add_cxx_compiler_flag("-Wno-shorten-64-to-32")
@@ -351,22 +363,13 @@ if (CLANG)
351363
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
352364
endif()
353365
if (TON_USE_ASAN)
354-
if (CLANG)
355-
add_cxx_compiler_flag("-stdlib=libc++")
356-
endif()
357366
add_cxx_compiler_flag("-fsanitize=address")
358367
add_definitions(-DTD_USE_ASAN=1)
359368
endif()
360369
if (TON_USE_TSAN)
361-
if (CLANG)
362-
add_cxx_compiler_flag("-stdlib=libc++")
363-
endif()
364370
add_cxx_compiler_flag("-fsanitize=thread")
365371
endif()
366372
if (TON_USE_UBSAN)
367-
if (CLANG)
368-
add_cxx_compiler_flag("-stdlib=libc++")
369-
endif()
370373
add_cxx_compiler_flag("-fsanitize=undefined")
371374
endif()
372375
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread")

adnl/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
2-
31
#BEGIN internal
42
if (NOT TON_ONLY_TONLIB)
53
set(ADNL_HEADERS

assembly/native/build-ubuntu-portable-libs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ else
2121
rm -rf .ninja* CMakeCache.txt
2222
fi
2323

24-
export CC=$(which clang)
25-
export CXX=$(which clang++)
24+
export CC=$(which clang-16)
25+
export CXX=$(which clang++-16)
2626
export CCACHE_DISABLE=1
2727

2828
if [ ! -d "lz4" ]; then

assembly/native/build-ubuntu-portable.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ else
2424
rm -rf .ninja* CMakeCache.txt
2525
fi
2626

27-
export CC=$(which clang)
28-
export CXX=$(which clang++)
27+
export CC=$(which clang-16)
28+
export CXX=$(which clang++-16)
2929
export CCACHE_DISABLE=1
3030

3131
if [ ! -d "lz4" ]; then

blockchain-explorer/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
2-
31
option(NIX "Use \"ON\" for a static build." OFF)
42

53
set(BLOCHAIN_EXPLORER_SOURCE

catchain/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
2-
31
if (NOT OPENSSL_FOUND)
42
find_package(OpenSSL REQUIRED)
53
endif()

common/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
2-
31
set(COMMON_SOURCE
42
checksum.h
53
errorcode.h

create-hardfork/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
2-
31
if (NOT OPENSSL_FOUND)
42
find_package(OpenSSL REQUIRED)
53
endif()

crypto/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
2-
31
if (NOT OPENSSL_FOUND)
42
find_package(OpenSSL REQUIRED)
53
endif()

crypto/openssl/digest.h

Lines changed: 0 additions & 151 deletions
This file was deleted.

dht-server/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
2-
31
if (NOT OPENSSL_FOUND)
42
find_package(OpenSSL REQUIRED)
53
endif()

dht/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
2-
31
if (NOT OPENSSL_FOUND)
42
find_package(OpenSSL REQUIRED)
53
endif()

emulator/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
2-
31
option(EMULATOR_STATIC "Build emulator as static library" OFF)
42

53
set(EMULATOR_STATIC_SOURCE

example/android/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# Sets the minimum version of CMake required to build the native library.
55

6-
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
6+
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
77

88
project(TON_ANDROID VERSION 0.5 LANGUAGES C CXX)
99

fec/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
2-
31
if (NOT OPENSSL_FOUND)
42
find_package(OpenSSL REQUIRED)
53
endif()

http/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
2-
31
set(HTTP_SOURCE
42
http.h
53
http.cpp

keyring/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
2-
31
set(KEYRING_SOURCE
42
keyring.h
53
keyring.hpp

keys/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
2-
31
set(KEYS_SOURCE
42
keys.cpp
53
encryptor.cpp

lite-client/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
2-
31
add_library(lite-client-common STATIC lite-client-common.cpp lite-client-common.h ext-client.cpp ext-client.h
42
query-utils.hpp query-utils.cpp)
53
target_link_libraries(lite-client-common PUBLIC tdactor adnllite tl_api tl_lite_api tl-lite-utils ton_crypto)

memprof/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
2-
31
set(MEMPROF_SOURCE
42
memprof/memprof.cpp
53
memprof/memprof.h

overlay/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
2-
31
if (NOT OPENSSL_FOUND)
42
find_package(OpenSSL REQUIRED)
53
endif()

rldp-http-proxy/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
2-
31
add_executable(rldp-http-proxy rldp-http-proxy.cpp DNSResolver.h DNSResolver.cpp)
42
target_include_directories(rldp-http-proxy PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>)
53
target_link_libraries(rldp-http-proxy PRIVATE tonhttp rldp rldp2 dht tonlib git)

rldp/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
2-
31
if (NOT OPENSSL_FOUND)
42
find_package(OpenSSL REQUIRED)
53
endif()

rldp2/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
2-
31
if (NOT OPENSSL_FOUND)
42
find_package(OpenSSL REQUIRED)
53
endif()

storage/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
2-
31
if (NOT OPENSSL_FOUND)
42
find_package(OpenSSL REQUIRED)
53
endif()

storage/storage-daemon/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
2-
31
add_executable(embed-provider-code smartcont/embed-provider-code.cpp)
42

53
add_custom_command(

tdactor/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
2-
31
#SOURCE SETS
42
set(TDACTOR_SOURCE
53
td/actor/core/ActorExecutor.cpp

tdactor/benchmark/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
2-
31
set(BENCHMARK_SOURCE
42
benchmark.cpp
53
third_party/mp-queue.c

0 commit comments

Comments
 (0)