forked from bartvdbraak/blender
a501668cc5
Using unit tests is a wrong way to control static behavior of the application. They should only be used for checking dynamic behavior, all the rest is easily controllable at compile time. Doing tests at ocmpile time are actually more robust approach since we don't have strict policy of runnign unit tests before accepting any change. Proper alignment control is coming shortly. This reverts commit 7c3a06c34918567e6b0ab67bded60725ff63073b.
72 lines
1.5 KiB
CMake
72 lines
1.5 KiB
CMake
if(WITH_GTESTS)
|
|
Include(GTestTesting)
|
|
|
|
# Otherwise we get warnings here that we cant fix in external projects
|
|
remove_strict_flags()
|
|
endif()
|
|
|
|
macro(CYCLES_TEST SRC EXTRA_LIBS)
|
|
if(WITH_GTESTS)
|
|
BLENDER_SRC_GTEST("cycles_${SRC}" "${SRC}_test.cpp" "${EXTRA_LIBS}")
|
|
endif()
|
|
endmacro()
|
|
|
|
set(INC
|
|
.
|
|
..
|
|
../device
|
|
../graph
|
|
../kernel
|
|
../render
|
|
../util
|
|
)
|
|
|
|
set(ALL_CYCLES_LIBRARIES
|
|
cycles_render
|
|
cycles_device
|
|
cycles_bvh
|
|
cycles_graph
|
|
cycles_subd
|
|
cycles_util
|
|
${OPENIMAGEIO_LIBRARIES}
|
|
)
|
|
if(WITH_CYCLES_OSL)
|
|
list(APPEND ALL_CYCLES_LIBRARIES
|
|
cycles_kernel_osl
|
|
${OSL_LIBRARIES}
|
|
${LLVM_LIBRARIES}
|
|
)
|
|
endif()
|
|
if(WITH_IMAGE_OPENJPEG AND NOT WITH_SYSTEM_OPENJPEG)
|
|
list(APPEND ALL_CYCLES_LIBRARIES
|
|
extern_openjpeg
|
|
)
|
|
endif()
|
|
if(WITH_CYCLES_OPENSUBDIV)
|
|
add_definitions(-DWITH_OPENSUBDIV)
|
|
include_directories(
|
|
SYSTEM
|
|
${OPENSUBDIV_INCLUDE_DIR}
|
|
)
|
|
list(APPEND ALL_CYCLES_LIBRARIES
|
|
${OPENSUBDIV_LIBRARIES}
|
|
)
|
|
endif()
|
|
list(APPEND ALL_CYCLES_LIBRARIES
|
|
${BOOST_LIBRARIES}
|
|
)
|
|
|
|
include_directories(${INC})
|
|
|
|
link_directories(${BOOST_LIBPATH})
|
|
link_directories(${OPENIMAGEIO_LIBPATH})
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
|
|
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
|
|
|
|
CYCLES_TEST(render_graph_finalize "${ALL_CYCLES_LIBRARIES}")
|
|
CYCLES_TEST(util_aligned_malloc "cycles_util")
|
|
CYCLES_TEST(util_path "cycles_util;${BOOST_LIBRARIES};${OPENIMAGEIO_LIBRARIES}")
|
|
CYCLES_TEST(util_string "cycles_util;${BOOST_LIBRARIES}")
|
|
CYCLES_TEST(util_task "cycles_util;${BOOST_LIBRARIES}")
|