Skip to content

Commit c371a91

Browse files
author
lexasub
committed
try fix windows build
1 parent 92bbf15 commit c371a91

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

tools/dataset-converter/CMakeLists.txt

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,22 @@ add_library(dataset-to-gguf-lib
1414
dataset-to-gguf/llama-dataset-reader/llama-parquet-data-reader.cpp
1515
)
1616

17-
# Link libraries for dataset-to-gguf-lib
17+
if(WIN32)
18+
target_compile_options(dataset-to-gguf-lib PRIVATE /std:c++17)
19+
else()
20+
target_compile_features(dataset-to-gguf-lib PRIVATE cxx_std_17)
21+
endif()
22+
1823
target_link_libraries(dataset-to-gguf-lib common llama ${CMAKE_THREAD_LIBS_INIT})
1924
if(LLAMA_PARQUET)
2025
target_link_libraries(dataset-to-gguf-lib Arrow::arrow_shared Parquet::parquet_shared)
2126
endif()
22-
target_compile_features(dataset-to-gguf-lib PRIVATE cxx_std_11)
23-
2427

2528
add_executable(convert-to-train-gguf convert-to-train-gguf.cpp)
26-
target_link_libraries(convert-to-train-gguf PRIVATE dataset-to-gguf-lib) # Link to the new library
27-
target_compile_features(convert-to-train-gguf PRIVATE cxx_std_11) # Apply C++ standard to the executable
29+
add_dependencies(convert-to-train-gguf dataset-to-gguf-lib)
30+
target_link_libraries(convert-to-train-gguf PRIVATE dataset-to-gguf-lib)
2831

29-
# Define the executable for the unit tests
3032
set(TEST_TARGET_GGUF_DATASET_CONVERTER_TESTS dataset-to-gguf-unit-tests)
3133
add_executable(${TEST_TARGET_GGUF_DATASET_CONVERTER_TESTS} dataset-to-gguf/tests/dataset-to-gguf-tests.cpp)
32-
33-
# Link necessary libraries for the test executable
34+
add_dependencies(${TEST_TARGET_GGUF_DATASET_CONVERTER_TESTS} dataset-to-gguf-lib)
3435
target_link_libraries(${TEST_TARGET_GGUF_DATASET_CONVERTER_TESTS} PRIVATE common llama dataset-to-gguf-lib)
35-
36-
# Ensure C++17 for filesystem usage for the test executable
37-
target_compile_features(${TEST_TARGET_GGUF_DATASET_CONVERTER_TESTS} PRIVATE cxx_std_17)
38-
39-
add_test(
40-
NAME ${TEST_TARGET_GGUF_DATASET_CONVERTER_TESTS} #
41-
COMMAND $<TARGET_FILE:${TEST_TARGET_GGUF_DATASET_CONVERTER_TESTS}>
42-
LABEL "training"
43-
)

0 commit comments

Comments
 (0)