summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrad kittenbrink <brad@lindenlab.com>2009-11-13 20:30:54 -0500
committerbrad kittenbrink <brad@lindenlab.com>2009-11-13 20:30:54 -0500
commit67f11add9c2e05e1c86e30c44c94ee1b7d9205d0 (patch)
tree9122f8ead3df025695143234e0e198cf51e47461
parent9897e53de5adcdedbe086df38b740bf4c2d8abe7 (diff)
Added a USE_PRECOMPILED_HEADER cmake variable (defaulted on) and disabled pch usage for test executables. Reviewed by james and steve.
-rw-r--r--indra/cmake/Variables.cmake3
-rw-r--r--indra/newview/CMakeLists.txt51
2 files changed, 33 insertions, 21 deletions
diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake
index d4f9ed79de..db0b44eb8f 100644
--- a/indra/cmake/Variables.cmake
+++ b/indra/cmake/Variables.cmake
@@ -116,4 +116,7 @@ For more information, please see JIRA DEV-14943 - Cmake Linux cannot build both
")
endif (LINUX AND SERVER AND VIEWER)
+
+set(USE_PRECOMPILED_HEADERS ON CACHE BOOL "Enable use of precompiled header directives where supported.")
+
source_group("CMake Rules" FILES CMakeLists.txt)
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index c2ca366ce4..dd3fc10fa2 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -1115,22 +1115,13 @@ if (WINDOWS)
# the .pch file.
# All sources added to viewer_SOURCE_FILES
# at this point use it.
- set_source_files_properties(llviewerprecompiledheaders.cpp
- PROPERTIES
- COMPILE_FLAGS "/Ycllviewerprecompiledheaders.h"
- )
- foreach( src_file ${viewer_SOURCE_FILES} )
- set_source_files_properties(
- ${src_file}
+ if(USE_PRECOMPILED_HEADERS)
+ set_source_files_properties(llviewerprecompiledheaders.cpp
PROPERTIES
- COMPILE_FLAGS "/Yullviewerprecompiledheaders.h"
- )
- endforeach( src_file ${viewer_SOURCE_FILES} )
- list(APPEND viewer_SOURCE_FILES llviewerprecompiledheaders.cpp)
- # llstartup.cpp needs special symbols for audio libraries, so it resets
- # COMPILE_FLAGS below. Make sure it maintains precompiled header settings.
- set(LLSTARTUP_COMPILE_FLAGS
- "${LLSTARTUP_COMPILE_FLAGS} /Yullviewerprecompiledheaders.h")
+ COMPILE_FLAGS "/Ycllviewerprecompiledheaders.h"
+ )
+ set(viewer_SOURCE_FILES "${viewer_SOURCE_FILES}" llviewerprecompiledheaders.cpp)
+ endif(USE_PRECOMPILED_HEADERS)
# Add resource files to the project.
# viewerRes.rc is the only buildable file, but
@@ -1382,6 +1373,13 @@ if (WINDOWS)
LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO"
LINK_FLAGS_RELEASE ${release_flags}
)
+ if(USE_PRECOMPILED_HEADERS)
+ set_target_properties(
+ ${VIEWER_BINARY_NAME}
+ PROPERTIES
+ COMPILE_FLAGS "/Yullviewerprecompiledheaders.h"
+ )
+ endif(USE_PRECOMPILED_HEADERS)
# sets the 'working directory' for debugging from visual studio.
if (NOT UNATTENDED)
@@ -1668,15 +1666,26 @@ if (LL_TESTS)
llviewerhelputil.cpp
lllogininstance.cpp
)
- set_source_files_properties(
- ${viewer_TEST_SOURCE_FILES}
- PROPERTIES
- LL_TEST_ADDITIONAL_SOURCE_FILES llviewerprecompiledheaders.cpp
- )
+ ##################################################
+ # DISABLING PRECOMPILED HEADERS USAGE FOR TESTS
+ ##################################################
+ # if(USE_PRECOMPILED_HEADERS)
+ # set_source_files_properties(
+ # ${viewer_TEST_SOURCE_FILES}
+ # PROPERTIES
+ # LL_TEST_ADDITIONAL_SOURCE_FILES llviewerprecompiledheaders.cpp
+ # )
+ # endif(USE_PRECOMPILED_HEADERS)
LL_ADD_PROJECT_UNIT_TESTS(${VIEWER_BINARY_NAME} "${viewer_TEST_SOURCE_FILES}")
#set(TEST_DEBUG on)
- set(test_sources llcapabilitylistener.cpp llviewerprecompiledheaders.cpp)
+ set(test_sources llcapabilitylistener.cpp)
+ ##################################################
+ # DISABLING PRECOMPILED HEADERS USAGE FOR TESTS
+ ##################################################
+ # if(USE_PRECOMPILED_HEADERS)
+ # set(test_sources "${test_sources}" llviewerprecompiledheaders.cpp)
+ # endif(USE_PRECOMPILED_HEADERS)
set(test_libs
${LLMESSAGE_LIBRARIES}
${WINDOWS_LIBRARIES}