Tweak precompiled header usage in CMake project.

This commit is contained in:
Jean-Philip Desjardins 2017-03-17 21:07:22 -04:00
parent 11eb86de4a
commit a865916964
3 changed files with 27 additions and 4 deletions

1
Source/Pch.cpp Normal file
View File

@ -0,0 +1 @@
#include "Pch.h"

22
Source/Pch.h Normal file
View File

@ -0,0 +1,22 @@
#pragma once
#include <string>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <functional>
#include <memory>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <boost/signals2.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/filesystem.hpp>
#include "Types.h"
#include "Stream.h"
#include "StdStream.h"
#include "xml/Node.h"
#include "make_unique.h"

View File

@ -35,6 +35,7 @@ set(CMAKE_MODULE_PATH
${CMAKE_CURRENT_SOURCE_DIR}/../../Dependencies/cmake-modules
${CMAKE_MODULE_PATH}
)
include(PrecompiledHeader)
# flags
set(CMAKE_CXX_STANDARD 14)
@ -389,6 +390,7 @@ set(COMMON_SRC_FILES
../Source/MIPSTags.cpp
../Source/PadHandler.cpp
../Source/PadListener.cpp
../Source/Pch.cpp
../Source/PH_Generic.cpp
../Source/Profiler.cpp
../Source/PS2VM.cpp
@ -444,6 +446,7 @@ if(ANDROID)
else()
add_library(PlayCore STATIC ${COMMON_SRC_FILES} ${PLATFORM_SPECIFIC_SRC_FILES})
endif()
add_precompiled_header(PlayCore Pch.h FORCEINCLUDE SOURCE_CXX ../Source/Pch.cpp)
if(NOT ANDROID)
@ -821,10 +824,7 @@ if (WIN32)
add_executable(Play WIN32 ${WIN32_SRC} ../Source/ui_win32/Res.rc)
target_link_libraries(Play PUBLIC ${PROJECT_LIBS})
include(PrecompiledHeader)
set(pch_source ../Source/ui_win32/StdAfx.cpp)
add_precompiled_header(Play ../Source/ui_win32/StdAfx.h c++-header)
target_use_precompiled_header(Play ../Source/ui_win32/StdAfx.h c++-header FORCEINCLUDE)
add_precompiled_header(Play StdAfx.h FORCEINCLUDE SOURCE_CXX ../Source/ui_win32/StdAfx.cpp)
endif (WIN32)
enable_testing()