add cmake target for c extension sample

This commit is contained in:
scawful
2024-08-08 22:49:49 -04:00
parent 215d3334ac
commit dece918957
2 changed files with 28 additions and 9 deletions

View File

@@ -7,10 +7,28 @@ target_include_directories(
yaze_ext PUBLIC
lib/
app/
${CMAKE_SOURCE_DIR}/src/
/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/Headers
)
target_link_libraries(
yaze_ext PUBLIC
Python
)
# C Sample
add_library(
yaze_ext_c SHARED
ext/sample.c
)
target_include_directories(
yaze_ext_c PUBLIC
lib/
${CMAKE_SOURCE_DIR}/src/
)
target_link_libraries(
yaze_ext_c PUBLIC
yaze_ext
)

View File

@@ -14,13 +14,14 @@ void my_extension_manipulate_rom(z3_rom* rom) {
}
yaze_extension* get_yaze_extension() {
static yaze_extension ext = {
"My Extension", "1.0",
my_extension_initialize,
my_extension_cleanup,
nullptr,
nullptr,
my_extension_manipulate_rom
};
return &ext;
static yaze_extension ext = {
"My Extension",
"1.0",
my_extension_initialize, // Initialization function
my_extension_cleanup, // Cleanup function
NULL, // extend_functionality
NULL, // render_ui
my_extension_manipulate_rom // manipulate_rom
};
return &ext;
}