Skip to content
Snippets Groups Projects
Commit 67f11add authored by brad kittenbrink's avatar brad kittenbrink
Browse files

Added a USE_PRECOMPILED_HEADER cmake variable (defaulted on) and disabled pch...

Added a USE_PRECOMPILED_HEADER cmake variable (defaulted on) and disabled pch usage for test executables.  Reviewed by james and steve.
parent 9897e53d
No related branches found
No related tags found
No related merge requests found
...@@ -116,4 +116,7 @@ For more information, please see JIRA DEV-14943 - Cmake Linux cannot build both ...@@ -116,4 +116,7 @@ For more information, please see JIRA DEV-14943 - Cmake Linux cannot build both
") ")
endif (LINUX AND SERVER AND VIEWER) 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) source_group("CMake Rules" FILES CMakeLists.txt)
...@@ -1115,22 +1115,13 @@ if (WINDOWS) ...@@ -1115,22 +1115,13 @@ if (WINDOWS)
# the .pch file. # the .pch file.
# All sources added to viewer_SOURCE_FILES # All sources added to viewer_SOURCE_FILES
# at this point use it. # at this point use it.
set_source_files_properties(llviewerprecompiledheaders.cpp if(USE_PRECOMPILED_HEADERS)
PROPERTIES set_source_files_properties(llviewerprecompiledheaders.cpp
COMPILE_FLAGS "/Ycllviewerprecompiledheaders.h"
)
foreach( src_file ${viewer_SOURCE_FILES} )
set_source_files_properties(
${src_file}
PROPERTIES PROPERTIES
COMPILE_FLAGS "/Yullviewerprecompiledheaders.h" COMPILE_FLAGS "/Ycllviewerprecompiledheaders.h"
) )
endforeach( src_file ${viewer_SOURCE_FILES} ) set(viewer_SOURCE_FILES "${viewer_SOURCE_FILES}" llviewerprecompiledheaders.cpp)
list(APPEND viewer_SOURCE_FILES llviewerprecompiledheaders.cpp) endif(USE_PRECOMPILED_HEADERS)
# 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")
# Add resource files to the project. # Add resource files to the project.
# viewerRes.rc is the only buildable file, but # viewerRes.rc is the only buildable file, but
...@@ -1382,6 +1373,13 @@ if (WINDOWS) ...@@ -1382,6 +1373,13 @@ if (WINDOWS)
LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO" LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO"
LINK_FLAGS_RELEASE ${release_flags} 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. # sets the 'working directory' for debugging from visual studio.
if (NOT UNATTENDED) if (NOT UNATTENDED)
...@@ -1668,15 +1666,26 @@ if (LL_TESTS) ...@@ -1668,15 +1666,26 @@ if (LL_TESTS)
llviewerhelputil.cpp llviewerhelputil.cpp
lllogininstance.cpp lllogininstance.cpp
) )
set_source_files_properties( ##################################################
${viewer_TEST_SOURCE_FILES} # DISABLING PRECOMPILED HEADERS USAGE FOR TESTS
PROPERTIES ##################################################
LL_TEST_ADDITIONAL_SOURCE_FILES llviewerprecompiledheaders.cpp # 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}") LL_ADD_PROJECT_UNIT_TESTS(${VIEWER_BINARY_NAME} "${viewer_TEST_SOURCE_FILES}")
#set(TEST_DEBUG on) #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 set(test_libs
${LLMESSAGE_LIBRARIES} ${LLMESSAGE_LIBRARIES}
${WINDOWS_LIBRARIES} ${WINDOWS_LIBRARIES}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment