Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move clio from Clarion repo #71

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
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
Prev Previous commit
Merge branch 'main' into clio
tbfleming committed Jun 26, 2021
commit da287ee61d58e3fe0cf71975b9091dff516397ae
150 changes: 104 additions & 46 deletions libraries/eosiolib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -60,50 +60,108 @@ function(add_libs suffix)
${WASI_SDK_PREFIX}/lib/clang/11.0.0/lib/wasi/libclang_rt.builtins-wasm32.a
)

add_library(testlib)
target_sources(testlib PRIVATE
tester/tester.cpp
tester/tester_intrinsics.cpp
tester/wasi_polyfill/__wasi_args_get.cpp
tester/wasi_polyfill/__wasi_args_sizes_get.cpp
tester/wasi_polyfill/__wasi_clock_time_get.cpp
tester/wasi_polyfill/__wasi_environ_get.cpp
tester/wasi_polyfill/__wasi_environ_sizes_get.cpp
tester/wasi_polyfill/__wasi_fd_close.cpp
tester/wasi_polyfill/__wasi_fd_fdstat_get.cpp
tester/wasi_polyfill/__wasi_fd_fdstat_set_flags.cpp
tester/wasi_polyfill/__wasi_fd_prestat_dir_name.cpp
tester/wasi_polyfill/__wasi_fd_prestat_get.cpp
tester/wasi_polyfill/__wasi_fd_read.cpp
tester/wasi_polyfill/__wasi_fd_seek.cpp
tester/wasi_polyfill/__wasi_fd_write.cpp
tester/wasi_polyfill/__wasi_path_open.cpp
tester/wasi_polyfill/__wasi_proc_exit.cpp
)
target_link_libraries(testlib PUBLIC fmt boost eosio-core)
target_include_directories(testlib PUBLIC contracts tester)
target_link_options(testlib INTERFACE -Wl,--export-table)
add_dependencies(testlib fmt)
add_library(eosio-contract-abigen${suffix})
target_sources(eosio-contract-abigen${suffix} PRIVATE
tester/tester_intrinsics.cpp
tester/wasi_polyfill/__wasi_proc_exit.cpp
)
target_compile_options(eosio-contract-abigen${suffix} PUBLIC -DCOMPILING_ABIGEN)
target_include_directories(eosio-contract-abigen${suffix} PUBLIC contracts/include)
target_link_libraries(eosio-contract-abigen${suffix} PUBLIC
boost
eosio-core${suffix}
-lc++
-lc++abi
-lc
eosio-contracts-wasi-polyfill${suffix}
${WASI_SDK_PREFIX}/lib/clang/11.0.0/lib/wasi/libclang_rt.builtins-wasm32.a
${WASI_SDK_PREFIX}/share/wasi-sysroot/lib/wasm32-wasi/crt1.o
)
target_link_options(eosio-contract-abigen${suffix} PUBLIC
-Wl,--entry,_start
-nostdlib
)

add_library(cltestlib${suffix})
target_sources(cltestlib${suffix} PRIVATE
tester/tester.cpp
tester/tester_intrinsics.cpp
tester/wasi_polyfill/__wasi_args_get.cpp
tester/wasi_polyfill/__wasi_args_sizes_get.cpp
tester/wasi_polyfill/__wasi_clock_time_get.cpp
tester/wasi_polyfill/__wasi_environ_get.cpp
tester/wasi_polyfill/__wasi_environ_sizes_get.cpp
tester/wasi_polyfill/__wasi_fd_close.cpp
tester/wasi_polyfill/__wasi_fd_fdstat_get.cpp
tester/wasi_polyfill/__wasi_fd_fdstat_set_flags.cpp
tester/wasi_polyfill/__wasi_fd_prestat_dir_name.cpp
tester/wasi_polyfill/__wasi_fd_prestat_get.cpp
tester/wasi_polyfill/__wasi_fd_read.cpp
tester/wasi_polyfill/__wasi_fd_seek.cpp
tester/wasi_polyfill/__wasi_fd_write.cpp
tester/wasi_polyfill/__wasi_path_open.cpp
tester/wasi_polyfill/__wasi_proc_exit.cpp
)
target_link_libraries(cltestlib${suffix} PUBLIC
boost eosio-core${suffix}
-lc++
-lc++abi
-lc
${WASI_SDK_PREFIX}/lib/clang/11.0.0/lib/wasi/libclang_rt.builtins-wasm32.a
${WASI_SDK_PREFIX}/share/wasi-sysroot/lib/wasm32-wasi/crt1.o
)
target_include_directories(cltestlib${suffix} PUBLIC contracts/include tester/include)
target_link_options(cltestlib${suffix} INTERFACE -Wl,--export-table)
target_link_options(cltestlib${suffix} PUBLIC
-Wl,--entry,_start
-nostdlib
)

add_library(basic-polyfill${suffix})
target_sources(basic-polyfill${suffix} PRIVATE
tester/wasi_polyfill/__wasi_args_get.cpp
tester/wasi_polyfill/__wasi_args_sizes_get.cpp
tester/wasi_polyfill/__wasi_clock_time_get.cpp
tester/wasi_polyfill/__wasi_environ_get.cpp
tester/wasi_polyfill/__wasi_environ_sizes_get.cpp
tester/wasi_polyfill/__wasi_fd_close.cpp
tester/wasi_polyfill/__wasi_fd_fdstat_get.cpp
tester/wasi_polyfill/__wasi_fd_fdstat_set_flags.cpp
tester/wasi_polyfill/__wasi_fd_prestat_dir_name.cpp
tester/wasi_polyfill/__wasi_fd_prestat_get.cpp
tester/wasi_polyfill/__wasi_fd_read.cpp
tester/wasi_polyfill/__wasi_fd_seek.cpp
tester/wasi_polyfill/__wasi_fd_write.cpp
tester/wasi_polyfill/__wasi_path_open.cpp
tester/wasi_polyfill/__wasi_proc_exit.cpp
tester/wasi_polyfill/prints.cpp
)
target_link_libraries(basic-polyfill${suffix} PUBLIC wasm-base${suffix})
endfunction(add_libs)

add_libs("")
add_libs("-debug")
add_libs("-clsdk")
add_libs("-debug-clsdk")

foreach(suffix "" "-debug")
foreach(lib eosio-contracts-wasi-polyfill eosio-core eosio-contract-base eosio-contract-abigen cltestlib)
set_target_properties(${lib}${suffix}-clsdk PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${ROOT_BINARY_DIR}/clsdk/lib-wasm)
set_target_properties(${lib}${suffix}-clsdk PROPERTIES ARCHIVE_OUTPUT_NAME ${lib}${suffix})
endforeach()
endforeach()

add_library(basic-polyfill)
target_compile_options(basic-polyfill PUBLIC -fno-exceptions)
target_sources(basic-polyfill PRIVATE
tester/wasi_polyfill/__wasi_args_get.cpp
tester/wasi_polyfill/__wasi_args_sizes_get.cpp
tester/wasi_polyfill/__wasi_clock_time_get.cpp
tester/wasi_polyfill/__wasi_environ_get.cpp
tester/wasi_polyfill/__wasi_environ_sizes_get.cpp
tester/wasi_polyfill/__wasi_fd_close.cpp
tester/wasi_polyfill/__wasi_fd_fdstat_get.cpp
tester/wasi_polyfill/__wasi_fd_fdstat_set_flags.cpp
tester/wasi_polyfill/__wasi_fd_prestat_dir_name.cpp
tester/wasi_polyfill/__wasi_fd_prestat_get.cpp
tester/wasi_polyfill/__wasi_fd_read.cpp
tester/wasi_polyfill/__wasi_fd_seek.cpp
tester/wasi_polyfill/__wasi_fd_write.cpp
tester/wasi_polyfill/__wasi_path_open.cpp
tester/wasi_polyfill/__wasi_proc_exit.cpp
tester/wasi_polyfill/prints.cpp
)
target_link_libraries(basic-polyfill PUBLIC)
target_link_options(basic-polyfill INTERFACE -Wl,--export-table)
copy_headers(contracts/include/eosio eosiolib/contracts/include/eosio)
copy_headers(core/include eosiolib/core/include)
copy_headers(core/include/eosio eosiolib/core/include/eosio)
copy_headers(tester/include/eosio eosiolib/tester/include/eosio)
file(COPY contracts/wasi-polyfill DESTINATION ${ROOT_BINARY_DIR}/clsdk/eosiolib/contracts)
file(COPY tester/wasi_polyfill DESTINATION ${ROOT_BINARY_DIR}/clsdk/eosiolib/tester)
configure_file(crypto.cpp ${ROOT_BINARY_DIR}/clsdk/eosiolib/crypto.cpp COPYONLY)
configure_file(eosiolib.cpp ${ROOT_BINARY_DIR}/clsdk/eosiolib/eosiolib.cpp COPYONLY)
configure_file(simple_malloc.cpp ${ROOT_BINARY_DIR}/clsdk/eosiolib/simple_malloc.cpp COPYONLY)
configure_file(tester/tester_intrinsics.cpp ${ROOT_BINARY_DIR}/clsdk/eosiolib/tester/tester_intrinsics.cpp COPYONLY)
configure_file(tester/tester.cpp ${ROOT_BINARY_DIR}/clsdk/eosiolib/tester/tester.cpp COPYONLY)
configure_file(sdk/clsdk-cmake-args ${ROOT_BINARY_DIR}/clsdk/bin/clsdk-cmake-args COPYONLY)
configure_file(sdk/toolchain.cmake ${ROOT_BINARY_DIR}/clsdk/toolchain.cmake COPYONLY)
configure_file(sdk/clsdk-config.cmake ${ROOT_BINARY_DIR}/clsdk/clsdk-config.cmake COPYONLY)
You are viewing a condensed version of this merge commit. You can view the full changes here.