Skip to content

Commit

Permalink
fix win build
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-esir committed May 29, 2024
1 parent 1a4bd68 commit 9389930
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/cpp/src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ GenAIEnvManager::GenAIEnvManager(const std::string& path) {
#ifdef _WIN32
char* value = nullptr;
size_t len = 0;
_dupenv_s(&value, &len, ov::genai::utils::get_tokenizers_env_name().c_str());
_dupenv_s(&value, &len, ov::genai::utils::get_tokenizers_env_name());
if (value == nullptr)
_putenv_s(ov::genai::utils::get_tokenizers_env_name().c_str(), path.c_str());
_putenv_s(ov::genai::utils::get_tokenizers_env_name(), path.c_str());
#else
if (!getenv(ov::genai::utils::get_tokenizers_env_name()))
setenv(ov::genai::utils::get_tokenizers_env_name(), path.c_str(), 1);
Expand Down
7 changes: 3 additions & 4 deletions src/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ if(NOT pybind11_POPULATED)
add_subdirectory(${pybind11_SOURCE_DIR} ${pybind11_BINARY_DIR})
endif()

pybind11_add_module(py_generate_pipeline py_generate_pipeline.cpp)
# to be able to use utils.hpp in pybind
include_directories(${CMAKE_SOURCE_DIR}/src/cpp/src/)
pybind11_add_module(py_generate_pipeline py_generate_pipeline.cpp ${CMAKE_SOURCE_DIR}/src/cpp/src/utils.cpp)
target_link_libraries(py_generate_pipeline PRIVATE openvino::genai nlohmann_json::nlohmann_json)
set_target_properties(py_generate_pipeline PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "$<1:${CMAKE_BINARY_DIR}/openvino_genai/>"
Expand Down Expand Up @@ -50,6 +52,3 @@ install(TARGETS genai py_generate_pipeline
LIBRARY DESTINATION . COMPONENT wheel_genai
RUNTIME DESTINATION . COMPONENT wheel_genai
EXCLUDE_FROM_ALL)

# to be able to use utils.hpp in pybind
include_directories(${CMAKE_SOURCE_DIR}/src/cpp/src/)

0 comments on commit 9389930

Please sign in to comment.