mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-11 07:10:36 +00:00
24 lines
565 B
CMake
24 lines
565 B
CMake
if(NOT STATIC_LINK)
|
|
return()
|
|
endif()
|
|
|
|
if(NOT CMAKE_CROSSCOMPILING)
|
|
add_compile_options(-static -flto)
|
|
else()
|
|
add_compile_options(-static)
|
|
endif()
|
|
|
|
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
link_libraries( -flto)
|
|
return()
|
|
endif()
|
|
|
|
if(NOT CMAKE_CROSSCOMPILING)
|
|
set(CMAKE_AR "gcc-ar")
|
|
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> qcs <TARGET> <LINK_FLAGS> <OBJECTS>")
|
|
set(CMAKE_C_ARCHIVE_FINISH "true")
|
|
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> qcs <TARGET> <LINK_FLAGS> <OBJECTS>")
|
|
set(CMAKE_CXX_ARCHIVE_FINISH "true")
|
|
link_libraries( -flto )
|
|
endif()
|