@@ -36,48 +36,6 @@ struct SwContext;
3636template <class T >
3737struct ExecutionPlan ;
3838
39- namespace detail
40- {
41-
42- struct EventCallback
43- {
44- using BasicEventCallback = std::function<void (Target &t, CallbackType e)>;
45- using TypedEventCallback = std::function<void (Target &t)>;
46-
47- PackageIdSet pkgs;
48- std::set<CallbackType> types;
49- BasicEventCallback cb;
50- bool typed_cb = false ;
51-
52- void operator ()(Target &t, CallbackType e);
53-
54- template <class F , class ... Args>
55- void add (const F &a, Args &&... args)
56- {
57- if constexpr (std::is_same_v<F, BasicEventCallback> ||
58- std::is_convertible_v<F, BasicEventCallback>)
59- cb = a;
60- else if constexpr (std::is_same_v<F, TypedEventCallback> ||
61- std::is_convertible_v<F, TypedEventCallback>)
62- {
63- typed_cb = true ;
64- cb = [a](Target &t, CallbackType)
65- {
66- a (t);
67- };
68- }
69- else if constexpr (std::is_same_v<F, CallbackType>)
70- types.insert (a);
71- else
72- pkgs.insert (String (a));
73-
74- if constexpr (sizeof ...(Args) > 0 )
75- add (std::forward<Args>(args)...);
76- }
77- };
78-
79- }
80-
8139using FilesMap = std::unordered_map<path, path>;
8240
8341enum class FrontendType
@@ -116,7 +74,6 @@ struct ModuleSwappableData
11674 TargetSettings current_settings;
11775 BuildSettings bs;
11876 PackageIdSet known_targets;
119- std::vector<Target*> added_targets;
12077};
12178
12279struct PrepareConfigEntryPoint ;
@@ -194,19 +151,6 @@ struct SW_DRIVER_CPP_API Build : SimpleBuild
194151 const String &getCurrentModule () const ;
195152 void addChild (const TargetBaseTypePtr &t);
196153
197- // events
198- template <class ... Args>
199- void registerCallback (Args &&... args)
200- {
201- static_assert (sizeof ...(Args) != 0 , " Missing callback" );
202-
203- detail::EventCallback c;
204- c.add (std::forward<Args>(args)...);
205- events.push_back (c);
206- }
207- void call_event (Target &t, CallbackType et);
208- //
209-
210154 // tests
211155 // TODO: implement some of https://cmake.org/cmake/help/latest/manual/cmake-properties.7.html#properties-on-tests
212156 Commands tests;
@@ -249,8 +193,6 @@ struct SW_DRIVER_CPP_API Build : SimpleBuild
249193 Module loadModule (const path &fn) const ;
250194
251195private:
252- std::vector<detail::EventCallback> events;
253-
254196 // basic frontends
255197 void load_dll (const path &dll, const std::set<TargetSettings> &);
256198 void load_configless (const path &file_or_dir);
0 commit comments