-
-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Futrime
committed
Nov 22, 2023
1 parent
ae5ac04
commit 96f2484
Showing
2 changed files
with
46 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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 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,37 @@ | ||
import os | ||
import shutil | ||
|
||
# Get script directory | ||
script_dir = os.path.dirname(os.path.realpath(__file__)) | ||
|
||
# Calculate source directory | ||
source_dir = os.path.join(script_dir, "..", "src") | ||
|
||
# Calculate include directory | ||
include_dir = os.path.join(script_dir, "..", "include") | ||
|
||
# Remove include directory | ||
if os.path.exists(include_dir): | ||
shutil.rmtree(include_dir) | ||
|
||
# Create include directory | ||
os.mkdir(include_dir) | ||
|
||
# Copy all header files recursively | ||
for root, dirs, files in os.walk(source_dir): | ||
for file in files: | ||
if file.endswith(".h"): | ||
# Calculate source file path | ||
source_file = os.path.join(root, file) | ||
|
||
# Calculate relative path | ||
relative_path = os.path.relpath(source_file, source_dir) | ||
|
||
# Calculate include file path | ||
include_file = os.path.join(include_dir, relative_path) | ||
|
||
# Create include directory | ||
os.makedirs(os.path.dirname(include_file), exist_ok=True) | ||
|
||
# Copy file | ||
shutil.copy(source_file, include_file) |