Migrate examples to castxml migrate-to-castxml
authorLudwig Jäck <ludwig.jaeck@intra2net.com>
Thu, 6 Jun 2024 09:29:20 +0000 (11:29 +0200)
committerLudwig Jäck <ludwig.jaeck@intra2net.com>
Fri, 7 Jun 2024 08:02:01 +0000 (10:02 +0200)
examples/CMakeLists.txt
examples/minimalistic-stub.hxx

index a5a3396..7421f18 100644 (file)
@@ -35,10 +35,9 @@ get_property(gcc_include_dirs
     DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
     PROPERTY INCLUDE_DIRECTORIES
 )
-foreach(gcc_include_dir ${gcc_include_dirs})
-    set(gccxml_include_dirs "${gccxml_include_dirs} -I${gcc_include_dir}")
-endforeach()
+list(TRANSFORM gcc_include_dirs PREPEND "-I")
+
 add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/minimalistic-server.xml
-    COMMAND ${CMAKE_SOURCE_DIR}/libt2n-gccxml.sh ${gccxml_include_dirs} ${CMAKE_CURRENT_SOURCE_DIR}/minimalistic-server.cpp -fxml=${CMAKE_CURRENT_SOURCE_DIR}/minimalistic-server.xml
+    COMMAND /usr/bin/castxml ${gcc_include_dirs} ${CMAKE_CURRENT_SOURCE_DIR}/minimalistic-server.cpp -fxml=${CMAKE_CURRENT_SOURCE_DIR}/minimalistic-server.xml
     DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/minimalistic-server.cpp
 )
index 7516a31..d0beb3b 100644 (file)
 #include <t2n_exception.hxx>
 #include <command.hxx>
 
-#ifdef __GCCXML__
-#define LIBT2N_SET_DEFAULTGROUP(x) namespace { typedef __attribute((gccxml(#x))) int libt2n_default; }
-#define LIBT2N_EXPORT __attribute((gccxml("libt2n-default")))
-#define LIBT2N_EXPORT_GROUP(group) __attribute((gccxml("libt2n-"#group)))
+#ifdef __castxml__
+#define LIBT2N_SET_DEFAULTGROUP(x) namespace { typedef __attribute__((annotate(#x))) int libt2n_default; }
+#define LIBT2N_EXPORT __attribute__((annotate("libt2n-default")))
+#define LIBT2N_EXPORT_GROUP(group) __attribute__((annotate("libt2n-"#group)))
 #else
 #define LIBT2N_SET_DEFAULTGROUP(x)
 #define LIBT2N_EXPORT