parent
ac79eebc2f
commit
a655b64989
7 changed files with 108 additions and 6 deletions
@ -0,0 +1,6 @@ |
|||||||
|
#include"alexandria.h" |
||||||
|
#include<stdio.h> |
||||||
|
|
||||||
|
void alexandria_visit() { |
||||||
|
printf("You are surrounded by wisdom and knowledge. You feel enlightened.\n"); |
||||||
|
} |
@ -0,0 +1,20 @@ |
|||||||
|
#pragma once |
||||||
|
|
||||||
|
/* Both funcs here for simplicity. */ |
||||||
|
|
||||||
|
#if defined _WIN32 || defined __CYGWIN__ |
||||||
|
#if defined BUILDING_DLL |
||||||
|
#define DLL_PUBLIC __declspec(dllexport) |
||||||
|
#else |
||||||
|
#define DLL_PUBLIC __declspec(dllimport) |
||||||
|
#endif |
||||||
|
#else |
||||||
|
#if defined __GNUC__ |
||||||
|
#define DLL_PUBLIC __attribute__ ((visibility("default"))) |
||||||
|
#else |
||||||
|
#pragma message ("Compiler does not support symbol visibility.") |
||||||
|
#define DLL_PUBLIC |
||||||
|
#endif |
||||||
|
#endif |
||||||
|
|
||||||
|
void DLL_PUBLIC alexandria_visit(); |
@ -0,0 +1,10 @@ |
|||||||
|
#include<alexandria.h> |
||||||
|
#include<stdio.h> |
||||||
|
|
||||||
|
int main(int argc, char **argv) { |
||||||
|
printf("Ahh, another visitor. Stay a while.\n"); |
||||||
|
printf("You enter the library.\n\n"); |
||||||
|
alexandria_visit(); |
||||||
|
printf("\nYou decided not to stay forever.\n"); |
||||||
|
return 0; |
||||||
|
} |
@ -0,0 +1,14 @@ |
|||||||
|
project('prebuilt shared library', 'c') |
||||||
|
|
||||||
|
cc = meson.get_compiler('c') |
||||||
|
shlib = cc.find_library('alexandria', dirs : meson.current_source_dir()) |
||||||
|
|
||||||
|
exe = executable('patron', 'patron.c', dependencies : shlib) |
||||||
|
test('visitation', exe) |
||||||
|
|
||||||
|
d = declare_dependency(dependencies : shlib) |
||||||
|
|
||||||
|
exe2 = executable('another_visitor', 'another_visitor.c', |
||||||
|
dependencies : d) |
||||||
|
test('another', exe2) |
||||||
|
|
@ -0,0 +1,8 @@ |
|||||||
|
#include<alexandria.h> |
||||||
|
#include<stdio.h> |
||||||
|
|
||||||
|
int main(int argc, char **argv) { |
||||||
|
printf("You are standing outside the Great Library of Alexandria.\n"); |
||||||
|
printf("You decide to go inside.\n\n"); |
||||||
|
alexandria_visit(); |
||||||
|
} |
Loading…
Reference in new issue