Changed: #880 Use PCH under Linux with CMake

This commit is contained in:
kervala 2010-06-26 17:38:45 +02:00
parent f33365ea10
commit 6779fcf1b3
2 changed files with 4 additions and 16 deletions

View file

@ -32,24 +32,12 @@ SET_TARGET_PROPERTIES(nelmisc PROPERTIES
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS})
IF(WIN32)
FOREACH(FILENAME ${SRC})
IF("${FILENAME}" MATCHES "stdmisc.cpp")
SET_SOURCE_FILES_PROPERTIES(stdmisc.cpp PROPERTIES COMPILE_FLAGS "/Ycstdmisc.h")
ELSEIF("${FILENAME}" MATCHES "config_file")
# I don't really want to do anything here but you can uncomment this if you need to test.
# MESSAGE("Note: Not adding pre-compiled headers to: ${FILENAME}.")
#
ELSE("${FILENAME}" MATCHES "stdmisc.cpp")
SET_SOURCE_FILES_PROPERTIES(${FILENAME} PROPERTIES COMPILE_FLAGS "/Yustdmisc.h")
ENDIF("${FILENAME}" MATCHES "stdmisc.cpp")
ENDFOREACH (FILENAME)
SET_TARGET_PROPERTIES(nelmisc PROPERTIES
DEBUG_POSTFIX "_d"
RELEASE_POSTFIX "_r")
INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR})
ELSE(WIN32)
ADD_NATIVE_PRECOMPILED_HEADER(nelmisc ${CMAKE_CURRENT_SOURCE_DIR}/stdmisc.h ${CMAKE_CURRENT_SOURCE_DIR}/stdmisc.cpp)
ENDIF(WIN32)
ADD_NATIVE_PRECOMPILED_HEADER(nelmisc ${CMAKE_CURRENT_SOURCE_DIR}/stdmisc.h ${CMAKE_CURRENT_SOURCE_DIR}/stdmisc.cpp)
INSTALL(TARGETS nelmisc LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries)

View file

@ -64,7 +64,7 @@ std::string CCmdArgs::getArg(char argName) const
begin++;
// End
uint size = _Args[i].size();
uint size = (uint)_Args[i].size();
if(size && _Args[i][size-1] == '"')
size--;
size = (uint)(std::max((int)0, (int)size-(int)begin));