Skip to content

Commit d33fc8e

Browse files
committed
fix: simplify build scripts
1 parent e31cb8b commit d33fc8e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+10593
-1044
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ endif()
88
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/version.txt" VERSION_FILE_CONTENTS)
99
string(STRIP "${VERSION_FILE_CONTENTS}" VERSION_FILE_CONTENTS)
1010
set(CPPLM_VERSION "${VERSION_FILE_CONTENTS}" CACHE STRING "Set version name")
11-
set(CPPLM_PACKAGE "plugify-module-cpp" CACHE STRING "Set package name")
11+
set(CPPLM_PACKAGE "cpp_module" CACHE STRING "Set package name")
1212
string(REPLACE "v" "" CPPLM_VERSION "${CPPLM_VERSION}")
1313
string(REGEX REPLACE "[.+-]" ";" CPPLM_VERSION_LIST ${CPPLM_VERSION})
1414
list(GET CPPLM_VERSION_LIST 0 CPPLM_VERSION_MAJOR)
@@ -44,7 +44,7 @@ set(PLUGIFY_BUILD_SHARED_LIB ON CACHE INTERNAL "")
4444
set(PLUGIFY_BUILD_TESTS OFF CACHE INTERNAL "")
4545
if(LINUX)
4646
set(PLUGIFY_USE_STATIC_STDLIB ON CACHE INTERNAL "")
47-
set(PLUGIFY_USE_ABI0 ON CACHE INTERNAL "")
47+
set(PLUGIFY_USE_ABI0 OFF CACHE INTERNAL "")
4848
endif()
4949
add_subdirectory(external/plugify)
5050

conda/bld.bat

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ REM bld.bat - For Windows builds
33

44
REM Create the target directories
55
if not exist "%PREFIX%\bin" mkdir "%PREFIX%\bin"
6-
if not exist "%PREFIX%" mkdir "%PREFIX%"
76

8-
REM Copy the DLL and module file
9-
copy bin\plugify-module-cpp.dll "%PREFIX%\bin\" || exit 1
10-
copy plugify-module-cpp.pmodule "%PREFIX%\" || exit 1
7+
REM Copy entire folders into %PREFIX
8+
xcopy bin "%PREFIX%\bin" /E /Y /I
9+
10+
REM Copy all .pmodule files into %PREFIX%
11+
copy *.pmodule "%PREFIX%\" || exit 1
1112

1213
REM Create activation scripts
1314
if not exist "%PREFIX%\etc\conda\activate.d" mkdir "%PREFIX%\etc\conda\activate.d"

conda/build.sh

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@
33

44
set -ex
55

6-
# Create the target directories
6+
# Copy entire bin/ folder into $PREFIX/bin/
77
mkdir -p $PREFIX/bin
8-
mkdir -p $PREFIX
8+
cp -r bin/* $PREFIX/bin/
99

10-
# Copy the shared library and module file
11-
cp bin/libplugify-module-cpp.so $PREFIX/bin/
12-
cp plugify-module-cpp.pmodule $PREFIX/
10+
# Copy all .pmodule files into $PREFIX/
11+
cp -r *.pmodule $PREFIX/
1312

14-
# Set proper permissions
15-
chmod 755 $PREFIX/bin/libplugify-module-cpp.so
16-
chmod 644 $PREFIX/plugify-module-cpp.pmodule
13+
# Fix permissions (recursively for bin, selective for modules)
14+
chmod -R 755 $PREFIX/bin
15+
chmod 644 $PREFIX/*.pmodule
1716

1817
# Create activation scripts for proper library path
1918
mkdir -p $PREFIX/etc/conda/activate.d

generator/generator.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,15 @@ def main(manifest_path: str, output_dir: str, override: bool):
584584
print(f'Output directory does not exist: {output_dir}')
585585
return 1
586586

587-
plugin_name = os.path.basename(manifest_path).rsplit('.', 3)[0]
587+
try:
588+
with open(manifest_path, 'r', encoding='utf-8') as file:
589+
pplugin = json.load(file)
590+
591+
except Exception as e:
592+
print(f'An error occurred: {e}')
593+
return 1
594+
595+
plugin_name = pplugin.get('name', os.path.basename(manifest_path).rsplit('.', 3)[0])
588596
output_path = os.path.join(output_dir, 'pps', f'{plugin_name}.hpp')
589597
os.makedirs(os.path.dirname(output_path), exist_ok=True)
590598

@@ -593,9 +601,6 @@ def main(manifest_path: str, output_dir: str, override: bool):
593601
return 1
594602

595603
try:
596-
with open(manifest_path, 'r', encoding='utf-8') as file:
597-
pplugin = json.load(file)
598-
599604
content = generate_header(plugin_name, pplugin)
600605

601606
with open(output_path, 'w', encoding='utf-8') as file:

include/plg/enum.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ namespace plg {
5555

5656
template<typename E>
5757
constexpr auto value(std::size_t v) {
58-
return static_cast<E>(ENUM_MIN_VALUE + v);
58+
return static_cast<E>(ENUM_MIN_VALUE + static_cast<int>(v));
5959
}
6060

6161
template<std::size_t N>

0 commit comments

Comments
 (0)