mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Fix invalid numeric argument '/Wextra' when compile on Windows (#499)
* add: TON Overflow * Fix invalid numeric argument '/Wextra' when compile on Windows; Also make strip command compatible with Darwin OS Co-authored-by: Doge <awesomedogewow@gmail.com> Co-authored-by: EmelyanenkoK <emelyanenko.kirill@gmail.com>
This commit is contained in:
parent
3d9a165586
commit
e03abf221b
3 changed files with 22 additions and 6 deletions
|
@ -290,8 +290,9 @@ if (MSVC)
|
||||||
endif()
|
endif()
|
||||||
if (NOT MSVC)
|
if (NOT MSVC)
|
||||||
add_cxx_compiler_flag("-Wall")
|
add_cxx_compiler_flag("-Wall")
|
||||||
|
add_cxx_compiler_flag("-Wextra")
|
||||||
endif()
|
endif()
|
||||||
add_cxx_compiler_flag("-Wextra")
|
|
||||||
add_cxx_compiler_flag("-Wimplicit-fallthrough=2")
|
add_cxx_compiler_flag("-Wimplicit-fallthrough=2")
|
||||||
add_cxx_compiler_flag("-Wpointer-arith")
|
add_cxx_compiler_flag("-Wpointer-arith")
|
||||||
add_cxx_compiler_flag("-Wcast-qual")
|
add_cxx_compiler_flag("-Wcast-qual")
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
[![TON Overflow Group][ton-overflow-badge]][ton-overflow-url]
|
||||||
[![Stack Overflow Group][stack-overflow-badge]][stack-overflow-url]
|
[![Stack Overflow Group][stack-overflow-badge]][stack-overflow-url]
|
||||||
[![Telegram Foundation Group][telegram-foundation-badge]][telegram-foundation-url]
|
[![Telegram Foundation Group][telegram-foundation-badge]][telegram-foundation-url]
|
||||||
[![Telegram Community Group][telegram-community-badge]][telegram-community-url]
|
[![Telegram Community Group][telegram-community-badge]][telegram-community-url]
|
||||||
|
@ -11,6 +12,8 @@
|
||||||
[twitter-url]: https://twitter.com/ton_blockchain
|
[twitter-url]: https://twitter.com/ton_blockchain
|
||||||
[stack-overflow-badge]: https://img.shields.io/badge/-Stack%20Overflow-FE7A16?style=flat&logo=stack-overflow&logoColor=white
|
[stack-overflow-badge]: https://img.shields.io/badge/-Stack%20Overflow-FE7A16?style=flat&logo=stack-overflow&logoColor=white
|
||||||
[stack-overflow-url]: https://stackoverflow.com/questions/tagged/ton
|
[stack-overflow-url]: https://stackoverflow.com/questions/tagged/ton
|
||||||
|
[ton-overflow-badge]: https://img.shields.io/badge/-TON%20Overflow-FE7A16?style=flat&logo=stack-overflow&logoColor=white
|
||||||
|
[ton-overflow-url]: https://answers.ton.org
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,14 @@ cmake_minimum_required(VERSION 3.4.1 FATAL_ERROR)
|
||||||
|
|
||||||
option(TONLIB_ENABLE_JNI "Enable JNI-compatible TonLib API" ON)
|
option(TONLIB_ENABLE_JNI "Enable JNI-compatible TonLib API" ON)
|
||||||
|
|
||||||
string(APPEND CMAKE_CXX_FLAGS " -std=c++14 -Wall -Wextra -Wno-unused-parameter -Wno-deprecated-declarations -Wconversion -Wno-sign-conversion -fno-omit-frame-pointer -ffunction-sections -fdata-sections")
|
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||||
string(APPEND CMAKE_SHARED_LINKER_FLAGS " -Wl,--gc-sections -Wl,--exclude-libs,ALL")
|
string(APPEND CMAKE_CXX_FLAGS " -std=c++14 -fno-omit-frame-pointer -ffunction-sections -fdata-sections")
|
||||||
|
else()
|
||||||
|
string(APPEND CMAKE_CXX_FLAGS " -std=c++14 -Wall -Wextra -Wno-unused-parameter -Wno-deprecated-declarations -Wconversion -Wno-sign-conversion -fno-omit-frame-pointer -ffunction-sections -fdata-sections")
|
||||||
|
endif()
|
||||||
|
if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
|
string(APPEND CMAKE_SHARED_LINKER_FLAGS " -Wl,--gc-sections -Wl,--exclude-libs,ALL")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Creates and names a library, sets it as either STATIC
|
# Creates and names a library, sets it as either STATIC
|
||||||
# or SHARED, and provides the relative paths to its source code.
|
# or SHARED, and provides the relative paths to its source code.
|
||||||
|
@ -37,9 +43,15 @@ target_link_libraries(native-lib tonlib)
|
||||||
set(TONLIB_API_JAVA_PACKAGE "drinkless/org/ton")
|
set(TONLIB_API_JAVA_PACKAGE "drinkless/org/ton")
|
||||||
target_compile_definitions(native-lib PRIVATE PACKAGE_NAME="${TONLIB_API_JAVA_PACKAGE}")
|
target_compile_definitions(native-lib PRIVATE PACKAGE_NAME="${TONLIB_API_JAVA_PACKAGE}")
|
||||||
|
|
||||||
add_custom_command(TARGET native-lib POST_BUILD
|
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
COMMAND ${CMAKE_COMMAND} -E rename $<TARGET_FILE:native-lib> $<TARGET_FILE:native-lib>.debug
|
add_custom_command(TARGET native-lib POST_BUILD
|
||||||
COMMAND ${CMAKE_STRIP} --strip-debug --strip-unneeded $<TARGET_FILE:native-lib>.debug -o $<TARGET_FILE:native-lib>)
|
COMMAND ${CMAKE_COMMAND} -E rename $<TARGET_FILE:native-lib> $<TARGET_FILE:native-lib>.debug
|
||||||
|
COMMAND ${CMAKE_STRIP} -S $<TARGET_FILE:native-lib>.debug -o $<TARGET_FILE:native-lib>)
|
||||||
|
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||||
|
add_custom_command(TARGET native-lib POST_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E rename $<TARGET_FILE:native-lib> $<TARGET_FILE:native-lib>.debug
|
||||||
|
COMMAND ${CMAKE_STRIP} --strip-debug --strip-unneeded $<TARGET_FILE:native-lib>.debug -o $<TARGET_FILE:native-lib>)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (NOT CMAKE_CROSSCOMPILING)
|
if (NOT CMAKE_CROSSCOMPILING)
|
||||||
set(TONLIB_API_JAVA_PATH ${CMAKE_CURRENT_SOURCE_DIR}/src/)
|
set(TONLIB_API_JAVA_PATH ${CMAKE_CURRENT_SOURCE_DIR}/src/)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue