Use configure_file for NEO_DRIVER_VERSION instead of source file property

Change-Id: I76888a7eb2a2c6e228306b5c740c55c6abff93da
This commit is contained in:
Dunajski, Bartosz
2018-04-26 10:08:31 +02:00
committed by sys_ocldev
parent f2126b0dff
commit d71b46bdae
6 changed files with 46 additions and 20 deletions

View File

@ -548,3 +548,4 @@ include(package.cmake)
configure_file(config.h.in ${IGDRCL_BUILD_DIR}/config.h)
configure_file(compiler.config.h.in ${IGDRCL_BUILD_DIR}/compiler.config.h)
configure_file(driver_version.h.in driver_version.h) # Put Driver version into define

28
driver_version.h.in Normal file
View File

@ -0,0 +1,28 @@
/*
* Copyright (c) 2018, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef DRIVER_VERSION_H
#define DRIVER_VERSION_H
#cmakedefine NEO_DRIVER_VERSION ${NEO_DRIVER_VERSION}
#endif /* DRIVER_VERSION_H */

View File

@ -55,11 +55,6 @@ else()
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/command_queue/local_id_gen_sse4.cpp PROPERTIES COMPILE_FLAGS -msse4.2)
endif()
# Put Driver version into define
if(NEO_DRIVER_VERSION)
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/device/device_caps.cpp PROPERTIES COMPILE_DEFINITIONS "NEO_DRIVER_VERSION=${NEO_DRIVER_VERSION}")
endif()
if(WIN32)
if("${IGDRCL_OPTION__BITS}" STREQUAL "32" )
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")

View File

@ -21,17 +21,20 @@
*/
#include "runtime/command_stream/command_stream_receiver.h"
#include <algorithm>
#include "runtime/device/device.h"
#include "runtime/device/driver_info.h"
#include "runtime/helpers/basic_math.h"
#include "runtime/helpers/hw_helper.h"
#include "runtime/helpers/options.h"
#include "runtime/memory_manager/memory_manager.h"
#include "runtime/sharings/sharing_factory.h"
#include "runtime/device/driver_info.h"
#include "CL/cl_ext_intel.h"
#include "runtime/os_interface/os_interface.h"
#include "runtime/platform/extensions.h"
#include "runtime/sharings/sharing_factory.h"
#include "CL/cl_ext_intel.h"
#include "driver_version.h"
#include <algorithm>
namespace OCLRT {
extern const char *familyName[];

View File

@ -97,10 +97,6 @@ if(NOT MSVC)
set_source_files_properties(helpers/uint16_sse4_tests.cpp PROPERTIES COMPILE_FLAGS -msse4.2)
endif()
if(NEO_DRIVER_VERSION)
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/device/device_caps_tests.cpp PROPERTIES COMPILE_DEFINITIONS "NEO_DRIVER_VERSION=${NEO_DRIVER_VERSION}")
endif()
target_link_libraries(igdrcl_tests ${NEO_MOCKABLE_LIB_NAME})
target_link_libraries(igdrcl_tests igdrcl_mocks)

View File

@ -21,21 +21,24 @@
*/
#include "runtime/command_stream/command_stream_receiver.h"
#include "runtime/device/driver_info.h"
#include "runtime/helpers/basic_math.h"
#include "runtime/helpers/hw_info.h"
#include "runtime/os_interface/debug_settings_manager.h"
#include "runtime/os_interface/32bit_memory.h"
#include "runtime/memory_manager/os_agnostic_memory_manager.h"
#include "runtime/device/driver_info.h"
#include "hw_cmds.h"
#include "runtime/helpers/options.h"
#include "runtime/memory_manager/os_agnostic_memory_manager.h"
#include "runtime/os_interface/32bit_memory.h"
#include "runtime/os_interface/debug_settings_manager.h"
#include "runtime/os_interface/os_interface.h"
#include "unit_tests/fixtures/device_fixture.h"
#include "unit_tests/helpers/debug_manager_state_restore.h"
#include "unit_tests/mocks/mock_builtins.h"
#include "hw_cmds.h"
#include "test.h"
#include "gmock/gmock.h"
#include "driver_version.h"
#include <memory>
#include "runtime/os_interface/os_interface.h"
namespace OCLRT {
extern const char *familyName[];