mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-25 22:26:24 +00:00
1. Update SDLNativeRules from v2 to v3. The new one allows us setting excluded paths. 2. Update TSAUpload from v1 to v2. And add a config file ".gdn/.gdntsa" for it. 3. Fix some parentheses warnings 4. Update cmake to the latest. 5. Remove "--x86" build option from pipeline yaml files. Now we can auto-detect cpu architecture from python. So we don't need to ask user to specify it.
54 lines
2.2 KiB
CMake
54 lines
2.2 KiB
CMake
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
# Licensed under the MIT License.
|
|
|
|
set(TENSORBOARD_ROOT ${PROJECT_SOURCE_DIR}/external/tensorboard)
|
|
|
|
# tensorboard protos
|
|
file(GLOB_RECURSE tensorboard_proto_srcs CONFIGURE_DEPENDS
|
|
"${TENSORBOARD_ROOT}/tensorboard/compat/proto/*.proto"
|
|
)
|
|
|
|
if(EXISTS "${ONNX_CUSTOM_PROTOC_EXECUTABLE}")
|
|
set(PROTOC_EXECUTABLE ${ONNX_CUSTOM_PROTOC_EXECUTABLE})
|
|
else()
|
|
set(PROTOC_EXECUTABLE $<TARGET_FILE:protobuf::protoc>)
|
|
set(PROTOC_DEPS protobuf::protoc)
|
|
endif()
|
|
if(NOT onnxruntime_USE_FULL_PROTOBUF)
|
|
set(PROTOC_PROTOBUF_ARG "lite:")
|
|
endif()
|
|
|
|
# tensorboard generated files
|
|
foreach(_proto ${tensorboard_proto_srcs})
|
|
get_filename_component(_abs_file ${_proto} ABSOLUTE)
|
|
get_filename_component(_basename ${_proto} NAME_WE)
|
|
set(_tensorboard_cpp_srcs
|
|
"${CMAKE_CURRENT_BINARY_DIR}/tensorboard/compat/proto/${_basename}.pb.cc"
|
|
"${CMAKE_CURRENT_BINARY_DIR}/tensorboard/compat/proto/${_basename}.pb.h"
|
|
)
|
|
add_custom_command(
|
|
OUTPUT ${_tensorboard_cpp_srcs}
|
|
COMMAND ${PROTOC_EXECUTABLE}
|
|
ARGS --cpp_out ${PROTOC_PROTOBUF_ARG}${CMAKE_CURRENT_BINARY_DIR} -I ${TENSORBOARD_ROOT} -I ${REPO_ROOT}/cmake/external/protobuf/src ${_abs_file}
|
|
DEPENDS ${_abs_file} ${PROTOC_DEPS}
|
|
COMMENT "Running cpp protocol buffer compiler on ${_proto}"
|
|
VERBATIM )
|
|
list(APPEND tensorboard_cpp_srcs ${_tensorboard_cpp_srcs})
|
|
endforeach()
|
|
|
|
onnxruntime_add_static_library(tensorboard ${tensorboard_cpp_srcs})
|
|
target_include_directories(tensorboard PUBLIC $<TARGET_PROPERTY:protobuf::libprotobuf,INTERFACE_INCLUDE_DIRECTORIES> "${CMAKE_CURRENT_BINARY_DIR}")
|
|
target_compile_definitions(tensorboard PUBLIC $<TARGET_PROPERTY:protobuf::libprotobuf,INTERFACE_COMPILE_DEFINITIONS>)
|
|
|
|
if(WIN32)
|
|
target_compile_options(tensorboard PRIVATE /wd4100 /wd4996 /wd4244 /wd4267 /wd4309)
|
|
set_target_properties(tensorboard PROPERTIES FOLDER "External/tensorboard")
|
|
else()
|
|
target_compile_options(tensorboard PRIVATE "-Wno-unused-parameter")
|
|
if(HAS_UNUSED_BUT_SET_VARIABLE)
|
|
target_compile_options(tensorboard PRIVATE "-Wno-unused-but-set-variable")
|
|
endif()
|
|
target_compile_options(tensorboard PRIVATE "-Wno-unused-variable")
|
|
target_compile_options(tensorboard PRIVATE "-Wno-deprecated-declarations")
|
|
endif()
|
|
|