We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f62e84f commit eccd060Copy full SHA for eccd060
1 file changed
src/CMakeLists.txt
@@ -14,17 +14,25 @@ endif()
14
15
set(_target_name linuxdeploy-plugin-appimage)
16
17
+include(CheckCXXCompilerFlag)
18
+check_cxx_compiler_flag(-static-libstdc++ STATIC_LIBSTDCXX_SUPPORTED)
19
+check_cxx_compiler_flag(-static-libgcc STATIC_LIBGCC_SUPPORTED)
20
+
21
# main executable
22
add_executable(${_target_name} main.cpp)
23
24
target_link_libraries(${_target_name} args)
25
26
set(_cflags
27
-static
- -static-libstdc++
- -static-libgcc
28
-flto
29
)
30
+if(STATIC_LIBSTDCXX_SUPPORTED)
31
+ list(APPEND _cflags -static-libstdc++)
32
+endif()
33
+if(STATIC_LIBGCC_SUPPORTED)
34
+ list(APPEND _cflags -static-libgcc)
35
36
target_compile_options(${_target_name} PUBLIC ${_cflags})
37
target_link_options(${_target_name} PUBLIC ${_cflags})
38
0 commit comments