Merge branch 'master' of git.cs.unc.edu:pavel/FasTC

This commit is contained in:
Pavel Krajcevski 2013-11-19 15:14:14 -05:00
commit 6249a4a077
5 changed files with 20 additions and 2 deletions

2
.gitmodules vendored
View File

@ -1,3 +1,3 @@
[submodule "Windows"]
path = Windows
url = git@github.com:Mokosha/FasTC-MSVCLibs.git
url = https://github.com/Mokosha/FasTC-MSVCLibs.git

View File

@ -59,6 +59,12 @@ SET(TESTS
FOREACH(TEST ${TESTS})
SET(TEST_NAME Test_Base_${TEST})
SET(TEST_MODULE Test${TEST}.cpp)
# HACK for MSVC 2012...
IF(MSVC)
ADD_DEFINITIONS(-D_VARIADIC_MAX=10)
ENDIF()
ADD_EXECUTABLE(${TEST_NAME} ${TEST_MODULE})
TARGET_LINK_LIBRARIES(${TEST_NAME} FasTCBase)
TARGET_LINK_LIBRARIES(${TEST_NAME} gtest_main)

View File

@ -98,7 +98,7 @@ void ExtractBasename(const char *filename, char *buf, size_t bufSz) {
}
}
uint64 numChars = ext - base + 1;
size_t numChars = ext - base + 1;
size_t toCopy = ::std::min(numChars, bufSz);
memcpy(buf, base, toCopy);
buf[toCopy - 1] = '\0';

View File

@ -71,6 +71,7 @@ macro(config_compiler_and_linker)
set(cxx_exception_flags "-EHsc -D_HAS_EXCEPTIONS=1")
set(cxx_no_exception_flags "-D_HAS_EXCEPTIONS=0")
set(cxx_no_rtti_flags "-GR-")
add_definitions(-D_VARIADIC_MAX=10)
elseif (CMAKE_COMPILER_IS_GNUCXX)
set(cxx_base_flags "-Wall -Wshadow")
set(cxx_exception_flags "-fexceptions")

View File

@ -63,6 +63,12 @@ SET(TESTS
FOREACH(TEST ${TESTS})
SET(TEST_NAME Test_PVRTCEncoder_${TEST})
SET(TEST_MODULE ${TEST}Test.cpp)
# HACK for MSVC 2012...
IF(MSVC)
ADD_DEFINITIONS(-D_VARIADIC_MAX=10)
ENDIF()
ADD_EXECUTABLE(${TEST_NAME} ${TEST_MODULE})
TARGET_LINK_LIBRARIES(${TEST_NAME} PVRTCEncoder)
TARGET_LINK_LIBRARIES(${TEST_NAME} gtest_main)
@ -91,6 +97,11 @@ IF(PVRTEXLIB_FOUND)
INCLUDE_DIRECTORIES( ${PVRTEXLIB_INCLUDE_DIRS} )
INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/Core/include )
# HACK for MSVC 2012...
IF(MSVC)
ADD_DEFINITIONS(-D_VARIADIC_MAX=10)
ENDIF()
# The cpp file to compile for the test
ADD_EXECUTABLE(${TEST_NAME} DecompTestPVR.cpp)