2017-12-21 07:45:38 +08:00
|
|
|
#
|
2022-01-12 23:27:20 +08:00
|
|
|
# Copyright (C) 2020-2022 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
#
|
2018-09-18 15:11:08 +08:00
|
|
|
# SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
#
|
|
|
|
|
2020-04-28 17:18:59 +08:00
|
|
|
project(${OCLOC_NAME}_lib)
|
|
|
|
|
|
|
|
set(OCLOC_NAME "ocloc")
|
|
|
|
set(OCLOC_FOLDER_NAME "offline_compiler")
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2020-02-07 21:06:50 +08:00
|
|
|
set(CLOC_LIB_SRCS_LIB
|
2020-08-19 18:18:18 +08:00
|
|
|
${NEO_SHARED_DIRECTORY}/compiler_interface/compiler_options/compiler_options_base.cpp
|
|
|
|
${NEO_SHARED_DIRECTORY}/compiler_interface/create_main.cpp
|
|
|
|
${NEO_SHARED_DIRECTORY}/device_binary_format/ar/ar.h
|
|
|
|
${NEO_SHARED_DIRECTORY}/device_binary_format/ar/ar_decoder.cpp
|
|
|
|
${NEO_SHARED_DIRECTORY}/device_binary_format/ar/ar_decoder.h
|
|
|
|
${NEO_SHARED_DIRECTORY}/device_binary_format/ar/ar_encoder.cpp
|
|
|
|
${NEO_SHARED_DIRECTORY}/device_binary_format/ar/ar_encoder.h
|
|
|
|
${NEO_SHARED_DIRECTORY}/device_binary_format/elf/elf.h
|
|
|
|
${NEO_SHARED_DIRECTORY}/device_binary_format/elf/elf_decoder.cpp
|
|
|
|
${NEO_SHARED_DIRECTORY}/device_binary_format/elf/elf_decoder.h
|
|
|
|
${NEO_SHARED_DIRECTORY}/device_binary_format/elf/elf_encoder.cpp
|
|
|
|
${NEO_SHARED_DIRECTORY}/device_binary_format/elf/elf_encoder.h
|
|
|
|
${NEO_SHARED_DIRECTORY}/device_binary_format/elf/ocl_elf.h
|
2021-09-13 21:28:11 +08:00
|
|
|
${NEO_SHARED_DIRECTORY}/dll/devices${BRANCH_DIR_SUFFIX}devices.inl
|
|
|
|
${NEO_SHARED_DIRECTORY}/dll/devices${BRANCH_DIR_SUFFIX}devices_additional.inl
|
2021-03-16 00:01:04 +08:00
|
|
|
${NEO_SHARED_DIRECTORY}/dll/devices/devices_base.inl
|
2021-08-28 04:32:03 +08:00
|
|
|
${NEO_SHARED_DIRECTORY}/dll/devices${BRANCH_DIR_SUFFIX}/product_config.inl
|
|
|
|
${NEO_SHARED_DIRECTORY}/dll/devices/product_config_base.inl
|
|
|
|
${NEO_SHARED_DIRECTORY}/dll/devices${BRANCH_DIR_SUFFIX}platforms.h
|
2020-08-19 18:18:18 +08:00
|
|
|
${NEO_SHARED_DIRECTORY}/helpers/abort.cpp
|
2021-10-05 21:14:08 +08:00
|
|
|
${NEO_SHARED_DIRECTORY}/helpers/compiler_hw_info_config.h
|
|
|
|
${NEO_SHARED_DIRECTORY}/helpers/compiler_hw_info_config.cpp
|
2021-10-26 23:25:20 +08:00
|
|
|
${NEO_SHARED_DIRECTORY}/helpers/compiler_hw_info_config_base.inl
|
2021-10-05 21:14:08 +08:00
|
|
|
${NEO_SHARED_DIRECTORY}/helpers/compiler_hw_info_config_bdw_and_later.inl
|
2020-09-26 21:34:32 +08:00
|
|
|
${NEO_SHARED_DIRECTORY}/helpers/compiler_options_parser.cpp
|
|
|
|
${NEO_SHARED_DIRECTORY}/helpers/compiler_options_parser.h
|
2020-08-19 18:18:18 +08:00
|
|
|
${NEO_SHARED_DIRECTORY}/helpers/debug_helpers.cpp
|
|
|
|
${NEO_SHARED_DIRECTORY}/helpers/file_io.cpp
|
|
|
|
${NEO_SHARED_DIRECTORY}/helpers/hw_info.cpp
|
|
|
|
${NEO_SHARED_DIRECTORY}/helpers/hw_info.h
|
2022-02-18 17:11:36 +08:00
|
|
|
${NEO_SHARED_DIRECTORY}/helpers${BRANCH_DIR_SUFFIX}hw_info_extended.cpp
|
2021-09-13 21:28:11 +08:00
|
|
|
${NEO_SHARED_DIRECTORY}/kernel${BRANCH_DIR_SUFFIX}kernel_descriptor.cpp
|
|
|
|
${NEO_SHARED_DIRECTORY}/kernel${BRANCH_DIR_SUFFIX}kernel_descriptor.h
|
2020-08-19 18:18:18 +08:00
|
|
|
${NEO_SHARED_DIRECTORY}/os_interface/os_library.h
|
2021-11-04 23:39:09 +08:00
|
|
|
${NEO_SHARED_DIRECTORY}/compiler_interface/oclc_extensions.cpp
|
|
|
|
${NEO_SHARED_DIRECTORY}/compiler_interface/oclc_extensions.h
|
2020-08-19 18:18:18 +08:00
|
|
|
${OCLOC_DIRECTORY}/source/decoder/binary_decoder.cpp
|
|
|
|
${OCLOC_DIRECTORY}/source/decoder/binary_decoder.h
|
|
|
|
${OCLOC_DIRECTORY}/source/decoder/binary_encoder.cpp
|
|
|
|
${OCLOC_DIRECTORY}/source/decoder/binary_encoder.h
|
|
|
|
${OCLOC_DIRECTORY}/source/decoder/helper.cpp
|
|
|
|
${OCLOC_DIRECTORY}/source/decoder/helper.h
|
|
|
|
${OCLOC_DIRECTORY}/source/decoder/iga_wrapper.h
|
|
|
|
${OCLOC_DIRECTORY}/source/decoder/translate_platform_base.h
|
|
|
|
${OCLOC_DIRECTORY}/source/multi_command.cpp
|
|
|
|
${OCLOC_DIRECTORY}/source/multi_command.h
|
|
|
|
${OCLOC_DIRECTORY}/source/ocloc_api.cpp
|
|
|
|
${OCLOC_DIRECTORY}/source/ocloc_api.h
|
|
|
|
${OCLOC_DIRECTORY}/source/ocloc_arg_helper.cpp
|
|
|
|
${OCLOC_DIRECTORY}/source/ocloc_arg_helper.h
|
2022-01-12 23:27:20 +08:00
|
|
|
${OCLOC_DIRECTORY}/source/ocloc_error_code.h
|
2020-08-19 18:18:18 +08:00
|
|
|
${OCLOC_DIRECTORY}/source/ocloc_fatbinary.cpp
|
|
|
|
${OCLOC_DIRECTORY}/source/ocloc_fatbinary.h
|
|
|
|
${OCLOC_DIRECTORY}/source/ocloc_validator.cpp
|
|
|
|
${OCLOC_DIRECTORY}/source/ocloc_validator.h
|
|
|
|
${OCLOC_DIRECTORY}/source/offline_compiler.cpp
|
|
|
|
${OCLOC_DIRECTORY}/source/offline_compiler.h
|
|
|
|
${OCLOC_DIRECTORY}/source/offline_compiler_helper.cpp
|
|
|
|
${OCLOC_DIRECTORY}/source/offline_compiler_options.cpp
|
2022-01-12 23:27:20 +08:00
|
|
|
${OCLOC_DIRECTORY}/source/offline_linker.cpp
|
|
|
|
${OCLOC_DIRECTORY}/source/offline_linker.h
|
2021-08-05 20:50:37 +08:00
|
|
|
${OCLOC_DIRECTORY}/source/queries.h
|
2021-03-12 01:22:38 +08:00
|
|
|
${OCLOC_DIRECTORY}/source/utilities/get_git_version_info.h
|
|
|
|
${OCLOC_DIRECTORY}/source/utilities/get_git_version_info.cpp
|
2020-08-19 18:18:18 +08:00
|
|
|
${NEO_SOURCE_DIR}/shared/source/device_binary_format/device_binary_format_zebin.cpp
|
|
|
|
${NEO_SOURCE_DIR}/shared/source/device_binary_format/zebin_decoder.cpp
|
|
|
|
${NEO_SOURCE_DIR}/shared/source/device_binary_format/yaml/yaml_parser.cpp
|
2017-12-21 07:45:38 +08:00
|
|
|
)
|
|
|
|
|
2019-06-27 03:19:34 +08:00
|
|
|
if(${IGA_HEADERS_AVAILABLE})
|
2020-02-07 21:06:50 +08:00
|
|
|
set(CLOC_LIB_SRCS_LIB ${CLOC_LIB_SRCS_LIB}
|
2020-08-19 18:18:18 +08:00
|
|
|
${OCLOC_DIRECTORY}/source/decoder/iga_wrapper.cpp
|
2021-09-13 21:28:11 +08:00
|
|
|
${OCLOC_DIRECTORY}/source/decoder${BRANCH_DIR_SUFFIX}translate_platform.cpp
|
2019-06-27 03:19:34 +08:00
|
|
|
)
|
|
|
|
else()
|
2020-02-07 21:06:50 +08:00
|
|
|
set(CLOC_LIB_SRCS_LIB ${CLOC_LIB_SRCS_LIB}
|
2020-08-19 18:18:18 +08:00
|
|
|
${OCLOC_DIRECTORY}/source/decoder/iga_stubs.cpp
|
2019-06-27 03:19:34 +08:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2018-03-08 18:42:23 +08:00
|
|
|
if(WIN32)
|
2020-02-07 21:06:50 +08:00
|
|
|
list(APPEND CLOC_LIB_SRCS_LIB
|
2021-10-23 02:54:54 +08:00
|
|
|
${NEO_SHARED_DIRECTORY}/dll/windows/options_windows.cpp
|
2020-08-19 18:18:18 +08:00
|
|
|
${NEO_SHARED_DIRECTORY}/os_interface/windows/os_library_win.cpp
|
|
|
|
${NEO_SHARED_DIRECTORY}/os_interface/windows/os_library_win.h
|
2017-12-21 07:45:38 +08:00
|
|
|
)
|
2018-03-08 18:42:23 +08:00
|
|
|
else()
|
2020-02-07 21:06:50 +08:00
|
|
|
list(APPEND CLOC_LIB_SRCS_LIB
|
2021-10-23 02:54:54 +08:00
|
|
|
${NEO_SHARED_DIRECTORY}/dll/linux/options_linux.cpp
|
2020-08-19 18:18:18 +08:00
|
|
|
${NEO_SHARED_DIRECTORY}/os_interface/linux/os_library_linux.cpp
|
|
|
|
${NEO_SHARED_DIRECTORY}/os_interface/linux/os_library_linux.h
|
2021-02-23 21:03:54 +08:00
|
|
|
${NEO_SHARED_DIRECTORY}/os_interface/linux/sys_calls_linux.cpp
|
|
|
|
${OCLOC_DIRECTORY}/source/linux/os_library_ocloc_helper.cpp
|
2017-12-21 07:45:38 +08:00
|
|
|
)
|
2018-03-08 18:42:23 +08:00
|
|
|
endif()
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2020-02-11 15:33:07 +08:00
|
|
|
string(REPLACE ";" "," ALL_SUPPORTED_PRODUCT_FAMILIES "${ALL_SUPPORTED_PRODUCT_FAMILY}")
|
|
|
|
|
2020-02-07 21:06:50 +08:00
|
|
|
set(CLOC_LIB_LIB_FLAGS_DEFINITIONS
|
2020-08-19 18:18:18 +08:00
|
|
|
-DCIF_HEADERS_ONLY_BUILD
|
|
|
|
-DALL_SUPPORTED_PRODUCT_FAMILIES=${ALL_SUPPORTED_PRODUCT_FAMILIES}
|
2017-12-21 07:45:38 +08:00
|
|
|
)
|
|
|
|
|
2021-11-24 17:38:00 +08:00
|
|
|
set(NEO_SHARED_COREX_CPP_FILES
|
2020-08-19 18:18:18 +08:00
|
|
|
hw_info
|
2017-12-21 07:45:38 +08:00
|
|
|
)
|
|
|
|
|
2018-03-22 18:35:24 +08:00
|
|
|
macro(macro_for_each_platform)
|
2020-06-17 17:14:00 +08:00
|
|
|
foreach(BRANCH_DIR ${BRANCH_DIR_LIST})
|
2020-12-19 00:25:12 +08:00
|
|
|
foreach(BRANCH ${BRANCH_DIR_LIST})
|
2021-11-24 17:38:00 +08:00
|
|
|
foreach(SRC_FILE ${NEO_SOURCE_DIR}/shared/source${BRANCH}${CORE_TYPE_LOWER}/definitions${BRANCH_DIR_SUFFIX}hw_info_setup_${PLATFORM_IT_LOWER}.inl
|
|
|
|
${NEO_SOURCE_DIR}/shared/source${BRANCH}${CORE_TYPE_LOWER}${BRANCH_DIR}hw_info_${PLATFORM_IT_LOWER}.cpp
|
|
|
|
${NEO_SOURCE_DIR}/shared/source${BRANCH}${CORE_TYPE_LOWER}/compiler_hw_info_config_${PLATFORM_IT_LOWER}.inl
|
2021-07-28 22:45:43 +08:00
|
|
|
)
|
|
|
|
if(EXISTS ${SRC_FILE})
|
|
|
|
list(APPEND CLOC_LIB_SRCS_LIB ${SRC_FILE})
|
|
|
|
endif()
|
|
|
|
endforeach()
|
2021-11-17 19:26:26 +08:00
|
|
|
|
|
|
|
if(WIN32)
|
2021-11-24 17:38:00 +08:00
|
|
|
set(SRC_FILE ${NEO_SOURCE_DIR}/shared/source${BRANCH}${CORE_TYPE_LOWER}${BRANCH_DIR}windows/hw_info_extra_${PLATFORM_IT_LOWER}.cpp)
|
2021-11-17 19:26:26 +08:00
|
|
|
if(EXISTS ${SRC_FILE})
|
|
|
|
list(APPEND CLOC_LIB_SRCS_LIB ${SRC_FILE})
|
|
|
|
endif()
|
|
|
|
else()
|
2021-11-24 17:38:00 +08:00
|
|
|
set(SRC_FILE ${NEO_SOURCE_DIR}/shared/source${BRANCH}${CORE_TYPE_LOWER}${BRANCH_DIR}linux/hw_info_extra_${PLATFORM_IT_LOWER}.cpp)
|
2021-11-17 19:26:26 +08:00
|
|
|
if(EXISTS ${SRC_FILE})
|
|
|
|
list(APPEND CLOC_LIB_SRCS_LIB ${SRC_FILE})
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2020-12-19 00:25:12 +08:00
|
|
|
endforeach()
|
2020-06-17 17:14:00 +08:00
|
|
|
endforeach()
|
2018-03-22 18:35:24 +08:00
|
|
|
endmacro()
|
|
|
|
|
2021-11-24 17:38:00 +08:00
|
|
|
macro(macro_for_each_core_type)
|
|
|
|
foreach(SRC_IT ${NEO_SHARED_COREX_CPP_FILES})
|
2020-06-17 17:14:00 +08:00
|
|
|
foreach(BRANCH_DIR ${BRANCH_DIR_LIST})
|
2020-12-19 00:25:12 +08:00
|
|
|
foreach(BRANCH ${BRANCH_DIR_LIST})
|
2021-11-24 17:38:00 +08:00
|
|
|
set(SRC_FILE ${NEO_SOURCE_DIR}/shared/source${BRANCH}${CORE_TYPE_LOWER}${BRANCH_DIR}${SRC_IT})
|
|
|
|
if(EXISTS ${SRC_FILE}_${CORE_TYPE_LOWER}.cpp)
|
|
|
|
list(APPEND CLOC_LIB_SRCS_LIB ${SRC_FILE}_${CORE_TYPE_LOWER}.cpp)
|
2020-12-19 00:25:12 +08:00
|
|
|
endif()
|
|
|
|
endforeach()
|
2020-06-17 17:14:00 +08:00
|
|
|
endforeach()
|
2018-03-22 18:35:24 +08:00
|
|
|
endforeach()
|
|
|
|
apply_macro_for_each_platform()
|
|
|
|
endmacro()
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2021-11-24 17:38:00 +08:00
|
|
|
apply_macro_for_each_core_type("SUPPORTED")
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2020-02-07 21:06:50 +08:00
|
|
|
set(CLOC_LIB_SRCS
|
2020-08-19 18:18:18 +08:00
|
|
|
${CLOC_LIB_SRCS_LIB}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
2017-12-21 07:45:38 +08:00
|
|
|
)
|
2020-04-28 17:18:59 +08:00
|
|
|
add_library(${OCLOC_NAME}_lib SHARED ${CLOC_LIB_SRCS})
|
2020-02-27 20:08:22 +08:00
|
|
|
|
2018-06-22 23:38:00 +08:00
|
|
|
add_subdirectories()
|
|
|
|
|
2020-04-28 17:18:59 +08:00
|
|
|
create_project_source_tree(${OCLOC_NAME}_lib)
|
|
|
|
set_target_properties(${OCLOC_NAME}_lib PROPERTIES FOLDER ${OCLOC_FOLDER_NAME})
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2020-02-07 21:06:50 +08:00
|
|
|
set(CLOC_LIB_INCLUDES
|
2020-08-19 18:18:18 +08:00
|
|
|
${ENGINE_NODE_DIR}
|
|
|
|
${IGC_OCL_ADAPTOR_DIR}
|
|
|
|
${CIF_BASE_DIR}
|
|
|
|
${NEO__GMM_INCLUDE_DIR}
|
|
|
|
${KHRONOS_HEADERS_DIR}
|
|
|
|
${NEO__IGC_INCLUDE_DIR}
|
2017-12-21 07:45:38 +08:00
|
|
|
)
|
|
|
|
|
2020-04-28 17:18:59 +08:00
|
|
|
target_include_directories(${OCLOC_NAME}_lib BEFORE PRIVATE ${CLOC_LIB_INCLUDES})
|
|
|
|
target_include_directories(${OCLOC_NAME}_lib BEFORE PRIVATE ${IGA_INCLUDE_DIR})
|
2018-02-05 22:07:21 +08:00
|
|
|
|
2021-11-24 17:38:00 +08:00
|
|
|
target_compile_definitions(${OCLOC_NAME}_lib PUBLIC ${CLOC_LIB_LIB_FLAGS_DEFINITIONS} ${SUPPORTED_CORE_FLAGS_DEFINITONS} DEFAULT_PLATFORM=${DEFAULT_SUPPORTED_PLATFORM}
|
2020-08-19 18:18:18 +08:00
|
|
|
IGA_LIBRARY_NAME=${CMAKE_SHARED_LIBRARY_PREFIX}${IGA_LIBRARY_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
|
|
|
|
)
|
2020-04-28 17:18:59 +08:00
|
|
|
target_compile_definitions(${OCLOC_NAME}_lib PUBLIC ${NEO__IGC_COMPILE_DEFINITIONS})
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2018-06-22 23:38:00 +08:00
|
|
|
if(MSVC)
|
2020-04-28 17:18:59 +08:00
|
|
|
target_link_libraries(${OCLOC_NAME}_lib dbghelp)
|
2020-02-07 21:06:50 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(UNIX)
|
2020-04-28 17:18:59 +08:00
|
|
|
target_link_libraries(${OCLOC_NAME}_lib dl pthread)
|
2020-02-07 21:06:50 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
set(CLOC_LIB_SRCS_LIB ${CLOC_LIB_SRCS_LIB} PARENT_SCOPE)
|
|
|
|
|
2020-04-28 17:18:59 +08:00
|
|
|
set(OCLOC_SRCS
|
2020-08-19 18:18:18 +08:00
|
|
|
${OCLOC_DIRECTORY}/source/ocloc_api.h
|
|
|
|
${OCLOC_DIRECTORY}/source/main.cpp
|
2020-04-28 17:18:59 +08:00
|
|
|
)
|
2020-02-07 21:06:50 +08:00
|
|
|
|
2020-04-28 17:18:59 +08:00
|
|
|
add_executable(${OCLOC_NAME} ${OCLOC_SRCS})
|
|
|
|
target_link_libraries(${OCLOC_NAME} ${OCLOC_NAME}_lib)
|
2020-02-07 21:06:50 +08:00
|
|
|
|
2020-04-28 17:18:59 +08:00
|
|
|
create_project_source_tree(${OCLOC_NAME})
|
|
|
|
set_target_properties(${OCLOC_NAME} PROPERTIES FOLDER ${OCLOC_FOLDER_NAME})
|
2020-02-07 21:06:50 +08:00
|
|
|
|
2020-04-28 17:18:59 +08:00
|
|
|
if(MSVC)
|
2020-08-19 18:18:18 +08:00
|
|
|
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
|
|
|
set(OCLOC_BITNESS_SUFFIX 32)
|
|
|
|
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
set(OCLOC_BITNESS_SUFFIX 64)
|
|
|
|
endif()
|
2020-04-28 17:18:59 +08:00
|
|
|
else()
|
2020-08-19 18:18:18 +08:00
|
|
|
set(OCLOC_BITNESS_SUFFIX "")
|
2018-06-22 23:38:00 +08:00
|
|
|
endif()
|
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
if(UNIX)
|
2021-02-02 22:23:14 +08:00
|
|
|
if(NEO_BUILD_DEBUG_SYMBOLS_PACKAGE)
|
|
|
|
get_filename_component(lib_file_name $<TARGET_FILE:${OCLOC_NAME}_lib> NAME_WE)
|
|
|
|
set(symbols_file_name ${lib_file_name}.debug)
|
|
|
|
set(debug_symbols_target_name "${STRIP_SYMBOLS_TARGET}_${OCLOC_NAME}_lib")
|
|
|
|
add_custom_target(${debug_symbols_target_name}
|
|
|
|
COMMAND sh -c "objcopy --only-keep-debug ${lib_file_name} ${symbols_file_name}"
|
|
|
|
COMMAND sh -c "strip -g ${lib_file_name}"
|
|
|
|
COMMAND sh -c "objcopy --add-gnu-debuglink=${symbols_file_name} ${lib_file_name}"
|
|
|
|
)
|
|
|
|
add_dependencies(${debug_symbols_target_name} ${OCLOC_NAME}_lib)
|
|
|
|
add_dependencies(${STRIP_SYMBOLS_TARGET} ${debug_symbols_target_name})
|
|
|
|
set_property(GLOBAL APPEND PROPERTY DEBUG_SYMBOL_FILES "${symbols_file_name}")
|
|
|
|
endif()
|
2021-01-21 00:25:05 +08:00
|
|
|
|
2020-04-28 17:18:59 +08:00
|
|
|
set_property(GLOBAL APPEND PROPERTY NEO_OCL_COMPONENTS_LIST ${OCLOC_NAME})
|
|
|
|
install(FILES $<TARGET_FILE:${OCLOC_NAME}>
|
2020-08-19 18:18:18 +08:00
|
|
|
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
|
|
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
|
|
|
COMPONENT ${OCLOC_NAME}
|
|
|
|
)
|
2020-04-28 17:18:59 +08:00
|
|
|
install(FILES $<TARGET_FILE:${OCLOC_NAME}_lib>
|
2020-08-19 18:18:18 +08:00
|
|
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
|
|
|
COMPONENT ${OCLOC_NAME}
|
|
|
|
)
|
2020-04-28 17:18:59 +08:00
|
|
|
install(FILES ${OCLOC_DIRECTORY}/source/ocloc_api.h
|
2020-08-19 18:18:18 +08:00
|
|
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
|
|
|
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
|
|
|
COMPONENT ${OCLOC_NAME}
|
|
|
|
)
|
2021-03-03 01:05:11 +08:00
|
|
|
elseif(WIN32)
|
|
|
|
if(NEO_WINDOWS_INSTALL)
|
|
|
|
install(TARGETS ${OCLOC_NAME}
|
|
|
|
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
|
|
COMPONENT ocloc
|
|
|
|
)
|
|
|
|
install(TARGETS ${OCLOC_NAME}_lib
|
|
|
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
COMPONENT ocloc
|
|
|
|
)
|
|
|
|
install(FILES ${OCLOC_DIRECTORY}/source/ocloc_api.h
|
|
|
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
|
|
|
COMPONENT ocloc
|
|
|
|
)
|
|
|
|
endif()
|
2018-03-08 18:42:23 +08:00
|
|
|
endif()
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2020-04-28 17:18:59 +08:00
|
|
|
set(OCLOC_OUTPUT_NAME "${OCLOC_NAME}${OCLOC_BITNESS_SUFFIX}")
|
2020-05-13 23:47:14 +08:00
|
|
|
set_target_properties(${OCLOC_NAME}_lib PROPERTIES OUTPUT_NAME ${OCLOC_OUTPUT_NAME})
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2020-01-14 21:38:19 +08:00
|
|
|
add_custom_target(copy_compiler_files DEPENDS ${NEO__IGC_TARGETS})
|
2020-04-28 17:18:59 +08:00
|
|
|
set_target_properties(copy_compiler_files PROPERTIES FOLDER ${OCLOC_FOLDER_NAME})
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2019-03-07 17:45:33 +08:00
|
|
|
if(WIN32)
|
2020-01-14 21:38:19 +08:00
|
|
|
foreach(TARGET_tmp ${NEO__IGC_TARGETS})
|
2019-03-07 17:45:33 +08:00
|
|
|
add_custom_command(
|
2020-08-19 18:18:18 +08:00
|
|
|
TARGET copy_compiler_files
|
|
|
|
PRE_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_FILE_DIR:${OCLOC_NAME}_lib>
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:${TARGET_tmp}> $<TARGET_FILE_DIR:${OCLOC_NAME}_lib>
|
2019-03-07 17:45:33 +08:00
|
|
|
)
|
|
|
|
endforeach()
|
|
|
|
endif()
|