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 yaze_ext PUBLIC
lib/ lib/
app/ app/
${CMAKE_SOURCE_DIR}/src/
/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/Headers /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/Headers
) )
target_link_libraries( target_link_libraries(
yaze_ext PUBLIC yaze_ext PUBLIC
Python 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() { yaze_extension* get_yaze_extension() {
static yaze_extension ext = { static yaze_extension ext = {
"My Extension", "1.0", "My Extension",
my_extension_initialize, "1.0",
my_extension_cleanup, my_extension_initialize, // Initialization function
nullptr, my_extension_cleanup, // Cleanup function
nullptr, NULL, // extend_functionality
my_extension_manipulate_rom NULL, // render_ui
}; my_extension_manipulate_rom // manipulate_rom
return &ext; };
return &ext;
} }