Browse Source

link libgcc statically

main
Hendrik Langer 6 years ago
parent
commit
e58a72067b
  1. 8
      windows-snapshot-tool/CMakeLists.txt

8
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 ../

Loading…
Cancel
Save