Cmake format script

Related-To: NEO-1157

Change-Id: Ie1b907e838cfb9ad0d75cc8971d415f7c77103c9
Signed-off-by: Pawel Cieslak <pawel.cieslak@intel.com>
This commit is contained in:
Pawel Cieslak
2020-08-19 12:18:18 +02:00
committed by sys_ocldev
parent 2f4b132722
commit fb821f21f5
423 changed files with 5242 additions and 5079 deletions

View File

@@ -29,7 +29,6 @@ if(NOT PROJECT_NAME)
set(PROJECT_NAME igdrcl)
endif()
project(${PROJECT_NAME})
if(CMAKE_CONFIGURATION_TYPES)
@@ -60,14 +59,14 @@ message(STATUS "branch dir list: ${BRANCH_DIR_LIST}")
if(TR_DEPRECATED)
add_definitions(-D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING=1)
endif(TR_DEPRECATED)
endif()
add_definitions(-DIGC_CLEANUP)
if(RELEASE_WITH_REGKEYS)
message(STATUS "Enabling RegKey reading in release build")
add_definitions(-D_RELEASE_BUILD_WITH_REGKEYS)
endif(RELEASE_WITH_REGKEYS)
endif()
if(DEFINED NEO_EXTRA_DEFINES)
string(REPLACE "," ";" NEO_EXTRA_DEFINES "${NEO_EXTRA_DEFINES}")
@@ -194,7 +193,7 @@ if(MSVC)
string(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASEINTERNAL "${CMAKE_CXX_FLAGS_RELEASEINTERNAL}")
endif(MSVC)
endif()
if(NOT SKIP_UNIT_TESTS)
if(NOT DEFINED GTEST_REPEAT)
@@ -213,7 +212,7 @@ if(NOT KMDAF_HEADERS_DIR)
get_filename_component(KMDAF_HEADERS_DIR "../kmdaf/inc/common/" ABSOLUTE)
message(STATUS "KM-DAF headers dir: ${KMDAF_HEADERS_DIR}")
endif()
endif(NOT KMDAF_HEADERS_DIR)
endif()
if(NOT DEFINED SOURCE_LEVEL_DEBUGGER_HEADERS_DIR)
get_filename_component(SOURCE_LEVEL_DEBUGGER_HEADERS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/source_level_debugger/" ABSOLUTE)
@@ -291,7 +290,7 @@ message(STATUS "Khronos OpenGL headers dir: ${KHRONOS_GL_HEADERS_DIR}")
if(NOT THIRD_PARTY_DIR)
get_filename_component(THIRD_PARTY_DIR "../third_party/" ABSOLUTE)
endif(NOT THIRD_PARTY_DIR)
endif()
message(STATUS "Third party dir: ${THIRD_PARTY_DIR}")
if(WIN32)
@@ -300,7 +299,7 @@ if(WIN32)
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../wdk")
get_filename_component(WDK_DIR "../wdk" ABSOLUTE)
endif()
endif(NOT WDK_DIR)
endif()
if(WDK_DIR)
if(IS_DIRECTORY "${WDK_DIR}/Win15")
get_filename_component(WDK_DIR "${WDK_DIR}/Win15" ABSOLUTE)
@@ -315,7 +314,7 @@ if(WIN32)
list(LENGTH WindowsTargetPlatformVersion versionListLength)
if(NOT versionListLength EQUAL 3)
message(ERROR "Error reading content of WDKVersion.txt file")
endif(NOT versionListLength EQUAL 3)
endif()
list(GET WindowsTargetPlatformVersion 2 WindowsTargetPlatformVersion)
else()
set(WindowsTargetPlatformVersion ${WDK_VERSION})
@@ -395,7 +394,7 @@ if(NOT IGC__IGC_TARGETS)
foreach(TARGET_tmp ${NEO__IGC_TARGETS})
list(APPEND NEO__IGC_INCLUDE_DIR $<TARGET_PROPERTY:${TARGET_tmp},INTERFACE_INCLUDE_DIRECTORIES>)
list(APPEND NEO__IGC_COMPILE_DEFINITIONS $<TARGET_PROPERTY:${TARGET_tmp},INTERFACE_COMPILE_DEFINITIONS>)
endforeach(TARGET_tmp)
endforeach()
message(STATUS "IGC targets: ${NEO__IGC_TARGETS}")
else()
message(FATAL_ERROR "Intel Graphics Compiler not found!")
@@ -405,7 +404,7 @@ else()
foreach(TARGET_tmp ${NEO__IGC_TARGETS})
list(APPEND NEO__IGC_INCLUDE_DIR $<TARGET_PROPERTY:${TARGET_tmp},INTERFACE_INCLUDE_DIRECTORIES>)
list(APPEND NEO__IGC_LIBRARY_PATH $<TARGET_FILE_DIR:${TARGET_tmp}>)
endforeach(TARGET_tmp)
endforeach()
string(REPLACE ";" ":" NEO__IGC_LIBRARY_PATH "${NEO__IGC_LIBRARY_PATH}")
message(STATUS "IGC targets: ${NEO__IGC_TARGETS}")
endif()
@@ -540,7 +539,6 @@ endmacro()
link_directories(${NEO__GMM_LIBRARY_PATH})
if(NOT DISABLE_LIBVA)
# LibVA detection
if(UNIX)
@@ -596,7 +594,6 @@ if(NEO_BITS STREQUAL "64")
set(SLD_LIBRARY_NAME "${SLD_LIBRARY_NAME}${NEO_BITS}")
endif()
add_subdirectory_unique(third_party/gtest)
message(STATUS "AUB_STREAM_DIR = ${AUB_STREAM_DIR}")
@@ -759,11 +756,11 @@ else()
else()
message(WARNING "Spectre mitigation DISABLED")
endif()
endif(MSVC)
endif()
if(NOT MSVC)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth=1024")
endif(NOT MSVC)
endif()
# Compiler warning flags
if(NOT MSVC)
@@ -784,7 +781,7 @@ if(NOT MSVC)
if(NOT SANITIZE_UB_ALLOW_CONTINUE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-sanitize-recover=undefined")
endif()
endif(USE_SANITIZE_UB)
endif()
if(NOT (CMAKE_C_COMPILER_VERSION VERSION_LESS 3.6))
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs -DSANITIZER_BUILD")
endif()
@@ -911,7 +908,6 @@ macro(generate_runtime_lib LIB_NAME MOCKABLE GENERATE_EXEC)
target_compile_definitions(${BUILTINS_BINARIES_LIB_NAME} PUBLIC MOCKABLE_VIRTUAL=)
target_compile_definitions(${SCHEDULER_BINARY_LIB_NAME} PUBLIC MOCKABLE_VIRTUAL=)
if(${MOCKABLE})
target_compile_definitions(${LIB_NAME} PUBLIC MOCKABLE_VIRTUAL=virtual)
target_compile_definitions(${SHARINGS_ENABLE_LIB_NAME} PUBLIC MOCKABLE_VIRTUAL=virtual)
@@ -920,7 +916,7 @@ macro(generate_runtime_lib LIB_NAME MOCKABLE GENERATE_EXEC)
target_compile_definitions(${LIB_NAME} PUBLIC MOCKABLE_VIRTUAL=)
target_compile_definitions(${SHARINGS_ENABLE_LIB_NAME} PUBLIC MOCKABLE_VIRTUAL=)
endif()
endmacro(generate_runtime_lib)
endmacro()
set(NEO_DYNAMIC_LIB_NAME "igdrcl_dll") # single NEO dll
set(NEO_DLL_NAME_BASE "igdrcl")
@@ -964,7 +960,7 @@ endif()
set(DONT_LINK_ELF_STATICALLY TRUE)
if(EXISTS ${NEO_SOURCE_DIR}/../internal)
add_subdirectory_unique(${NEO_SOURCE_DIR}/../internal ${NEO_BUILD_DIR}/internal)
endif(EXISTS ${NEO_SOURCE_DIR}/../internal)
endif()
add_subdirectory_unique(scripts/lint)
if(EXISTS ${NEO_SOURCE_DIR}/scripts/format)

View File

@@ -84,7 +84,6 @@ macro(get_family_name_with_type gen_type platform_type)
set(family_name_with_type ${gen_type_capitalized}${platform_type_lower})
endmacro()
macro(append_sources_from_properties list_name)
foreach(name ${ARGN})
get_property(${name} GLOBAL PROPERTY ${name})

View File

@@ -414,7 +414,6 @@ if(UNIX)
endif()
endif()
if(DONT_CARE_OF_VIRTUALS)
generate_l0_lib(${L0_RELEASE_LIB_NAME} TRUE)
else()

View File

@@ -16,5 +16,6 @@ append_sources_from_properties(L0_API
L0_EXPERIMENTAL_API
L0_EXPERIMENTAL_TRACING_API
L0_SYSMAN_API
L0_TOOLS_API)
L0_TOOLS_API
)
set_property(GLOBAL PROPERTY L0_API ${L0_API})

View File

@@ -8,7 +8,8 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
set(L0_BLACK_BOX_TEST_PROJECT_FOLDER "ze_intel_gpu/black_box_tests")
set(TEST_TARGETS
zello_world
zello_timestamp)
zello_timestamp
)
foreach(TEST_NAME ${TEST_TARGETS})
add_executable(${TEST_NAME} ${TEST_NAME}.cpp)

View File

@@ -7,7 +7,6 @@
if(NOT DEFINED _os_release_info)
set(_os_release_info TRUE)
# os_release_info.cmake - Function to dump OS name and version
# This file has no dependencies on other files (e.g., functions or definitions)
@@ -16,7 +15,6 @@ set(_os_release_info TRUE)
# Set cmake policies for at least this level:
cmake_minimum_required(VERSION 3.2.0)
# Function get_os_release_info - Determine and return OS name and version
#
# Args:
@@ -68,7 +66,6 @@ cmake_minimum_required(VERSION 3.2.0)
# DISTRIB_ID=Ubuntu DISTRIB_RELEASE=14.04
# DISTRIB_ID=Ubuntu DISTRIB_RELEASE=17.10
function(get_os_release_info _vn_id _vn_version_id _vn_codename)
set(_var_id "")
set(_var_version_id "")
@@ -160,5 +157,4 @@ function(get_os_release_info _vn_id _vn_version_id _vn_codename)
endif()
endfunction()
endif(NOT DEFINED _os_release_info)
endif()

View File

@@ -11,7 +11,8 @@ list(APPEND L0_SRCS_TOOLS_METRICS
${CMAKE_CURRENT_SOURCE_DIR}/metric.cpp
${CMAKE_CURRENT_SOURCE_DIR}/metric_enumeration_imp.cpp
${CMAKE_CURRENT_SOURCE_DIR}/metric_streamer_imp.cpp
${CMAKE_CURRENT_SOURCE_DIR}/metric_query_imp.cpp)
${CMAKE_CURRENT_SOURCE_DIR}/metric_query_imp.cpp
)
if(UNIX)
add_subdirectory(linux)

View File

@@ -7,7 +7,8 @@
set(L0_SRCS_TOOLS_LINUX
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/os_metric_query_imp_linux.cpp
${CMAKE_CURRENT_SOURCE_DIR}/os_metric_enumeration_imp_linux.cpp)
${CMAKE_CURRENT_SOURCE_DIR}/os_metric_enumeration_imp_linux.cpp
)
if(UNIX)
target_sources(${L0_STATIC_LIB_NAME}

View File

@@ -7,7 +7,8 @@
set(L0_SRCS_TOOLS_WINDOWS
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/os_metric_query_imp_windows.cpp
${CMAKE_CURRENT_SOURCE_DIR}/os_metric_enumeration_imp_windows.cpp)
${CMAKE_CURRENT_SOURCE_DIR}/os_metric_enumeration_imp_windows.cpp
)
if(WIN32)
target_sources(${L0_STATIC_LIB_NAME}

View File

@@ -20,7 +20,6 @@ target_include_directories(${L0_STATIC_LIB_NAME}
)
endif()
# Make our source files visible to parent
set_property(GLOBAL PROPERTY L0_SRCS_TOOLS_WINDOWS ${L0_SRCS_TOOLS_WINDOWS})

View File

@@ -12,7 +12,6 @@ set(L0_SRCS_TOOLS_SYSMAN_ENGINE
${CMAKE_CURRENT_SOURCE_DIR}/os_engine.h
)
target_sources(${L0_STATIC_LIB_NAME}
PRIVATE
${L0_SRCS_TOOLS_SYSMAN_ENGINE}

View File

@@ -12,7 +12,8 @@ set(L0_SRCS_TOOLS_SYSMAN_ENGINE_LINUX
if(UNIX)
target_sources(${L0_STATIC_LIB_NAME}
PRIVATE
${L0_SRCS_TOOLS_SYSMAN_ENGINE_LINUX})
${L0_SRCS_TOOLS_SYSMAN_ENGINE_LINUX}
)
endif()
# Make our source files visible to parent

View File

@@ -11,7 +11,8 @@ set(L0_SRCS_TOOLS_SYSMAN_ENGINE_WINDOWS
if(WIN32)
target_sources(${L0_STATIC_LIB_NAME}
PRIVATE
${L0_SRCS_TOOLS_SYSMAN_ENGINE_WINDOWS})
${L0_SRCS_TOOLS_SYSMAN_ENGINE_WINDOWS}
)
endif()
# Make our source files visible to parent

View File

@@ -10,7 +10,8 @@ set(L0_SRCS_TOOLS_SYSMAN_LINUX
${CMAKE_CURRENT_SOURCE_DIR}/os_sysman_imp.cpp
${CMAKE_CURRENT_SOURCE_DIR}/fs_access.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pmt.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pmt.h)
${CMAKE_CURRENT_SOURCE_DIR}/pmt.h
)
if(UNIX)
target_sources(${L0_STATIC_LIB_NAME}

View File

@@ -10,11 +10,13 @@ if (PC_LIBXML_FOUND)
${CMAKE_CURRENT_SOURCE_DIR}/xml_parser_imp.h
${CMAKE_CURRENT_SOURCE_DIR}/xml2_api.h
${CMAKE_CURRENT_SOURCE_DIR}/xml2_api.cpp
${CMAKE_CURRENT_SOURCE_DIR}/xml_parser.h)
${CMAKE_CURRENT_SOURCE_DIR}/xml_parser.h
)
else()
set(L0_SRCS_TOOLS_SYSMAN_LINUX_XML_PARSER
${CMAKE_CURRENT_SOURCE_DIR}/xml_parser_stub.cpp
${CMAKE_CURRENT_SOURCE_DIR}/xml_parser.h)
${CMAKE_CURRENT_SOURCE_DIR}/xml_parser.h
)
endif()
if(UNIX)
@@ -24,6 +26,5 @@ target_sources(${L0_STATIC_LIB_NAME}
)
endif()
# Make our source files visible to parent
set_property(GLOBAL PROPERTY L0_SRCS_TOOLS_SYSMAN_XML_PARSER_LINUX ${L0_SRCS_TOOLS_SYSMAN_XML_PARSER_LINUX})

View File

@@ -12,7 +12,6 @@ set(L0_SRCS_TOOLS_SYSMAN_MEMORY
${CMAKE_CURRENT_SOURCE_DIR}/os_memory.h
)
target_sources(${L0_STATIC_LIB_NAME}
PRIVATE
${L0_SRCS_TOOLS_SYSMAN_MEMORY}

View File

@@ -21,7 +21,8 @@ endif()
if(UNIX)
target_sources(${L0_STATIC_LIB_NAME}
PRIVATE
${L0_SRCS_TOOLS_SYSMAN_MEMORY_LINUX})
${L0_SRCS_TOOLS_SYSMAN_MEMORY_LINUX}
)
endif()
# Make our source files visible to parent

View File

@@ -12,7 +12,8 @@ set(L0_SRCS_TOOLS_SYSMAN_MEMORY_WINDOWS
if(WIN32)
target_sources(${L0_STATIC_LIB_NAME}
PRIVATE
${L0_SRCS_TOOLS_SYSMAN_MEMORY_WINDOWS})
${L0_SRCS_TOOLS_SYSMAN_MEMORY_WINDOWS}
)
endif()
# Make our source files visible to parent

View File

@@ -12,7 +12,6 @@ set(L0_SRCS_TOOLS_SYSMAN_POWER
${CMAKE_CURRENT_SOURCE_DIR}/os_power.h
)
target_sources(${L0_STATIC_LIB_NAME}
PRIVATE
${L0_SRCS_TOOLS_SYSMAN_POWER}

View File

@@ -12,7 +12,8 @@ set(L0_SRCS_TOOLS_SYSMAN_POWER_LINUX
if(UNIX)
target_sources(${L0_STATIC_LIB_NAME}
PRIVATE
${L0_SRCS_TOOLS_SYSMAN_POWER_LINUX})
${L0_SRCS_TOOLS_SYSMAN_POWER_LINUX}
)
endif()
# Make our source files visible to parent

View File

@@ -13,7 +13,8 @@ set(L0_SRCS_TOOLS_SYSMAN_POWER_WINDOWS
if(WIN32)
target_sources(${L0_STATIC_LIB_NAME}
PRIVATE
${L0_SRCS_TOOLS_SYSMAN_POWER_WINDOWS})
${L0_SRCS_TOOLS_SYSMAN_POWER_WINDOWS}
)
endif()
# Make our source files visible to parent

View File

@@ -12,7 +12,6 @@ set(L0_SRCS_TOOLS_SYSMAN_RAS
${CMAKE_CURRENT_SOURCE_DIR}/os_ras.h
)
target_sources(${L0_STATIC_LIB_NAME}
PRIVATE
${L0_SRCS_TOOLS_SYSMAN_RAS}

View File

@@ -12,7 +12,8 @@ set(L0_SRCS_TOOLS_SYSMAN_RAS_LINUX
if(UNIX)
target_sources(${L0_STATIC_LIB_NAME}
PRIVATE
${L0_SRCS_TOOLS_SYSMAN_RAS_LINUX})
${L0_SRCS_TOOLS_SYSMAN_RAS_LINUX}
)
endif()
# Make our source files visible to parent

View File

@@ -11,7 +11,8 @@ set(L0_SRCS_TOOLS_SYSMAN_RAS_WINDOWS
if(WIN32)
target_sources(${L0_STATIC_LIB_NAME}
PRIVATE
${L0_SRCS_TOOLS_SYSMAN_RAS_WINDOWS})
${L0_SRCS_TOOLS_SYSMAN_RAS_WINDOWS}
)
endif()
# Make our source files visible to parent

View File

@@ -12,7 +12,6 @@ set(L0_SRCS_TOOLS_SYSMAN_SCHEDULER
${CMAKE_CURRENT_SOURCE_DIR}/os_scheduler.h
)
target_sources(${L0_STATIC_LIB_NAME}
PRIVATE
${L0_SRCS_TOOLS_SYSMAN_SCHEDULER}

View File

@@ -12,7 +12,6 @@ set(L0_SRCS_TOOLS_SYSMAN_TEMPERATURE
${CMAKE_CURRENT_SOURCE_DIR}/os_temperature.h
)
target_sources(${L0_STATIC_LIB_NAME}
PRIVATE
${L0_SRCS_TOOLS_SYSMAN_TEMPERATURE}

View File

@@ -12,7 +12,8 @@ set(L0_SRCS_TOOLS_SYSMAN_TEMPERATURE_LINUX
if(UNIX)
target_sources(${L0_STATIC_LIB_NAME}
PRIVATE
${L0_SRCS_TOOLS_SYSMAN_TEMPERATURE_LINUX})
${L0_SRCS_TOOLS_SYSMAN_TEMPERATURE_LINUX}
)
endif()
# Make our source files visible to parent

View File

@@ -13,7 +13,8 @@ set(L0_SRCS_TOOLS_SYSMAN_TEMPERATURE_WINDOWS
if(WIN32)
target_sources(${L0_STATIC_LIB_NAME}
PRIVATE
${L0_SRCS_TOOLS_SYSMAN_TEMPERATURE_WINDOWS})
${L0_SRCS_TOOLS_SYSMAN_TEMPERATURE_WINDOWS}
)
endif()
# Make our source files visible to parent

View File

@@ -10,7 +10,8 @@ set(L0_SRCS_TOOLS_SYSMAN_WINDOWS
${CMAKE_CURRENT_SOURCE_DIR}/kmd_sys.h
${CMAKE_CURRENT_SOURCE_DIR}/kmd_sys_manager.h
${CMAKE_CURRENT_SOURCE_DIR}/kmd_sys_manager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/os_sysman_imp.cpp)
${CMAKE_CURRENT_SOURCE_DIR}/os_sysman_imp.cpp
)
if(WIN32)
target_sources(${L0_STATIC_LIB_NAME}

View File

@@ -20,5 +20,6 @@ endif()
if(UNIX)
target_sources(${TARGET_NAME}
PRIVATE
${L0_TESTS_TOOLS_SYSMAN_MEMORY_LINUX})
${L0_TESTS_TOOLS_SYSMAN_MEMORY_LINUX}
)
endif()

View File

@@ -14,7 +14,7 @@ components:
infra:
branch: infra
dest_dir: infra
revision: 898b6b6c7f04451e522b8daa4ce974c8e0416009
revision: ad149c937c3fa0906793a34b6712762185e36b4d
type: git
internal:
branch: master

View File

@@ -194,7 +194,7 @@ if(${GENERATE_EXECUTABLE})
)
set_target_properties(${NEO_DYNAMIC_LIB_NAME} PROPERTIES FOLDER ${OPENCL_RUNTIME_PROJECTS_FOLDER})
create_project_source_tree_with_exports(${NEO_DYNAMIC_LIB_NAME} "${EXPORTS_FILENAME}")
endif(${GENERATE_EXECUTABLE})
endif()
create_project_source_tree(${NEO_STATIC_LIB_NAME})

View File

@@ -84,7 +84,7 @@ if(COMPILE_BUILT_INS)
foreach(SCHEDULER_TARGET ${SCHEDULER_TARGETS})
add_dependencies(${SCHEDULER_BINARY_LIB_NAME} ${SCHEDULER_TARGET})
endforeach()
endif(COMPILE_BUILT_INS)
endif()
set_target_properties(${SCHEDULER_BINARY_LIB_NAME} PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(${SCHEDULER_BINARY_LIB_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)

View File

@@ -27,7 +27,6 @@ set(RUNTIME_SRCS_SHARINGS
target_sources(${NEO_STATIC_LIB_NAME} PRIVATE ${RUNTIME_SRCS_SHARINGS})
set_property(GLOBAL PROPERTY RUNTIME_SRCS_SHARINGS ${RUNTIME_SRCS_SHARINGS})
if(WIN32)
target_include_directories(${SHARINGS_ENABLE_LIB_NAME} PRIVATE ${NEO_SOURCE_DIR}/opencl/source/os_interface/windows)
else()

View File

@@ -21,13 +21,15 @@ if(WIN32)
add_subdirectories()
set(ADDITIONAL_EXPORTS "clEnqueueMarkerWithSyncObjectINTEL"
set(ADDITIONAL_EXPORTS
"clEnqueueMarkerWithSyncObjectINTEL"
"clGetCLObjectInfoINTEL"
"clGetCLEventInfoINTEL"
"clReleaseGlSharedEventINTEL")
"clReleaseGlSharedEventINTEL"
)
foreach(EXPORT_NAME ${ADDITIONAL_EXPORTS})
set(MSVC_DEF_ADDITIONAL_EXPORTS "${MSVC_DEF_ADDITIONAL_EXPORTS}\n${EXPORT_NAME}")
endforeach(EXPORT_NAME)
endforeach()
set(MSVC_DEF_ADDITIONAL_EXPORTS "${MSVC_DEF_ADDITIONAL_EXPORTS}" PARENT_SCOPE)
endif()
set_property(GLOBAL PROPERTY RUNTIME_SRCS_SHARINGS_GL ${RUNTIME_SRCS_SHARINGS_GL})

View File

@@ -21,6 +21,6 @@ set_property(GLOBAL PROPERTY RUNTIME_SRCS_SHARINGS_VA ${RUNTIME_SRCS_SHARINGS_VA
if(NEO__LIBVA_FOUND)
target_sources(${NEO_STATIC_LIB_NAME} PRIVATE ${RUNTIME_SRCS_SHARINGS_VA})
endif(NEO__LIBVA_FOUND)
endif()
add_subdirectories()

View File

@@ -515,11 +515,13 @@ if(MSVC AND NOT DISABLE_ULT_PCH_WIN)
set_source_files_properties(${UltSources}
PROPERTIES COMPILE_FLAGS "/Yu${UltPchHeader} /FI${UltPchHeader} /Fp${UltPchBinary}"
OBJECT_DEPENDS "${UltPchBinary}")
OBJECT_DEPENDS "${UltPchBinary}"
)
set_source_files_properties(${UltPchSource}
PROPERTIES COMPILE_FLAGS "/Yc${UltPchHeader} /FI${UltPchHeader} /Fp${UltPchBinary}"
OBJECT_OUTPUTS "${UltPchBinary}")
OBJECT_OUTPUTS "${UltPchBinary}"
)
elseif(USE_ULT_PCH)
set(UltPchHeaderInBuildDir "${CMAKE_CURRENT_BINARY_DIR}/igdrcl_tests_pch.h")
set(UltPchBinaryGch "${UltPchHeaderInBuildDir}.gch")
@@ -530,7 +532,8 @@ elseif(USE_ULT_PCH)
target_include_directories(igdrcl_ult_pch PRIVATE
$<TARGET_PROPERTY:${NEO_MOCKABLE_LIB_NAME},INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:igdrcl_tests,INCLUDE_DIRECTORIES>)
$<TARGET_PROPERTY:igdrcl_tests,INCLUDE_DIRECTORIES>
)
target_compile_definitions(igdrcl_ult_pch PRIVATE $<TARGET_PROPERTY:${NEO_MOCKABLE_LIB_NAME},INTERFACE_COMPILE_DEFINITIONS>)
target_include_directories(igdrcl_tests PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
@@ -538,18 +541,21 @@ elseif(USE_ULT_PCH)
if(NOT USE_ASAN)
set_source_files_properties(${UltSources}
PROPERTIES COMPILE_FLAGS "-include ${UltPchHeaderInBuildDir} -msse4"
OBJECT_DEPENDS ${UltPchBinaryGch})
OBJECT_DEPENDS ${UltPchBinaryGch}
)
endif()
set_source_files_properties(${UltPchHeader}
PROPERTIES LANGUAGE "CXX"
COMPILE_FLAGS "-x c++-header -msse4 -gdwarf-2")
COMPILE_FLAGS "-x c++-header -msse4 -gdwarf-2"
)
add_custom_command(
OUTPUT ${UltPchBinaryGch}
COMMAND cp "${UltPchHeader}" "${UltPchHeaderInBuildDir}"
COMMAND cp "${UltPchBinary}" "${UltPchBinaryGch}"
DEPENDS ${UltPchBinary})
DEPENDS ${UltPchBinary}
)
endif()
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# !! !!

View File

@@ -57,7 +57,6 @@ if(WIN32)
add_dependencies(igdrcl_mt_tests mock_gdi igdrcl_tests)
endif()
add_dependencies(igdrcl_mt_tests test_dynamic_lib)
create_project_source_tree(igdrcl_mt_tests)

View File

@@ -6,7 +6,6 @@
project(ocloc_tests)
set(IGDRCL_SRCS_cloc
${OCLOC_DIRECTORY}/source/decoder/binary_decoder.cpp
${OCLOC_DIRECTORY}/source/decoder/binary_encoder.cpp

View File

@@ -19,4 +19,3 @@ set(IGDRCL_SRCS_performance_tests
PARENT_SCOPE
)

View File

@@ -9,4 +9,5 @@ set(IGDRCL_SRCS_perf_tests_api
"${CMAKE_CURRENT_SOURCE_DIR}/api_tests.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/api_tests.h"
"${CMAKE_CURRENT_SOURCE_DIR}/context_tests.cpp"
PARENT_SCOPE)
PARENT_SCOPE
)

View File

@@ -10,4 +10,4 @@ if(WIN32)
${CMAKE_CURRENT_SOURCE_DIR}/context_d3d_tests.cpp
)
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_sharings_d3d})
endif(WIN32)
endif()

View File

@@ -23,6 +23,6 @@ set_property(GLOBAL PROPERTY IGDRCL_SRCS_tests_sharings_va ${IGDRCL_SRCS_tests_s
if(NEO__LIBVA_FOUND)
list(APPEND IGDRCL_SRCS_tests_sharings_va ${CMAKE_CURRENT_SOURCE_DIR}/va_sharing_enable_tests.cpp)
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_sharings_va})
endif(NEO__LIBVA_FOUND)
endif()
add_subdirectories()

View File

@@ -1,5 +1,5 @@
#
# Copyright (C) 2018-2019 Intel Corporation
# Copyright (C) 2018-2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
@@ -7,7 +7,6 @@
if(NOT DEFINED _os_release_info)
set(_os_release_info TRUE)
# os_release_info.cmake - Function to dump OS name and version
# This file has no dependencies on other files (e.g., functions or definitions)
@@ -16,7 +15,6 @@ set(_os_release_info TRUE)
# Set cmake policies for at least this level:
cmake_minimum_required(VERSION 2.8.12)
# Function get_os_release_info - Determine and return OS name and version
#
# Args:
@@ -68,7 +66,6 @@ cmake_minimum_required(VERSION 2.8.12)
# DISTRIB_ID=Ubuntu DISTRIB_RELEASE=14.04
# DISTRIB_ID=Ubuntu DISTRIB_RELEASE=17.10
function(get_os_release_info _vn_id _vn_version_id _vn_codename)
set(_var_id "")
set(_var_version_id "")
@@ -160,5 +157,4 @@ function(get_os_release_info _vn_id _vn_version_id _vn_codename)
endif()
endfunction()
endif(NOT DEFINED _os_release_info)
endif()

View File

@@ -176,4 +176,4 @@ if(UNIX)
if(__HAS_PARENT)
set(NEO__COMPONENT_NAME "opencl" PARENT_SCOPE)
endif()
endif(UNIX)
endif()

View File

@@ -1,5 +1,5 @@
#
# Copyright (C) 2019 Intel Corporation
# Copyright (C) 2019-2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
#

157
scripts/format/cmake_format.py Executable file
View File

@@ -0,0 +1,157 @@
#!/usr/bin/env python3
#
# Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
import sys
import argparse
import re
def remove_end_args(line):
if line.startswith('endif('):
line = re.sub(r'endif\(.*\)', 'endif()', line)
elif line.startswith('endforeach('):
line = re.sub(r'endforeach\(.*\)', 'endforeach()', line)
elif line.startswith('endmacro('):
line = re.sub(r'endmacro\(.*\)', 'endmacro()', line)
elif line.startswith('endfunction('):
line = re.sub(r'endfunction\(.*\)', 'endfunction()', line)
return line
def remove_extra_spaces(line):
line = re.sub(r' +', ' ', line)
line = re.sub(r' *\( *', '(', line)
line = re.sub(r' *\) *', ')', line)
line = re.sub(r'\)AND\(', ') AND (', line)
line = re.sub(r'\)OR\(', ') OR (', line)
line = re.sub(r'NOT\(', 'NOT (', line)
return line
def process_line(line):
split = line.split('"')
opening_bracket_count = 0
closing_bracket_count = 0
new_line = []
is_string = False
is_first_part = True
for l in split:
if not is_string:
l = replace_tabs(l)
l = remove_extra_spaces(l)
l = remove_end_args(l)
if not is_first_part or not l.startswith('#'):
l = re.sub(r' *#', ' #', l)
opening_bracket_count += l.count('(')
closing_bracket_count += l.count(')')
new_line.append(l)
is_string = True
else:
new_line.append(l)
if not l.endswith('\\') or l.endswith('\\\\'):
is_string = False
is_first_part = False
return '"'.join(new_line), opening_bracket_count, closing_bracket_count
def replace_tabs(line):
return line.replace('\t', ' ')
def format_file(file):
indent_size = 2
indent_depth = 0
extra_indent = ''
previous_is_new_line = False
lines = None
with open(file) as fin:
lines = fin.readlines()
with open(file, 'w') as fout:
for line in lines:
indent = ''
line = line.strip()
if line.startswith('#'):
indent = ' ' * indent_size * indent_depth
fout.write(f'{indent}{extra_indent}{line}\n')
previous_is_new_line = False
continue
line, opening_bracket_count, closing_bracket_count = process_line(
line)
if line.startswith('endif('):
indent_depth -= 1
elif line.startswith('else('):
indent_depth -= 1
elif line.startswith('elseif('):
indent_depth -= 1
elif line.startswith('endforeach('):
indent_depth -= 1
elif line.startswith('endmacro('):
indent_depth -= 1
elif line.startswith('endfunction('):
indent_depth -= 1
if line:
indent = ' ' * indent_size * indent_depth
previous_is_new_line = False
else:
if not previous_is_new_line:
fout.write('\n')
previous_is_new_line = True
continue
if closing_bracket_count > opening_bracket_count:
if not line.startswith(')'):
line = line.replace(')', f'\n{indent})', 1)
line = f'{indent}{extra_indent}{line}'
indent = ''
extra_indent = ''
fout.write(f'{indent}{extra_indent}{line}\n')
if line.startswith('if('):
indent_depth += 1
elif line.startswith('else('):
indent_depth += 1
elif line.startswith('elseif('):
indent_depth += 1
elif line.startswith('foreach('):
indent_depth += 1
elif line.startswith('macro('):
indent_depth += 1
elif line.startswith('function('):
indent_depth += 1
if opening_bracket_count > closing_bracket_count:
extra_indent = ' ' * \
len(re.match(r'.*\(', line).group(0))
def _parse_args():
parser = argparse.ArgumentParser(
description='Usage: ./scripts/format/cmake_format.py <files>')
parser.add_argument('files', nargs='*')
args = parser.parse_args()
return vars(args)
def main(args):
for file in args['files']:
format_file(file)
return 0
if __name__ == '__main__':
sys.exit(main(_parse_args()))

View File

@@ -1,5 +1,5 @@
#
# Copyright (C) 2018-2019 Intel Corporation
# Copyright (C) 2018-2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
#

View File

@@ -151,7 +151,8 @@ target_include_directories(${OCLOC_NAME}_lib BEFORE PRIVATE ${CLOC_LIB_INCLUDES}
target_include_directories(${OCLOC_NAME}_lib BEFORE PRIVATE ${IGA_INCLUDE_DIR})
target_compile_definitions(${OCLOC_NAME}_lib PUBLIC ${CLOC_LIB_LIB_FLAGS_DEFINITIONS} ${SUPPORTED_GEN_FLAGS_DEFINITONS} DEFAULT_PLATFORM=${DEFAULT_SUPPORTED_PLATFORM}
IGA_LIBRARY_NAME=${CMAKE_SHARED_LIBRARY_PREFIX}${IGA_LIBRARY_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
IGA_LIBRARY_NAME=${CMAKE_SHARED_LIBRARY_PREFIX}${IGA_LIBRARY_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
)
target_compile_definitions(${OCLOC_NAME}_lib PUBLIC ${NEO__IGC_COMPILE_DEFINITIONS})
if(MSVC)
@@ -190,15 +191,18 @@ if(UNIX)
install(FILES $<TARGET_FILE:${OCLOC_NAME}>
DESTINATION ${CMAKE_INSTALL_BINDIR}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
COMPONENT ${OCLOC_NAME})
COMPONENT ${OCLOC_NAME}
)
install(FILES $<TARGET_FILE:${OCLOC_NAME}_lib>
DESTINATION ${CMAKE_INSTALL_LIBDIR}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
COMPONENT ${OCLOC_NAME})
COMPONENT ${OCLOC_NAME}
)
install(FILES ${OCLOC_DIRECTORY}/source/ocloc_api.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
COMPONENT ${OCLOC_NAME})
COMPONENT ${OCLOC_NAME}
)
endif()
set(OCLOC_OUTPUT_NAME "${OCLOC_NAME}${OCLOC_BITNESS_SUFFIX}")

View File

@@ -32,7 +32,6 @@ set(NEO_CORE_HELPERS_TESTS
set_property(GLOBAL PROPERTY NEO_CORE_HELPERS_TESTS ${NEO_CORE_HELPERS_TESTS})
add_subdirectories()
target_sources(${TARGET_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/state_base_address_tests.h
${CMAKE_CURRENT_SOURCE_DIR}/state_base_address_tests.cpp

View File

@@ -64,7 +64,7 @@ else()
set(NEO_VERSION_BUILD 0)
endif()
set(NEO_OCL_DRIVER_VERSION "${NEO_OCL_VERSION_MAJOR}.${NEO_OCL_VERSION_MINOR}.${NEO_VERSION_BUILD}")
endif(UNIX)
endif()
# Level-Zero package version
set(NEO_L0_VERSION_MAJOR 1)