Use target_precompile_headers for the most expensive headers

This commit is contained in:
elsid 2022-07-01 14:05:17 +00:00 committed by jvoisin
parent 8a13cde778
commit 7e6c13630a
22 changed files with 193 additions and 14 deletions

View file

@ -498,6 +498,33 @@ if(USE_QT)
set_property(TARGET components_qt PROPERTY AUTOMOC ON)
endif(USE_QT)
if (MSVC AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.16)
target_precompile_headers(components PRIVATE ${SOL_INCLUDE_DIR}/sol/sol.hpp)
endif ()
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16 AND MSVC)
target_precompile_headers(components PUBLIC
<sol/sol.hpp>
<osg/State>
<osg/StateSet>
<osg/Node>
<osg/Drawable>
<osg/Camera>
<MyGUI_Widget.h>
<boost/filesystem.hpp>
<algorithm>
<filesystem>
<fstream>
<functional>
<memory>
<ostream>
<string>
<vector>
)
target_precompile_headers(components PRIVATE
<osgViewer/Viewer>
<boost/program_options/options_description.hpp>
)
endif()

View file

@ -4,10 +4,16 @@
#include <cstring>
#define FAR
#define NEAR
#include <shlobj.h>
#include <shlwapi.h>
#include <winreg.h>
#undef NEAR
#undef FAR
#include <boost/locale.hpp>
namespace bconv = boost::locale::conv;