Skip to content

Commit

Permalink
Revert "/CETCOMPAT (#234)"
Browse files Browse the repository at this point in the history
This reverts commit efbb450.
  • Loading branch information
jchen351 committed Apr 16, 2024
1 parent dbabc1c commit 6ca881b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ project(Generators LANGUAGES C CXX)
# All Options should be defined in cmake/options.cmake
include(cmake/options.cmake)
include(cmake/external/onnxruntime_external_deps.cmake)
include(cmake/util_func.cmake)

file(READ "VERSION_INFO" ver)
set(VERSION_INFO ${ver} CACHE STRING "Set the onnxruntime-genai version info.")
Expand Down Expand Up @@ -107,7 +106,10 @@ add_library(onnxruntime-genai-static STATIC ${generator_srcs})
target_include_directories(onnxruntime-genai PRIVATE ${ORT_HEADER_DIR})
target_include_directories(onnxruntime-genai-static PRIVATE ${ORT_HEADER_DIR})

genai_set_target_compile_options(onnxruntime-genai)
if(CMAKE_GENERATOR_TOOLSET MATCHES "Visual Studio")
target_link_options(onnxruntime-genai PRIVATE "/CETCOMPAT")
target_compile_options(onnxruntime-genai PRIVATE "/sdl")
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set_target_properties(onnxruntime-genai-static PROPERTIES POSITION_INDEPENDENT_CODE ON)
Expand Down
15 changes: 0 additions & 15 deletions cmake/util_func.cmake

This file was deleted.

7 changes: 5 additions & 2 deletions src/python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include(${CMAKE_SOURCE_DIR}/cmake/cxx_standard.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/util_func.cmake)

file(GLOB python_srcs CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/*.h"
"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
Expand All @@ -14,7 +14,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
endif()
set_target_properties(python PROPERTIES OUTPUT_NAME "onnxruntime_genai")

genai_set_target_compile_options(python)
if(CMAKE_GENERATOR_TOOLSET MATCHES "Visual Studio")
target_link_options(python PRIVATE "/CETCOMPAT")
target_compile_options(python PRIVATE "/sdl" PRIVATE "/Qspectre")
endif()

if(USE_CUDA AND CMAKE_CUDA_COMPILER)
cmake_policy(SET CMP0104 OLD)
Expand Down

0 comments on commit 6ca881b

Please sign in to comment.