summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorAmlal <amlal@nekernel.org>2025-05-08 13:38:22 +0200
committerAmlal <amlal@nekernel.org>2025-05-08 13:38:22 +0200
commit9a574e0a95d5e353e50c000cc723ebc6dacfc0a0 (patch)
tree326989c95a0e4c2f68ae53734a0e3a4fcb1645d0 /examples
parente79c5ed3500e155e551dcb216c6845687c7fd4a9 (diff)
feat(lib): add equiv.hpp C++ header, see commit details.
Signed-off-by: Amlal <amlal@nekernel.org>
Diffstat (limited to 'examples')
-rw-r--r--examples/equiv/CMakeLists.txt12
-rw-r--r--examples/equiv/Makefile181
-rw-r--r--examples/equiv/equiv.cc18
3 files changed, 211 insertions, 0 deletions
diff --git a/examples/equiv/CMakeLists.txt b/examples/equiv/CMakeLists.txt
new file mode 100644
index 0000000..a8ed6d3
--- /dev/null
+++ b/examples/equiv/CMakeLists.txt
@@ -0,0 +1,12 @@
+
+cmake_minimum_required(VERSION 3.15...3.31)
+
+project(
+ Equiv
+ VERSION 1.0
+ LANGUAGES CXX)
+
+add_executable(Equiv equiv.cc)
+
+set_property(TARGET Equiv PROPERTY CXX_STANDARD 20)
+target_include_directories(Equiv PUBLIC ../../lib)
diff --git a/examples/equiv/Makefile b/examples/equiv/Makefile
new file mode 100644
index 0000000..9243de2
--- /dev/null
+++ b/examples/equiv/Makefile
@@ -0,0 +1,181 @@
+# CMAKE generated file: DO NOT EDIT!
+# Generated by "Unix Makefiles" Generator, CMake Version 3.28
+
+# Default target executed when no arguments are given to make.
+default_target: all
+.PHONY : default_target
+
+# Allow only one "make -f Makefile2" at a time, but pass parallelism.
+.NOTPARALLEL:
+
+#=============================================================================
+# Special targets provided by cmake.
+
+# Disable implicit rules so canonical targets will work.
+.SUFFIXES:
+
+# Disable VCS-based implicit rules.
+% : %,v
+
+# Disable VCS-based implicit rules.
+% : RCS/%
+
+# Disable VCS-based implicit rules.
+% : RCS/%,v
+
+# Disable VCS-based implicit rules.
+% : SCCS/s.%
+
+# Disable VCS-based implicit rules.
+% : s.%
+
+.SUFFIXES: .hpux_make_needs_suffix_list
+
+# Command-line flag to silence nested $(MAKE).
+$(VERBOSE)MAKESILENT = -s
+
+#Suppress display of executed commands.
+$(VERBOSE).SILENT:
+
+# A target that is always out of date.
+cmake_force:
+.PHONY : cmake_force
+
+#=============================================================================
+# Set environment variables for the build.
+
+# The shell in which to execute make rules.
+SHELL = /bin/sh
+
+# The CMake executable.
+CMAKE_COMMAND = /usr/bin/cmake
+
+# The command to remove a file.
+RM = /usr/bin/cmake -E rm -f
+
+# Escaping for special characters.
+EQUALS = =
+
+# The top-level source directory on which CMake was run.
+CMAKE_SOURCE_DIR = /home/amlal/amlal-el-mahrouss/astdx/examples/equiv
+
+# The top-level build directory on which CMake was run.
+CMAKE_BINARY_DIR = /home/amlal/amlal-el-mahrouss/astdx/examples/equiv
+
+#=============================================================================
+# Targets provided globally by CMake.
+
+# Special rule for the target edit_cache
+edit_cache:
+ @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "No interactive CMake dialog available..."
+ /usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available.
+.PHONY : edit_cache
+
+# Special rule for the target edit_cache
+edit_cache/fast: edit_cache
+.PHONY : edit_cache/fast
+
+# Special rule for the target rebuild_cache
+rebuild_cache:
+ @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Running CMake to regenerate build system..."
+ /usr/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
+.PHONY : rebuild_cache
+
+# Special rule for the target rebuild_cache
+rebuild_cache/fast: rebuild_cache
+.PHONY : rebuild_cache/fast
+
+# The main all target
+all: cmake_check_build_system
+ $(CMAKE_COMMAND) -E cmake_progress_start /home/amlal/amlal-el-mahrouss/astdx/examples/equiv/CMakeFiles /home/amlal/amlal-el-mahrouss/astdx/examples/equiv//CMakeFiles/progress.marks
+ $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 all
+ $(CMAKE_COMMAND) -E cmake_progress_start /home/amlal/amlal-el-mahrouss/astdx/examples/equiv/CMakeFiles 0
+.PHONY : all
+
+# The main clean target
+clean:
+ $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 clean
+.PHONY : clean
+
+# The main clean target
+clean/fast: clean
+.PHONY : clean/fast
+
+# Prepare targets for installation.
+preinstall: all
+ $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall
+.PHONY : preinstall
+
+# Prepare targets for installation.
+preinstall/fast:
+ $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall
+.PHONY : preinstall/fast
+
+# clear depends
+depend:
+ $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
+.PHONY : depend
+
+#=============================================================================
+# Target rules for targets named Equiv
+
+# Build rule for target.
+Equiv: cmake_check_build_system
+ $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 Equiv
+.PHONY : Equiv
+
+# fast build rule for target.
+Equiv/fast:
+ $(MAKE) $(MAKESILENT) -f CMakeFiles/Equiv.dir/build.make CMakeFiles/Equiv.dir/build
+.PHONY : Equiv/fast
+
+equiv.o: equiv.cc.o
+.PHONY : equiv.o
+
+# target to build an object file
+equiv.cc.o:
+ $(MAKE) $(MAKESILENT) -f CMakeFiles/Equiv.dir/build.make CMakeFiles/Equiv.dir/equiv.cc.o
+.PHONY : equiv.cc.o
+
+equiv.i: equiv.cc.i
+.PHONY : equiv.i
+
+# target to preprocess a source file
+equiv.cc.i:
+ $(MAKE) $(MAKESILENT) -f CMakeFiles/Equiv.dir/build.make CMakeFiles/Equiv.dir/equiv.cc.i
+.PHONY : equiv.cc.i
+
+equiv.s: equiv.cc.s
+.PHONY : equiv.s
+
+# target to generate assembly for a file
+equiv.cc.s:
+ $(MAKE) $(MAKESILENT) -f CMakeFiles/Equiv.dir/build.make CMakeFiles/Equiv.dir/equiv.cc.s
+.PHONY : equiv.cc.s
+
+# Help Target
+help:
+ @echo "The following are some of the valid targets for this Makefile:"
+ @echo "... all (the default if no target is provided)"
+ @echo "... clean"
+ @echo "... depend"
+ @echo "... edit_cache"
+ @echo "... rebuild_cache"
+ @echo "... Equiv"
+ @echo "... equiv.o"
+ @echo "... equiv.i"
+ @echo "... equiv.s"
+.PHONY : help
+
+
+
+#=============================================================================
+# Special targets to cleanup operation of make.
+
+# Special rule to run CMake to check the build system integrity.
+# No rule that depends on this can have commands that come from listfiles
+# because they might be regenerated.
+cmake_check_build_system:
+ $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
+.PHONY : cmake_check_build_system
+
diff --git a/examples/equiv/equiv.cc b/examples/equiv/equiv.cc
new file mode 100644
index 0000000..7375512
--- /dev/null
+++ b/examples/equiv/equiv.cc
@@ -0,0 +1,18 @@
+/*
+ string checksum example
+ written by Amlal El Mahrouss.
+ licensed under GPL-2 license
+ */
+
+#include <astdx/equiv.hpp>
+#include <iostream>
+
+/* finally test it */
+int main(int argc, char** argv)
+{
+ std::cout << std::boolalpha << astdx::is_same<bool, int>::value << std::endl;
+ std::cout << std::boolalpha << astdx::is_same<bool, bool>::value << std::endl;
+ std::cout << std::boolalpha << astdx::is_same<int, int>::value << std::endl;
+
+ return 0;
+}