Skip to content

Commit

Permalink
remove -d option in fift; optimize fift-lib usage
Browse files Browse the repository at this point in the history
  • Loading branch information
neodiX committed Jul 17, 2024
1 parent 66160a3 commit 06d474b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
28 changes: 12 additions & 16 deletions crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -358,20 +358,16 @@ target_link_libraries(test-ed25519-crypto PUBLIC ton_crypto)

add_library(fift-lib STATIC ${FIFT_SOURCE})
target_include_directories(fift-lib PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
target_link_libraries(fift-lib PUBLIC ton_crypto ton_db tdutils ton_block)

add_library(fift-lib-no-db STATIC ${FIFT_SOURCE})
target_include_directories(fift-lib-no-db PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
target_link_libraries(fift-lib-no-db PUBLIC ton_crypto tdutils ton_block)
target_link_libraries(fift-lib PUBLIC ton_crypto tdutils ton_block)

if (USE_EMSCRIPTEN)
target_link_options(fift-lib-no-db PRIVATE -fexceptions)
target_compile_options(fift-lib-no-db PRIVATE -fexceptions)
target_link_options(fift-lib PRIVATE -fexceptions)
target_compile_options(fift-lib PRIVATE -fexceptions)
endif()
set_target_properties(fift-lib-no-db PROPERTIES OUTPUT_NAME fift)
set_target_properties(fift-lib PROPERTIES OUTPUT_NAME fift)

add_executable(fift fift/fift-main.cpp)
target_link_libraries(fift PUBLIC fift-lib-no-db git)
target_link_libraries(fift PUBLIC fift-lib git)
if (WINGETOPT_FOUND)
target_link_libraries_system(fift wingetopt)
endif()
Expand Down Expand Up @@ -399,7 +395,7 @@ endif()
if (USE_EMSCRIPTEN)
add_executable(funcfiftlib funcfiftlib/funcfiftlib.cpp ${FUNC_LIB_SOURCE})
target_include_directories(funcfiftlib PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
target_link_libraries(funcfiftlib PUBLIC fift-lib-no-db src_parser git)
target_link_libraries(funcfiftlib PUBLIC fift-lib src_parser git)
target_link_options(funcfiftlib PRIVATE -sEXPORTED_RUNTIME_METHODS=FS,ccall,cwrap,UTF8ToString,stringToUTF8,lengthBytesUTF8,addFunction,removeFunction,setValue)
target_link_options(funcfiftlib PRIVATE -sEXPORTED_FUNCTIONS=_func_compile,_version,_malloc,_free,_setThrew)
target_link_options(funcfiftlib PRIVATE -sEXPORT_NAME=CompilerModule)
Expand Down Expand Up @@ -535,12 +531,12 @@ add_executable(create-state block/create-state.cpp)
target_include_directories(create-state PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>)
if (INTERNAL_COMPILE)
target_link_libraries(create-state PUBLIC ton_crypto fift-lib ton_block tonlib git)
target_link_libraries(create-state PUBLIC ton_crypto fift-lib ton_db ton_block tonlib git)
else()
if (TONLIB_COMPILE)
target_link_libraries(create-state PUBLIC ton_crypto fift-lib ton_block tonlib git)
target_link_libraries(create-state PUBLIC ton_crypto fift-lib ton_db ton_block tonlib git)
else()
target_link_libraries(create-state PUBLIC ton_crypto fift-lib ton_block git)
target_link_libraries(create-state PUBLIC ton_crypto fift-lib ton_db ton_block git)
endif()
endif()
if (WINGETOPT_FOUND)
Expand All @@ -550,15 +546,15 @@ endif()
add_executable(dump-block block/dump-block.cpp)
target_include_directories(dump-block PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>)
target_link_libraries(dump-block PUBLIC ton_crypto fift-lib ton_block git)
target_link_libraries(dump-block PUBLIC ton_crypto fift-lib ton_db ton_block git)
if (WINGETOPT_FOUND)
target_link_libraries_system(dump-block wingetopt)
endif()

add_executable(adjust-block block/adjust-block.cpp)
target_include_directories(adjust-block PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>)
target_link_libraries(adjust-block PUBLIC ton_crypto fift-lib ton_block git)
target_link_libraries(adjust-block PUBLIC ton_crypto fift-lib ton_db ton_block git)
if (WINGETOPT_FOUND)
target_link_libraries_system(dump-block wingetopt)
target_link_libraries_system(adjust-block wingetopt)
Expand All @@ -567,7 +563,7 @@ endif()
add_executable(test-weight-distr block/test-weight-distr.cpp)
target_include_directories(test-weight-distr PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>)
target_link_libraries(test-weight-distr PUBLIC ton_crypto fift-lib ton_block git)
target_link_libraries(test-weight-distr PUBLIC ton_crypto fift-lib ton_db ton_block git)
if (WINGETOPT_FOUND)
target_link_libraries_system(test-weight-distr wingetopt)
endif()
Expand Down
2 changes: 1 addition & 1 deletion crypto/fift/fift-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ int main(int argc, char* const argv[]) {

int i;
int new_verbosity_level = VERBOSITY_NAME(INFO);
while (!script_mode && (i = getopt(argc, argv, "hinI:L:d:sv:V")) != -1) {
while (!script_mode && (i = getopt(argc, argv, "hinI:L:sv:V")) != -1) {
switch (i) {
case 'i':
interactive = true;
Expand Down

0 comments on commit 06d474b

Please sign in to comment.