From e58a72067ba60a254fb4c9bad834e589c7f67274 Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Mon, 30 Jul 2018 14:27:11 +0200 Subject: [PATCH] link libgcc statically --- windows-snapshot-tool/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/windows-snapshot-tool/CMakeLists.txt b/windows-snapshot-tool/CMakeLists.txt index deb8c85..13616d7 100644 --- a/windows-snapshot-tool/CMakeLists.txt +++ b/windows-snapshot-tool/CMakeLists.txt @@ -7,7 +7,10 @@ set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}) set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}) add_definitions(-DUNICODE -D_UNICODE) -SET( CMAKE_EXE_LINKER_FLAGS "-mwindows" ) +SET( CMAKE_EXE_LINKER_FLAGS "-mwindows -static" ) + +add_definitions(-D _WIN32_WINNT=0x0600) # Vista +#add_definitions(-D WINVER=0x0600) find_package( GDIPLUS ) set(CMAKE_REQUIRED_DEFINITIONS -DGDIPLUS_LOWERCASE=${GDIPLUS_LOWERCASE}) @@ -19,12 +22,13 @@ set(CMAKE_REQUIRED_LIBRARIES ${GDIPLUS_LIBRARY}) add_definitions(${GDIPLUS_DEFINITIONS}) link_directories(${GDIPLUS_INCLUDE_DIR}) link_libraries(${GDIPLUS_LIBRARIES}) +#link_libraries("shcore.lib") include_directories("${PROJECT_SOURCE_DIR} ${GDIPLUS_INCLUDE_DIR}") add_executable (freeze src/main.cpp src/resource.rc) -target_link_libraries(freeze ${GDIPLUS}) +target_link_libraries(freeze ${GDIPLUS} -static-libgcc -static-libstdc++) # mkdir build && cd build # rm -r CMakeCache.txt CMakeFiles/ # cmake -DCMAKE_TOOLCHAIN_FILE=../Toolchain-cross-mingw32-linux.cmake ../