Changed: #880 Use PCH under Linux with CMake

This commit is contained in:
kervala 2010-06-26 17:38:45 +02:00
parent 05b81e9f30
commit 8144bb8696
2 changed files with 4 additions and 16 deletions

View file

@ -24,7 +24,7 @@ ENDIF(JPEG_FOUND)
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${PNG_INCLUDE_DIR} config_file) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${PNG_INCLUDE_DIR} config_file)
TARGET_LINK_LIBRARIES(nelmisc ${LIBXML2_LIBRARIES} ${PNG_LIBRARIES} ${WINSOCK2_LIB}) TARGET_LINK_LIBRARIES(nelmisc ${LIBXML2_LIBRARIES} ${PNG_LIBRARIES} ${WINSOCK2_LIB})
SET_TARGET_PROPERTIES(nelmisc PROPERTIES SET_TARGET_PROPERTIES(nelmisc PROPERTIES
VERSION ${NL_VERSION} VERSION ${NL_VERSION}
SOVERSION ${NL_VERSION_MAJOR} SOVERSION ${NL_VERSION_MAJOR}
PROJECT_LABEL "Library: NeL Misc") PROJECT_LABEL "Library: NeL Misc")
@ -32,24 +32,12 @@ SET_TARGET_PROPERTIES(nelmisc PROPERTIES
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS})
IF(WIN32) 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 SET_TARGET_PROPERTIES(nelmisc PROPERTIES
DEBUG_POSTFIX "_d" DEBUG_POSTFIX "_d"
RELEASE_POSTFIX "_r") RELEASE_POSTFIX "_r")
INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) 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) 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) 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++; begin++;
// End // End
uint size = _Args[i].size(); uint size = (uint)_Args[i].size();
if(size && _Args[i][size-1] == '"') if(size && _Args[i][size-1] == '"')
size--; size--;
size = (uint)(std::max((int)0, (int)size-(int)begin)); size = (uint)(std::max((int)0, (int)size-(int)begin));