@@ -4,9 +4,13 @@ project(chia-plotter C CXX ASM)
4
4
5
5
add_subdirectory (lib/bls-signatures )
6
6
7
- find_package (Threads REQUIRED )
8
7
9
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unused-function" )
8
+ if (MSVC )
9
+ add_definitions (-D_CRT_SECURE_NO_WARNINGS )
10
+ else ()
11
+ find_package (Threads REQUIRED )
12
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unused-function" )
13
+ endif ()
10
14
11
15
set (BLAKE3_PATH lib/BLAKE3/c )
12
16
set (FSE_PATH lib/FSE/lib )
@@ -25,10 +29,10 @@ set(BLAKE3_SRC
25
29
${BLAKE3_PATH} /blake3.c
26
30
${BLAKE3_PATH} /blake3_portable.c
27
31
${BLAKE3_PATH} /blake3_dispatch.c
28
- ${BLAKE3_PATH} /blake3_avx2_x86-64_windows_gnu.S
29
- ${BLAKE3_PATH} /blake3_sse41_x86-64_windows_gnu.S
30
- ${BLAKE3_PATH} /blake3_avx512_x86-64_windows_gnu.S
31
- ${BLAKE3_PATH} /blake3_sse2_x86-64_windows_gnu.S
32
+ ${BLAKE3_PATH} /blake3_avx2.c
33
+ ${BLAKE3_PATH} /blake3_avx512.c
34
+ ${BLAKE3_PATH} /blake3_sse2.c
35
+ ${BLAKE3_PATH} /blake3_sse41.c
32
36
)
33
37
ELSEIF (OSX_NATIVE_ARCHITECTURE STREQUAL "arm64" )
34
38
set (BLAKE3_SRC
@@ -63,8 +67,11 @@ add_library(chia_plotter STATIC
63
67
lib/chacha8.c
64
68
src/settings.cpp
65
69
)
66
-
67
- target_link_libraries (chia_plotter blake3 fse Threads::Threads )
70
+ if (MSVC )
71
+ target_link_libraries (chia_plotter blake3 fse )
72
+ else ()
73
+ target_link_libraries (chia_plotter blake3 fse Threads::Threads )
74
+ endif ()
68
75
69
76
add_executable (test_copy test /test_copy.cpp )
70
77
add_executable (test_disk_sort test /test_disk_sort.cpp )
@@ -78,6 +85,24 @@ add_executable(check_phase_1 test/check_phase_1.cpp)
78
85
79
86
add_executable (chia_plot src/chia_plot.cpp )
80
87
88
+ if (MSVC )
89
+
90
+ add_library (uint128 STATIC uint128_t/uint128_t.cpp )
91
+ target_include_directories (uint128 PUBLIC uint128_t )
92
+
93
+ target_link_libraries (test_copy chia_plotter )
94
+ target_link_libraries (test_disk_sort chia_plotter uint128 )
95
+ target_link_libraries (test_phase_1 chia_plotter uint128 )
96
+ target_link_libraries (test_phase_2 chia_plotter uint128 )
97
+ target_link_libraries (test_phase_3 chia_plotter uint128 )
98
+ target_link_libraries (test_phase_4 chia_plotter uint128 )
99
+ target_link_libraries (check_phase_1 chia_plotter uint128 )
100
+
101
+ target_link_libraries (chia_plot chia_plotter bls uint128 )
102
+ set_target_properties (chia_plot PROPERTIES LINK_OPTIONS -NODEFAULTLIB:LIBCMT )
103
+
104
+ else ()
105
+
81
106
target_link_libraries (test_copy chia_plotter )
82
107
target_link_libraries (test_disk_sort chia_plotter )
83
108
@@ -89,3 +114,5 @@ target_link_libraries(test_phase_4 chia_plotter)
89
114
target_link_libraries (check_phase_1 chia_plotter )
90
115
91
116
target_link_libraries (chia_plot chia_plotter bls )
117
+
118
+ endif ()
0 commit comments