Skip to content

Commit 0bc81ab

Browse files
committed
UPD | windows support #2
1 parent 88892bd commit 0bc81ab

16 files changed

Lines changed: 281 additions & 198 deletions

CMakeLists.txt

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,6 @@ string(REPLACE "{{ VAR_MANAPIHTTP_NGHTTP3_DEPENDENCY }}" $<BOOL:${MANAPIHTTP_NGH
579579
string(REPLACE "{{ VAR_MANAPIHTTP_CPPTRACE_DEPENDENCY }}" $<BOOL:${MANAPIHTTP_CPPTRACE_DEPENDENCY}> TEXT "${TEXT}")
580580
string(REPLACE "{{ VAR_MANAPIHTTP_STD_BACKTRACE_DEPENDENCY }}" $<BOOL:${MANAPIHTTP_STD_BACKTRACE_DEPENDENCY}> TEXT "${TEXT}")
581581
string(REPLACE "{{ VAR_MANAPIHTTP_IS_SHARED }}" $<BOOL:${BUILD_SHARED_LIBS}> TEXT "${TEXT}")
582-
583582
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/include/ManapiParams.hpp" CONTENT "${TEXT}")
584583
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/include/ManapiParams.hpp")
585584

@@ -960,7 +959,17 @@ target_link_libraries(${PROJECT_NAME} PRIVATE Threads::Threads ${CMAKE_DL_LIBS})
960959

961960
if (MANAPIHTTP_BUILD_METHOD STREQUAL "conan")
962961
get_target_property(LIBUV_INCLUDE_DIRECTORIES uv INTERFACE_INCLUDE_DIRECTORIES)
963-
message(STATUS "${LIBUV_INCLUDE_DIRECTORIES}")
962+
963+
message(STATUS ${libuv_CONAN_INCLUDE_DIRS})
964+
if (NOT EXISTS "${CMAKE_BINARY_DIR}/include/ext/uv.h")
965+
file(COPY ${libuv_CONAN_INCLUDE_DIRS}/uv DESTINATION ${CMAKE_BINARY_DIR}/include/ext FILES_MATCHING PATTERN "*.h")
966+
file(COPY ${libuv_CONAN_INCLUDE_DIRS}/uv.h DESTINATION ${CMAKE_BINARY_DIR}/include/ext FILES_MATCHING PATTERN "*.h")
967+
endif()
968+
969+
if (NOT EXISTS "${CMAKE_BINARY_DIR}/include/ext/uv.h")
970+
message( FATAL_ERROR "Failed to copy uv.h from ${libuv_CONAN_INCLUDE_DIRS}" )
971+
endif()
972+
964973
target_link_libraries (${PROJECT_NAME} PUBLIC uv)
965974

966975
if (MANAPIHTTP_BUILD_TYPE STREQUAL "exe")
@@ -1120,7 +1129,10 @@ else ()
11201129
target_include_directories(${PROJECT_NAME} PUBLIC ${CPPTRACE_INCLUDE_DIRS})
11211130
endif ()
11221131

1123-
1132+
if (NOT EXISTS "${CMAKE_BINARY_DIR}/include/uv.h")
1133+
file(COPY ${LIBUV_INCLUDE_DIRS}/uv DESTINATION ${CMAKE_BINARY_DIR}/include/ext FILES_MATCHING PATTERN "*.h")
1134+
file(COPY ${LIBUV_INCLUDE_DIRS}/uv.h DESTINATION ${CMAKE_BINARY_DIR}/include/ext FILES_MATCHING PATTERN "*.h")
1135+
endif()
11241136
endif ()
11251137

11261138
if (MANAPIHTTP_GMP_DEPENDENCY_FETCH)

conanfile.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,6 @@ def layout(self):
103103
cmake_layout(self)
104104

105105
def generate(self):
106-
for dep in self.dependencies.values():
107-
print("BINDIR PATH", dep.cpp_info.libdir)
108-
copy(self, "*.dll", dep.cpp_info.libdir, os.path.join(self.build_folder, 'bin'))
109-
110106
VirtualBuildEnv(self).generate()
111107

112108
runenv = VirtualRunEnv(self)
@@ -130,6 +126,13 @@ def generate(self):
130126
tc.variables['MANAPIHTTP_NGHTTP3_DEPENDENCY'] = self.options.get_safe('nghttp3_dependency', False)
131127
tc.variables['MANAPIHTTP_CPPTRACE_DEPENDENCY'] = self.options.get_safe('cpptrace_dependency', False)
132128
tc.variables['MANAPIHTTP_BUILD_TYPE'] = 'lib' if self.options.get_safe('lib', False) else 'exe'
129+
130+
for [key, dep] in self.dependencies.items():
131+
p = dep.cpp_info.includedir
132+
if (self.settings.os == "Windows"):
133+
p = p.replace('\\', '\\\\')
134+
tc.variables[f"{str(key).split('/')[0]}_CONAN_INCLUDE_DIRS"] = p
135+
133136
tc.cache_variables["CMAKE_TRY_COMPILE_CONFIGURATION"] = str(self.settings.build_type)
134137
tc.generate()
135138

include/ManapiEventStructures.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <type_traits>
44
#include <memory>
55

6-
#include <uv.h>
6+
#include "ext/uv.h"
77

88
#include "./ManapiUtils.hpp"
99
#include "./ManapiErrors.hpp"

include/json/ManapiJsonBuilder.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "../ManapiUtils.hpp"
77
#include "./ManapiJson.hpp"
88
#include "./ManapiJsonMask.hpp"
9+
#include "../ManapiEventStructures.hpp"
910

1011
namespace manapi {
1112
class json_builder {
@@ -72,7 +73,7 @@ namespace manapi {
7273
size_t i;
7374
int action;
7475

75-
std::unique_ptr<std::vector<std::string_view>> path;
76+
std::unique_ptr<std::vector<ev::buff_t>> path;
7677
const json *current_types;
7778
size_t current_type;
7879

include/json/ManapiJsonMask.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include "../ManapiErrors.hpp"
44
#include "../ManapiUtils.hpp"
5+
#include "../ManapiEventStructures.hpp"
56
#include "./ManapiJson.hpp"
67

78
namespace manapi {
@@ -116,6 +117,6 @@ namespace manapi {
116117

117118
static void initial_resolve_information (json &obj);
118119

119-
[[nodiscard]] manapi::json_error::status recursive_valid (const json &obj, const json &information, bool is_complex, std::vector<std::string_view> *path) const;
120+
MANAPIHTTP_NODISCARD manapi::json_error::status recursive_valid (const json &obj, const json &information, bool is_complex, std::vector<ev::buff_t> *path) const;
120121
};
121122
}

include/std/ManapiBuffer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <typeinfo>
44
#include <cstdint>
55

6-
#include "uv.h"
6+
#include "ext/uv.h"
77

88
#include "../ManapiErrors.hpp"
99

0 commit comments

Comments
 (0)