cmake: fix broken pch support

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21077 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Peter Kümmel 2007-10-20 09:32:35 +00:00
parent eac9884b0e
commit 143dfdc9d3

View File

@ -56,7 +56,6 @@ if(merge OR merge_rebuild)
message(STATUS "")
message(STATUS "All *.cpp files of a project are merged into two files, disable with -Dmerge=0")
message(STATUS "")
set(disable-pch 1)
else()
set(merge 0 CACHE TYPE STRING FORCE)
set(MERGE_FILES 0 CACHE TYPE STRING FORCE)
@ -171,7 +170,10 @@ endif()
add_definitions(-DBOOST_USER_CONFIG="<config.h>")
if(MSVC AND NOT disable-pch)
if(MSVC AND NOT disable-pch AND NOT MERGE_FILES)
message("-----")
message("----- using precompiled headers, disable with -Ddisable-pch=1")
message("-----")
configure_file(${CMAKE_SOURCE_DIR}/pcheaders.h
${CMAKE_BINARY_DIR}/pcheaders.h)
configure_file(${CMAKE_SOURCE_DIR}/config.cpp.cmake
@ -192,6 +194,11 @@ if(MSVC AND NOT disable-pch)
set(CMAKE_CXX_FLAGS_MINSIZEREL
"${CMAKE_CXX_FLAGS_MINSIZEREL} /DLYX_PCH_STL /DLYX_PCH_BOOST")
else()
if(MSVC)
message("-----")
message("----- precompiled headers disabled, enable with -Ddisable-pch=0")
message("-----")
endif()
set(disable-pch TRUE CACHE TYPE STRING)
macro(lyx_add_msvc_pch)
endmacro(lyx_add_msvc_pch)