2

I am using abseil-cpp in my C++ project built under Visual Studio 2019 / Windows 10.

Using CMake (not Visual Studio built-in makefile support) and following the static binaries instructions I have built a set of libraries and header files which I can then successfully link into a standard Visual Studio solution.

The issue I have is that the library builds with a build type of Debug, which means that I cannot link them into a Release build of my application.

What I need is to build a Release version of the abseil-cpp libraries. However the for the life of me I cannot figure out how to coax CMake / Abseil build process to do this!

I have tried the following, all of which are either ignored or error:

  • Add set(CMAKE_BUILD_TYPE Release) to the CMakeLists.txt file in the root of the abseil-cpp source tree
  • Add -DCMAKE_BUILD_TYPE=Release to the cmake .. -DCMAKE_INSTALL_PREFIX=~/Source/CMakeProject/install step given in the instructions
  • Add -DCMAKE_BUILD_TYPE=Release to the cmake --build . --target install step given in the instructions

Can anyone suggest what I need to do to build a Release version of static binary libraries?

Ian

Ian Ash
  • 1,087
  • 11
  • 23
  • 1
    Have you tried what it suggested [here](https://stackoverflow.com/a/20423820/3987854)? – Kevin Jun 13 '20 at 12:51
  • Yes that did it, thank you! I now have VS puking with an internal link error, so on to the next issue :) – Ian Ash Jun 13 '20 at 13:36

0 Answers0