Skip to content

Commit

Permalink
Make application of STL wrappers more fine grained
Browse files Browse the repository at this point in the history
  • Loading branch information
barche committed Nov 6, 2024
1 parent 587f9fe commit 01fb872
Show file tree
Hide file tree
Showing 18 changed files with 362 additions and 395 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-linux-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
rm -f /opt/hostedtoolcache/julia/1.6*/x64/lib/julia/libstdc++.so.6
fi
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=$HOME/install -DAPPEND_OVERRIDES_TOML=ON -DCMAKE_BUILD_TYPE=Debug ..
CXXFLAGS=-ftemplate-backtrace-limit=0 cmake -DCMAKE_INSTALL_PREFIX=$HOME/install -DAPPEND_OVERRIDES_TOML=ON -DCMAKE_BUILD_TYPE=Debug ..
VERBOSE=ON cmake --build . --config Debug --target install
wget https://github.com/JuliaBinaryWrappers/libcxxwrap_julia_jll.jl/raw/main/Project.toml
jllversion=$(grep "version" Project.toml | sed -r 's/.* = "(.*)\+.*/\1/')
Expand Down
3 changes: 3 additions & 0 deletions examples/types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,9 @@ JLCXX_MODULE define_julia_module(jlcxx::Module& types)
types.method("get_custom_nb_deletes", [] () { return UseCustomDelete::nb_deleted; });
types.add_type<UseCustomClassDelete>("UseCustomClassDelete");
types.method("get_custom_class_nb_deletes", [] () { return UseCustomClassDelete::nb_deleted; });

types.method("world_dequeue", []() { static World w; return std::deque({w}); });
types.method("world_list", []() { static World w; return std::list({w}); });
}

JLCXX_MODULE define_types2_module(jlcxx::Module& types2)
Expand Down
9 changes: 7 additions & 2 deletions include/jlcxx/jlcxx_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@
#define __JLCXX_STR(x) __JLCXX_STR_HELPER(x)
#define JLCXX_VERSION_STRING __JLCXX_STR(JLCXX_VERSION_MAJOR) "." __JLCXX_STR(JLCXX_VERSION_MINOR) "." __JLCXX_STR(JLCXX_VERSION_PATCH)

#if defined(__has_include) && !defined(__FreeBSD__) && !defined(JLCXX_FORCE_RANGES_OFF)
# if __has_include (<ranges>)
// Apple Clang doesn't really support ranges fully until __cpp_lib_ranges==202207L (AppleClang 16)
#if defined(__cpp_lib_ranges) && !defined(JLCXX_FORCE_RANGES_OFF)
# if defined(__clang__) && defined(__apple_build_version__)
# if __cpp_lib_ranges >= 202207L
# define JLCXX_HAS_RANGES
# endif
# elif __cpp_lib_ranges >= 201911L
# define JLCXX_HAS_RANGES
# endif
#endif
Expand Down
Loading

0 comments on commit 01fb872

Please sign in to comment.