Disable optimizations for tests on Windows.

- Significantly improves build time.

Change-Id: Ie6ed8033622dd475ee0f4750eabf1f7236830c37
This commit is contained in:
Mrozek, Michal 2018-11-16 09:44:24 +01:00 committed by sys_ocldev
parent 2249917695
commit 4ba251ab59
1 changed files with 9 additions and 0 deletions

View File

@ -9,6 +9,15 @@ project(igdrcl_tests)
set(TEST_PROJECTS_FOLDER "opencl runtime")
set(PLATFORM_SPECIFIC_TARGETS_FOLDER "${TEST_PROJECTS_FOLDER}/test platforms")
if(WIN32)
# disable optimizations for ults on Windows
string(REPLACE "-O2" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Od")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Od")
set(CMAKE_C_FLAGS_RELEASEINTERNAL "${CMAKE_C_FLAGS_RELEASE} -Od")
set(CMAKE_CXX_FLAGS_RELEASEINTERNAL "${CMAKE_CXX_FLAGS_RELEASE} -Od")
endif()
add_custom_target(unit_tests)
add_custom_target(run_unit_tests ALL)