What is the CMake equivalent to “gcc -fvisibility=hidden” when controlling the exported symbol of a shared library?
Instead of setting compiler flags directly, you should be using a current CMake version and the <LANG>_VISIBILITY_PRESET properties instead. This way you can avoid compiler specifics in your CMakeLists and improve cross platform applicability (avoiding errors such as supporting GCC and not Clang). I.e., if you are using C++ you would either call set(CMAKE_CXX_VISIBILITY_PRESET hidden) … Read more