Skip to content

Commit c9424ba

Browse files
committed
cmake: make static flags configurable
1 parent 243a442 commit c9424ba

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -995,9 +995,10 @@ include(CheckTrezor)
995995
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${RELEASE_FLAGS}")
996996
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${RELEASE_FLAGS}")
997997

998-
if(STATIC)
999-
# STATIC already configures most deps to be linked in statically,
1000-
# here we make more deps static if the platform permits it
998+
if(STATIC)
999+
# STATIC already configures most deps to be linked in statically,
1000+
# here we make more deps static if the platform permits it
1001+
if (NOT DEFINED STATIC_FLAGS)
10011002
if (MINGW)
10021003
# On Windows, this is as close to fully-static as we get:
10031004
# this leaves only deps on /c/Windows/system32/*.dll
@@ -1006,8 +1007,9 @@ include(CheckTrezor)
10061007
# On Linux, we don't support fully static build, but these can be static
10071008
set(STATIC_FLAGS "-static-libgcc -static-libstdc++")
10081009
endif()
1009-
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${STATIC_FLAGS} ")
10101010
endif()
1011+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${STATIC_FLAGS} ")
1012+
endif()
10111013

10121014
set(OLD_LIB_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
10131015
set(Boost_NO_BOOST_CMAKE ON)

0 commit comments

Comments
 (0)