Skip to content

Commit

Permalink
try interface for headers
Browse files Browse the repository at this point in the history
  • Loading branch information
mszhanyi committed Jan 28, 2023
1 parent 3e0caa9 commit f860de7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,14 @@ function(onnxruntime_configure_target target_name)
target_link_options(${target_name} PRIVATE "/CETCOMPAT")
endif()

# https://stackoverflow.com/questions/48162570/cmake-how-to-set-compile-flags-for-header-files
if(NOT MSVC)
add_library(onnx_pb_headers INTERFACE)
message(STATUS, "${CMAKE_CURRENT_BINARY_DIR}")
target_include_directories(onnx_pb_headers INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/_deps/onnx-src/onnx)
target_compile_options(onnx_pb_headers INTERFACE $<$<CXX_COMPILER_ID:GNU>:-Wno-unused-parameter>)
target_link_libraries(${target_name} PUBLIC onnx_pb_headers)
endif()
endfunction()

function(onnxruntime_add_shared_library target_name)
Expand Down

0 comments on commit f860de7

Please sign in to comment.