feat static libgcc libstdc++
Some checks failed
android / build (push) Has been cancelled
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (Debug) (push) Has been cancelled
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (Release) (push) Has been cancelled
linux-arm-gcc / linux-gcc-arm (Debug) (push) Has been cancelled
linux-arm-gcc / linux-gcc-arm (Release) (push) Has been cancelled
linux-arm-gcc / linux-gcc-armhf (Debug) (push) Has been cancelled
linux-arm-gcc / linux-gcc-armhf (Release) (push) Has been cancelled
linux-mips-gcc / linux-gcc-mipsel (Debug) (push) Has been cancelled
linux-mips-gcc / linux-gcc-mipsel (Release) (push) Has been cancelled
linux-mips64-gcc / linux-gcc-mips64el (Debug) (push) Has been cancelled
linux-mips64-gcc / linux-gcc-mips64el (Release) (push) Has been cancelled
linux-riscv64-gcc / linux-gcc-riscv64 (Debug) (push) Has been cancelled
linux-riscv64-gcc / linux-gcc-riscv64 (Release) (push) Has been cancelled
android / build (pull_request) Has been cancelled
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (Debug) (pull_request) Has been cancelled
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (Release) (pull_request) Has been cancelled
linux-x64-clang / linux-clang (Debug) (push) Has been cancelled
linux-x64-clang / linux-clang (Release) (push) Has been cancelled
linux-arm-gcc / linux-gcc-arm (Debug) (pull_request) Has been cancelled
linux-arm-gcc / linux-gcc-arm (Release) (pull_request) Has been cancelled
linux-arm-gcc / linux-gcc-armhf (Debug) (pull_request) Has been cancelled
linux-arm-gcc / linux-gcc-armhf (Release) (pull_request) Has been cancelled
linux-x64-gcc / linux-gcc (Debug) (push) Has been cancelled
linux-x64-gcc / linux-gcc (Release) (push) Has been cancelled
linux-x86-gcc / linux-gcc (Debug) (push) Has been cancelled
linux-x86-gcc / linux-gcc (Release) (push) Has been cancelled
linux-mips-gcc / linux-gcc-mipsel (Debug) (pull_request) Has been cancelled
linux-mips-gcc / linux-gcc-mipsel (Release) (pull_request) Has been cancelled
linux-mips64-gcc / linux-gcc-mips64el (Debug) (pull_request) Has been cancelled
linux-mips64-gcc / linux-gcc-mips64el (Release) (pull_request) Has been cancelled
linux-riscv64-gcc / linux-gcc-riscv64 (Debug) (pull_request) Has been cancelled
linux-riscv64-gcc / linux-gcc-riscv64 (Release) (pull_request) Has been cancelled
linux-x64-clang / linux-clang (Debug) (pull_request) Has been cancelled
linux-x64-clang / linux-clang (Release) (pull_request) Has been cancelled
linux-x64-gcc / linux-gcc (Debug) (pull_request) Has been cancelled
linux-x64-gcc / linux-gcc (Release) (pull_request) Has been cancelled
linux-x86-gcc / linux-gcc (Debug) (pull_request) Has been cancelled
linux-x86-gcc / linux-gcc (Release) (pull_request) Has been cancelled

This commit is contained in:
tqcq 2024-09-02 16:06:42 +08:00
parent fa04f9c23a
commit 25998dde64

View File

@ -19,6 +19,10 @@ set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# add static libgcc and libstdc++ for static linking
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc -static-libstdc++")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")
option(TILE_BUILD_TESTS "Build tests" OFF)
option(TILE_BUILD_BENCHMARKS "Build tests" OFF)
option(TILE_WITH_OPENSSL "Build with openssl" OFF)
@ -34,34 +38,34 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gz")
# # set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -gz")
# # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static") set(CMAKE_C_FLAGS
# # "${CMAKE_CXX_FLAGS} -static") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}
# # -fsanitize=address ") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address
# # ")
#
# set(WHOLE_ARCHIVE_PREFIX "-Wl,-force_load")
# # set(NO_WHOLE_ARCHIVE_PREFIX "")
# elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
# # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gz")
# # set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -gz")
# # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static") set(CMAKE_C_FLAGS
# # "${CMAKE_CXX_FLAGS} -static")
#
# set(WHOLE_ARCHIVE_PREFIX "-Wl,-force_load,")
# # set(NO_WHOLE_ARCHIVE_PREFIX "")
# elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gz")
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -gz")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static") set(CMAKE_C_FLAGS
# "${CMAKE_CXX_FLAGS} -static") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}
# -fsanitize=address ") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address
# ")
set(WHOLE_ARCHIVE_PREFIX "-Wl,-force_load")
# set(NO_WHOLE_ARCHIVE_PREFIX "")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gz")
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -gz")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static") set(CMAKE_C_FLAGS
# "${CMAKE_CXX_FLAGS} -static")
set(WHOLE_ARCHIVE_PREFIX "-Wl,-force_load,")
# set(NO_WHOLE_ARCHIVE_PREFIX "")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gz")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -gz")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")
# set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")
set(STATIC_BINARY_FLAGS "-static-libgcc -static-libstdc++")
set(WHOLE_ARCHIVE_PREFIX "-Wl,--whole-archive")
set(WHOLE_ARCHIVE_SUFFIX "-Wl,--no-whole-archive")
endif()
# # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")
# # set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")
#
# set(STATIC_BINARY_FLAGS "-static-libgcc -static-libstdc++")
# set(WHOLE_ARCHIVE_PREFIX "-Wl,--whole-archive")
# set(WHOLE_ARCHIVE_SUFFIX "-Wl,--no-whole-archive")
# endif()
# extern int getifaddrs(struct ifaddrs **ifap); extern void freeifaddrs(struct
# ifaddrs *ifa);