Search code examples
c++visual-studiocmakecross-platformrelease

Size of the .exe file made using CMake is too large


I was making a C++-program using Visual Studio. The size of the executable was 490 KB.

But when I make the same executable by creating CMake Project in Visual Studio, the size of the executable is 1140 KB.

Why is it so big?


Solution

  • I found that CMake was running the RelWithDebInfo build.

    set(CMAKE_BUILD_TYPE Release) solved my problem. Size of executable was reduced to 483 KB.