Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,25 @@ endif()

set(_target_name linuxdeploy-plugin-appimage)

include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-static-libstdc++ STATIC_LIBSTDCXX_SUPPORTED)
check_cxx_compiler_flag(-static-libgcc STATIC_LIBGCC_SUPPORTED)

# main executable
add_executable(${_target_name} main.cpp)

target_link_libraries(${_target_name} args)

set(_cflags
-static
-static-libstdc++
-static-libgcc
-flto
)
if(STATIC_LIBSTDCXX_SUPPORTED)
list(APPEND _cflags -static-libstdc++)
endif()
if(STATIC_LIBGCC_SUPPORTED)
list(APPEND _cflags -static-libgcc)
endif()
target_compile_options(${_target_name} PUBLIC ${_cflags})
target_link_options(${_target_name} PUBLIC ${_cflags})

Expand Down