Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #1

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
9 changes: 7 additions & 2 deletions Examples/Vehicles/base/InlineWrapperHints.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@
// Source for that documentation is in "GXFront/gxDocumentation.cxx"
//
#ifdef IWH_USE_GCCXML_ATTRIBUTE
#define gxa(x) __attribute((gccxml(#x)))
#define gxa(x) __attribute((gccxml(#x)))
#else
#define gxa(x)
//if being "built" with castxml, use the annotate attribute:
#ifdef __CASTXML__
#define gxa(x) __attribute((annotate(#x)))
#else
#define gxa(x)
#endif
#endif

//----------------------------------------------------------------------------
Expand Down
22 changes: 18 additions & 4 deletions Examples/Vehicles/wrappers/csharpmummy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,22 @@ MACRO(WRAP_KIT kit lang ext)
SET(${kit}_${lang}_wrapper_source_files "")
SET(${kit}_${lang}_wrapper_source_files_cmake "")
SET(${kit}_EL_SOURCES "")

IF(${gccxml_EXECUTABLE} MATCHES "castxml")
SET(executable_output -o ${CMAKE_CURRENT_BINARY_DIR})

IF(MSVC)
SET(compiler msvc)
ELSE(MSVC)
SET(compiler gnu)
ENDIF(MSVC)

SET(executable_options --castxml-start _cable_ --castxml-gccxml --castxml-cc-${compiler} ${CMAKE_CXX_COMPILER} -D__CASTXML__)
ELSE(${gccxml_EXECUTABLE} MATCHES "castxml")
SET(executable_output -fxml=${CMAKE_CURRENT_BINARY_DIR})
SET(executable_options -fxml-start=_cable_ --gccxml-compiler ${CMAKE_CXX_COMPILER})
ENDIF(${gccxml_EXECUTABLE} MATCHES "castxml")

FOREACH(cxxclass ${class_list})
SET(header "${cxxclass}.h")

Expand All @@ -78,15 +94,13 @@ MACRO(WRAP_KIT kit lang ext)
IF(EXISTS "${${kit}_include_dirs}/${cxxclass}.h")
SET(header_fullpath "${${kit}_include_dirs}/${cxxclass}.h")
ENDIF(EXISTS "${${kit}_include_dirs}/${cxxclass}.h")

ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml
COMMAND ${gccxml_EXECUTABLE}
ARGS
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml
-fxml-start=_cable_
${executable_output}/xml/${cxxclass}.xml
${executable_options}
${gccxml_include_args} -DCABLE_CONFIGURATION
--gccxml-compiler ${CMAKE_CXX_COMPILER}
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static void TestBlatMobile(BlatMobile b1)
b1.VUnsignedInt(0x2222);
b1.VUnsignedLong(0x33333333);
b1.VUnsignedInt64(0x4444444444444444);
b1.VChar((sbyte)'b');
b1.VChar((byte)'b');
b1.VShort(0x55);
b1.VInt(0x6666);
b1.VLong(0x77777777);
Expand Down
28 changes: 21 additions & 7 deletions MummyCMakeMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,21 @@ MACRO(WRAP_CLASSES_FOR_CSHARP wcfc_WrappedLibName wcfc_DependentTargets wcfc_Dep
SET(wcfc_ExportLayerFiles "")
SET(wcfc_GccxmlIncludes "")

IF(${gccxml_EXECUTABLE} MATCHES "castxml")
SET(executable_output -o ${wcfc_BinDir})

IF(MSVC)
SET(compiler msvc)
ELSE(MSVC)
SET(compiler gnu)
ENDIF(MSVC)

SET(executable_options --castxml-start _cable_ --castxml-gccxml --castxml-cc-${compiler} ${CMAKE_CXX_COMPILER} -D__CASTXML__)
ELSE(${gccxml_EXECUTABLE} MATCHES "castxml")
SET(executable_output -fxml=${wcfc_BinDir})
SET(executable_options -fxml-start=_cable_ --gccxml-compiler ${CMAKE_CXX_COMPILER})
ENDIF(${gccxml_EXECUTABLE} MATCHES "castxml")

FOREACH(instruction ${ARGN})
IF("${instruction}" MATCHES "(.+),(.+)")
STRING(REGEX REPLACE "(.+),(.+)" "\\1" wcfc_Class "${instruction}")
Expand All @@ -319,7 +334,7 @@ MACRO(WRAP_CLASSES_FOR_CSHARP wcfc_WrappedLibName wcfc_DependentTargets wcfc_Dep
SET(wcfc_ClassName "${wcfc_Class}")
ENDIF("${wcfc_Class}" MATCHES "^.*::([^:]+)$")

SET(wcfc_GccxmlFile "${wcfc_BinDir}/xml/${wcfc_FileBaseName}.xml")
SET(wcfc_GccxmlFile "/xml/${wcfc_FileBaseName}.xml")
SET(wcfc_CsharpFile "${wcfc_BinDir}/csharp/${wcfc_FileBaseName}.cs")
SET(wcfc_ExportLayerFile "${wcfc_BinDir}/export-layer/${wcfc_FileBaseName}EL.cxx")

Expand All @@ -330,14 +345,13 @@ MACRO(WRAP_CLASSES_FOR_CSHARP wcfc_WrappedLibName wcfc_DependentTargets wcfc_Dep
)

ADD_CUSTOM_COMMAND(
OUTPUT ${wcfc_GccxmlFile}
OUTPUT ${wcfc_BinDir}${wcfc_GccxmlFile}
COMMAND ${gccxml_EXECUTABLE}
ARGS
-fxml=${wcfc_GccxmlFile}
-fxml-start=_cable_
${executable_output}${wcfc_GccxmlFile}
${executable_options}
${wcfc_GccxmlIncludes}
-DCABLE_CONFIGURATION
--gccxml-compiler ${CMAKE_CXX_COMPILER}
${wcfc_BinDir}/xml/${wcfc_FileBaseName}_gccxml.cxx
DEPENDS
${wcfc_BinDir}/xml/${wcfc_FileBaseName}_gccxml.cxx
Expand All @@ -350,12 +364,12 @@ MACRO(WRAP_CLASSES_FOR_CSHARP wcfc_WrappedLibName wcfc_DependentTargets wcfc_Dep
COMMAND ${mummy_EXECUTABLE}
ARGS
--settings-file ${wcfc_BinDir}/xml/${wcfc_WrappedLibName}.MummySettings.xml
--gccxml-file ${wcfc_GccxmlFile}
--gccxml-file ${wcfc_BinDir}${wcfc_GccxmlFile}
--csharp-file ${wcfc_CsharpFile}
--export-layer-file ${wcfc_ExportLayerFile}
DEPENDS
${wcfc_BinDir}/xml/${wcfc_WrappedLibName}.MummySettings.xml
${wcfc_GccxmlFile}
${wcfc_BinDir}${wcfc_GccxmlFile}
${mummy_EXECUTABLE}
)

Expand Down
Loading