-
Notifications
You must be signed in to change notification settings - Fork 39
fix: Replicates SPM default behavior for publicHeadersPath: If this is nil, the directory is set to include #1429
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
Open
0xLucasMarcal
wants to merge
19
commits into
cgrindel:main
Choose a base branch
from
0xLucasMarcal:lucasmarcal/copy-spm-public-headers-folder-search-when-not-specified
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
a22ed30
Support System Library
0xLucasMarcal a9fe850
allow string literal to module name
0xLucasMarcal 0eb849b
remove debug code
0xLucasMarcal c66dc7d
Add all headers listed in clang lib modulemap
0xLucasMarcal 5b2ad2e
add linkopts to swift target build file
0xLucasMarcal 745c67b
fix public header folder search
0xLucasMarcal 9e85019
comment
0xLucasMarcal 7583f75
accept multiple modulemap files but keep the one in include folder
0xLucasMarcal 57498e3
Merge branch 'cgrindel-main' into merge-main-into-fork
0xLucasMarcal 4662b0d
add extra fixes
0xLucasMarcal 2a58117
remove extra changes
0xLucasMarcal a20242c
Public Headers path: If this is nil, the directory is set to include
0xLucasMarcal f63fde0
Combine include path search with public_hdrs_path check
0xLucasMarcal b226d96
add new clang lib to pkg_manifest_minimal
0xLucasMarcal 0b68a78
Update examples/pkg_manifest_minimal/Package.swift
0xLucasMarcal 3338533
Merge branch 'main' into lucasmarcal/copy-spm-public-headers-folder-s…
0xLucasMarcal cbdf598
Merge branch 'main' into lucasmarcal/copy-spm-public-headers-folder-s…
0xLucasMarcal 3f574e5
undo pkg_manifest_minimal tests changes
0xLucasMarcal a361928
Merge branch 'cgrindel-main' into lucasmarcal/copy-spm-public-headers…
0xLucasMarcal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
name: //Sources/MyExecutable | ||
kind: swift_binary | ||
imports: | ||
- ArgumentParser | ||
- FarewellFramework | ||
- GreetingsFramework | ||
- MyLibrary | ||
- NotThatAmazingModule | ||
local_resolution: | ||
- module: MyLibrary | ||
label: //Sources/MyLibrary | ||
external_resolution: | ||
modules: | ||
- ArgumentParser | ||
- FarewellFramework | ||
- GreetingsFramework | ||
- NotThatAmazingModule | ||
products: | ||
- identity: my_local_package | ||
name: FarewellFramework | ||
label: '@swiftpkg_my_local_package//:FarewellFramework' | ||
- identity: my_local_package | ||
name: GreetingsFramework | ||
label: '@swiftpkg_my_local_package//:GreetingsFramework' | ||
- identity: notthatamazingmodule | ||
name: NotThatAmazingModule | ||
label: '@swiftpkg_notthatamazingmodule//:NotThatAmazingModule' | ||
- identity: swift-argument-parser | ||
name: ArgumentParser | ||
label: '@swiftpkg_swift_argument_parser//:ArgumentParser' | ||
unresolved: [] | ||
deps: | ||
- //Sources/MyLibrary | ||
- '@swiftpkg_my_local_package//:FarewellFramework' | ||
- '@swiftpkg_my_local_package//:GreetingsFramework' | ||
- '@swiftpkg_notthatamazingmodule//:NotThatAmazingModule' | ||
- '@swiftpkg_swift_argument_parser//:ArgumentParser' | ||
--- | ||
name: //Sources/MyLibrary | ||
kind: swift_library | ||
imports: | ||
- GreetingsFramework | ||
external_resolution: | ||
modules: | ||
- GreetingsFramework | ||
products: | ||
- identity: my_local_package | ||
name: GreetingsFramework | ||
label: '@swiftpkg_my_local_package//:GreetingsFramework' | ||
unresolved: [] | ||
deps: | ||
- '@swiftpkg_my_local_package//:GreetingsFramework' | ||
--- | ||
name: //Tests/MyLibraryTests | ||
kind: swift_test | ||
imports: | ||
- MyLibrary | ||
- XCTest | ||
builtins: | ||
- XCTest | ||
local_resolution: | ||
- module: MyLibrary | ||
label: //Sources/MyLibrary | ||
external_resolution: | ||
modules: | ||
- XCTest | ||
products: [] | ||
unresolved: | ||
- XCTest | ||
deps: | ||
- //Sources/MyLibrary |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
...nimal/third_party/my_local_package/Sources/FarewellFramework/include/MyClangLibrary/API.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#ifndef MYCLANG_LIBRARY_API_H | ||
#define MYCLANG_LIBRARY_API_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/* Version information */ | ||
#define MYCLANG_VERSION_MAJOR 1 | ||
#define MYCLANG_VERSION_MINOR 0 | ||
#define MYCLANG_VERSION_PATCH 0 | ||
|
||
/* Maximum buffer sizes */ | ||
#define MYCLANG_MAX_NAME_LENGTH 256 | ||
#define MYCLANG_MAX_BUFFER_SIZE 4096 | ||
|
||
/* Status codes */ | ||
typedef enum { | ||
MYCLANG_SUCCESS = 0, | ||
MYCLANG_ERROR_INVALID_ARGUMENT = -1, | ||
MYCLANG_ERROR_BUFFER_OVERFLOW = -2, | ||
MYCLANG_ERROR_NOT_INITIALIZED = -3 | ||
} MyclangStatus; | ||
|
||
/* Farewell message types */ | ||
typedef enum { | ||
MYCLANG_FAREWELL_GOODBYE = 0, | ||
MYCLANG_FAREWELL_PARTING = 1, | ||
MYCLANG_FAREWELL_SEE_YOU_LATER = 2, | ||
MYCLANG_FAREWELL_TAKE_CARE = 3, | ||
MYCLANG_FAREWELL_ADIEU = 4, | ||
MYCLANG_FAREWELL_DEPARTURE = 5 | ||
} MyclangFarewellType; | ||
|
||
/* Data structures */ | ||
typedef struct { | ||
char name[MYCLANG_MAX_NAME_LENGTH]; | ||
unsigned int id; | ||
double value; | ||
} MyclangObject; | ||
|
||
/* Function declarations */ | ||
MyclangStatus myclang_initialize(void); | ||
MyclangStatus myclang_cleanup(void); | ||
|
||
MyclangStatus myclang_create_object(MyclangObject* obj, | ||
const char* name, | ||
unsigned int id, | ||
double value); | ||
|
||
MyclangStatus myclang_process_object(const MyclangObject* obj); | ||
|
||
const char* myclang_get_version_string(void); | ||
|
||
/* Farewell function */ | ||
const char* myclang_get_farewell_message(MyclangFarewellType type); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* MYCLANG_LIBRARY_API_H */ |
86 changes: 86 additions & 0 deletions
86
...les/pkg_manifest_minimal/third_party/my_local_package/Sources/FarewellFramework/src/lib.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
#include <string.h> | ||
#include <stdio.h> | ||
#include "MyClangLibrary/API.h" | ||
|
||
static int g_initialized = 0; | ||
|
||
MyclangStatus myclang_initialize(void) { | ||
if (g_initialized) { | ||
return MYCLANG_ERROR_INVALID_ARGUMENT; | ||
} | ||
g_initialized = 1; | ||
return MYCLANG_SUCCESS; | ||
} | ||
|
||
MyclangStatus myclang_cleanup(void) { | ||
if (!g_initialized) { | ||
return MYCLANG_ERROR_NOT_INITIALIZED; | ||
} | ||
g_initialized = 0; | ||
return MYCLANG_SUCCESS; | ||
} | ||
|
||
MyclangStatus myclang_create_object(MyclangObject* obj, | ||
const char* name, | ||
unsigned int id, | ||
double value) { | ||
if (!g_initialized) { | ||
return MYCLANG_ERROR_NOT_INITIALIZED; | ||
} | ||
|
||
if (!obj || !name) { | ||
return MYCLANG_ERROR_INVALID_ARGUMENT; | ||
} | ||
|
||
if (strlen(name) >= MYCLANG_MAX_NAME_LENGTH) { | ||
return MYCLANG_ERROR_BUFFER_OVERFLOW; | ||
} | ||
|
||
strncpy(obj->name, name, MYCLANG_MAX_NAME_LENGTH - 1); | ||
obj->name[MYCLANG_MAX_NAME_LENGTH - 1] = '\0'; | ||
obj->id = id; | ||
obj->value = value; | ||
|
||
return MYCLANG_SUCCESS; | ||
} | ||
|
||
MyclangStatus myclang_process_object(const MyclangObject* obj) { | ||
if (!g_initialized) { | ||
return MYCLANG_ERROR_NOT_INITIALIZED; | ||
} | ||
|
||
if (!obj) { | ||
return MYCLANG_ERROR_INVALID_ARGUMENT; | ||
} | ||
|
||
// Example processing - in real implementation, this would do something useful | ||
return MYCLANG_SUCCESS; | ||
} | ||
|
||
const char* myclang_get_version_string(void) { | ||
static char version[32]; | ||
snprintf(version, sizeof(version), "%d.%d.%d", | ||
MYCLANG_VERSION_MAJOR, | ||
MYCLANG_VERSION_MINOR, | ||
MYCLANG_VERSION_PATCH); | ||
return version; | ||
} | ||
|
||
const char* myclang_get_farewell_message(MyclangFarewellType type) { | ||
switch (type) { | ||
case MYCLANG_FAREWELL_GOODBYE: | ||
return "Goodbye"; | ||
case MYCLANG_FAREWELL_PARTING: | ||
return "Parting"; | ||
case MYCLANG_FAREWELL_SEE_YOU_LATER: | ||
return "See you later"; | ||
case MYCLANG_FAREWELL_TAKE_CARE: | ||
return "Take care"; | ||
case MYCLANG_FAREWELL_ADIEU: | ||
return "Adieu"; | ||
case MYCLANG_FAREWELL_DEPARTURE: | ||
return "Departure"; | ||
default: | ||
return "Goodbye"; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
examples/pkg_manifest_minimal/third_party/my_local_package/Sources/PrintFarewell/main.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import FarewellFramework | ||
|
||
let message = FarewellFramework.myclang_get_farewell_message(MYCLANG_FAREWELL_SEE_YOU_LATER) | ||
|
||
let swiftString = String(cString: message!) | ||
|
||
print(swiftString) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.