Skip to content

Commit

Permalink
Merge pull request #1108 from fragcolor-xyz/guus/remove-mal
Browse files Browse the repository at this point in the history
Guus/remove mal
  • Loading branch information
guusw authored Jan 27, 2025
2 parents c825bf1 + 1379214 commit f73930f
Show file tree
Hide file tree
Showing 53 changed files with 405 additions and 6,790 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-linux-valgrind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
valgrind --exit-on-first-error=yes --error-exitcode=1 --fair-sched=yes ./shards new ../shards/tests/wasm.shs
valgrind --exit-on-first-error=yes --error-exitcode=1 --fair-sched=yes ./shards new ../shards/tests/subwires.shs
valgrind --exit-on-first-error=yes --error-exitcode=1 --fair-sched=yes ./shards new ../shards/tests/const-vars.shs
valgrind --exit-on-first-error=yes --error-exitcode=1 --fair-sched=yes ./shards ../shards/tests/wires-embed-issue.edn
valgrind --exit-on-first-error=yes --error-exitcode=1 --fair-sched=yes ./shards ../shards/tests/wires-embed-issue.shs
valgrind --exit-on-first-error=yes --error-exitcode=1 --fair-sched=yes ./shards new ../shards/tests/network.shs
valgrind --exit-on-first-error=yes --error-exitcode=1 --fair-sched=yes ./shards new ../shards/tests/network-ws.shs
valgrind --exit-on-first-error=yes --error-exitcode=1 --fair-sched=yes ./shards new ../shards/tests/capture-logs.shs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ jobs:
--output-file coverage/coverage.info
# remove external dependencies
lcov \
--remove coverage/coverage.info "*/c++/*" "*/boost/*" "*/usr/*" "*/deps/*" "*/shards/mal/*" \
--remove coverage/coverage.info "*/c++/*" "*/boost/*" "*/usr/*" "*/deps/*" \
--output-file coverage/coverage.linux.info
# convert absolute path to relative path
sed -i s/${PWD////\\/}/./g coverage/coverage.linux.info
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/build-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ jobs:
if: ${{ steps.setup.outputs.run-tests == 'true' && steps.setup.outputs.threading == 'st' }}
run: |
cd build
node ../shards/tests/test-shards.js shards-st.js || [[ $? == 143 ]] || exit
node ../shards/tests/test-runtime.js || [[ $? == 143 ]] || exit
mkdir shards
cp shards-st.wasm shards/
Expand All @@ -132,7 +131,6 @@ jobs:
if: ${{ steps.setup.outputs.threading == 'mt' }}
run: |
cd build
node --experimental-wasm-threads ../shards/tests/test-shards.js shards-mt.js || [[ $? == 143 ]] || exit
node --experimental-wasm-threads ../shards/tests/test-runtime.js || [[ $? == 143 ]] || exit
mkdir shards
cp shards-mt.wasm shards/
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,6 @@ jobs:
./shards new ../shards/tests/snappy.shs
echo "Running expect-like"
./shards new ../shards/tests/expect.shs
# echo "Running ws"
# ./shards ../shards/tests/ws.edn
echo "Running bigint"
./shards new ../shards/tests/bigint.shs
echo "Running wasm"
Expand Down
101 changes: 0 additions & 101 deletions .github/workflows/compress-strings.yml

This file was deleted.

10 changes: 1 addition & 9 deletions .github/workflows/test-macos-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,6 @@ jobs:
build/shards new "$i"
done
echo "\n"
echo "Running graphics test scripts"
for i in $(find shards/tests -maxdepth 1 -name 'gfx*.edn');
do
echo "Running $i"
build/shards "$i"
done
echo "Running input test"
build/shards new shards/tests/input.shs
Expand Down Expand Up @@ -165,7 +157,7 @@ jobs:
--ignore-errors inconsistent,gcov,range
# remove external dependencies
lcov \
--remove coverage/coverage.info "*/c++/*" "*/boost/*" "*/usr/*" "*/deps/*" "*/shards/mal/*" \
--remove coverage/coverage.info "*/c++/*" "*/boost/*" "*/usr/*" "*/deps/*" \
--output-file coverage/coverage-macos-gpu.info \
--ignore-errors inconsistent,gcov,range
# convert absolute path to relative path
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
[submodule "cpp-taskflow"]
path = deps/cpp-taskflow
url = https://github.com/shards-lang/cpp-taskflow.git
[submodule "deps/replxx"]
path = deps/replxx
url = https://github.com/shards-lang/replxx.git
[submodule "deps/nameof"]
path = deps/nameof
url = https://github.com/shards-lang/nameof.git
Expand Down
4 changes: 1 addition & 3 deletions cmake/Root.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ set_property(GLOBAL PROPERTY CTEST_TARGETS_ADDED 1)

add_subdirectory(${SHARDS_DIR}/deps deps)

# add_subdirectory(${SHARDS_DIR}/src/mal src/mal)

# Standalone libraries
add_subdirectory(${SHARDS_DIR}/shards/fast_string src/fast_string)
add_subdirectory(${SHARDS_DIR}/shards/log src/log)
Expand Down Expand Up @@ -73,7 +71,7 @@ endforeach()
add_subdirectory(${SHARDS_DIR}/shards/union src/union)

# Shards library and executable bundle
add_subdirectory(${SHARDS_DIR}/shards/mal src/mal)
add_subdirectory(${SHARDS_DIR}/shards/cli src/cli)

add_subdirectory(${SHARDS_DIR}/shards/tests src/tests)

Expand Down
1 change: 0 additions & 1 deletion cmake/Tidy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ set(
-I${SHARDS_DIR}/include
-I${SHARDS_DIR}/src/core
-I${SHARDS_DIR}/src/gfx
-I${SHARDS_DIR}/deps/replxx/include
-I${SHARDS_DIR}/deps/spdlog/include
-I${SHARDS_DIR}/deps/SPSCQueue/include
-I${SHARDS_DIR}/deps/stb
Expand Down
4 changes: 2 additions & 2 deletions cmake/rust/union_Cargo.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ metal = { git = "https://github.com/shards-lang/metal-rs.git", version = "=0.29.
tiny-skia = { opt-level = 3 }
resvg = { opt-level = 3 }
usvg = { opt-level = 3 }
shards-lang = { opt-level = 3 }
shards-langffi = { opt-level = 3 }
# shards-lang = { opt-level = 3 }
# shards-langffi = { opt-level = 3 }
pest = { opt-level = 3, debug-assertions = false } # This will apply to all profiles
pest_derive = { opt-level = 3, debug-assertions = false } # This will apply to all profiles
syntect = { opt-level = 3 }
Expand Down
1 change: 0 additions & 1 deletion deps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ target_include_directories(kcp-wrapper INTERFACE kcp)

add_subdirectory(magic_enum)
add_subdirectory(nameof)
add_subdirectory(replxx)
add_subdirectory(spdlog)
add_subdirectory(sqlite)

Expand Down
1 change: 0 additions & 1 deletion deps/replxx
Submodule replxx deleted from 11875e
53 changes: 21 additions & 32 deletions shards/mal/CMakeLists.txt → shards/cli/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
set(shards_SOURCES
stepA_mal.cpp
Core.cpp
SHCore.cpp
Environment.cpp
Reader.cpp
ReadLine.cpp
String.cpp
Types.cpp
Validation.cpp
SHCore.cpp
set(cli_SOURCES
main.cpp
)

function(setup_shards_target TARGET)
Expand All @@ -17,9 +8,9 @@ function(setup_shards_target TARGET)
endif()

if(APPLE)
target_link_libraries(${TARGET} replxx shards-core shards_core_swift)
target_link_libraries(${TARGET} shards-core shards_core_swift)
else()
target_link_libraries(${TARGET} replxx shards-core)
target_link_libraries(${TARGET} shards-core)
endif()

set_target_properties(${TARGET} PROPERTIES LINKER_LANGUAGE CXX)
Expand All @@ -29,16 +20,15 @@ function(setup_shards_target TARGET)
endfunction()

function(setup_shards_library_target TARGET)
target_sources(${TARGET} PRIVATE ${shards_SOURCES})
target_sources(${TARGET} PRIVATE ${cli_SOURCES})
target_compile_definitions(${TARGET} PUBLIC NO_MAL_MAIN=1)

setup_shards_target(${TARGET})
endfunction()

# Executable
add_executable(shards ${shards_SOURCES})
add_executable(shards ${cli_SOURCES})
setup_shards_target(shards)

target_link_libraries(shards shards-cpp-union)

# library
Expand All @@ -47,24 +37,9 @@ setup_shards_library_target(shards-lib)
set_target_properties(shards-lib PROPERTIES OUTPUT_NAME "${LIB_PREFIX}shards-static")
target_compile_definitions(shards-lib PRIVATE "shards_EXPORTS=1")

if(EMSCRIPTEN)
if(EMSCRIPTEN_PTHREADS)
set_target_properties(shards PROPERTIES SUFFIX "-mt.js")
else()
set_target_properties(shards PROPERTIES SUFFIX "-st.js")
endif()

target_link_options(shards PUBLIC
"-sMODULARIZE=1"
"-sEXPORT_NAME=shards"
"-sNO_EXIT_RUNTIME=1"
"-sALLOW_MEMORY_GROWTH=1"
)
endif()

# Apple Framework target
if(APPLE)
add_library(shards-framework SHARED ${shards_SOURCES})
add_library(shards-framework SHARED ${cli_SOURCES})
setup_shards_target(shards-framework)

# Framework specific settings
Expand Down Expand Up @@ -114,3 +89,17 @@ if(APPLE)

target_link_libraries(shards-framework shards-cpp-union)
endif()

if(EMSCRIPTEN)
if(EMSCRIPTEN_PTHREADS)
set_target_properties(shards PROPERTIES SUFFIX "-mt.js")
else()
set_target_properties(shards PROPERTIES SUFFIX "-st.js")
endif()

target_link_options(shards PUBLIC
"SHELL:-s MODULARIZE=1"
"SHELL:-s EXPORT_NAME=shards"
"SHELL:-s NO_EXIT_RUNTIME=1"
)
endif()
17 changes: 17 additions & 0 deletions shards/cli/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* SPDX-License-Identifier: MPL-2.0 */
/* Copyright © 2019 Fragcolor Pte. Ltd. */

#include <shards/lang/bindings.h>
#include <shards/core/utils.hpp>
// #include <shards/core/foundation.hpp>
#include <boost/filesystem.hpp>

int main(int argc, const char *argv[]) {
using namespace shards::literals;
shards::pushThreadName("Main Thread"_ns);
shards::parseArguments(argc, argv);

// Functionality is defined in shards-lang rust crate
auto result = shards_process_args(argc, const_cast<char **>(argv), false);
return result;
}
Loading

0 comments on commit f73930f

Please sign in to comment.