Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/embed/* -text
19 changes: 19 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,25 @@ if (NOT XCODE AND NOT MSVC AND NOT CMAKE_BUILD_TYPE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()


message(STATUS "polyfilling #embed via Python...")

set(VOCAB_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/src/vocab/vocab.cpp")
set(GENERATED_VOCAB_HPP "${CMAKE_CURRENT_SOURCE_DIR}/src/vocab/vocab_generated.h")
execute_process(
COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/script/generate_vocab.py
${VOCAB_HEADER}
${GENERATED_VOCAB_HPP}
RESULT_VARIABLE result
)

if (NOT result EQUAL 0)
message(FATAL_ERROR "Failed to run generate_vocab.py")
endif()

add_definitions(-DUSE_GENERATED_VOCAB)


if (MSVC)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
add_compile_definitions(_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING)
Expand Down
Loading
Loading