diff options
author | Adam Harrison <adamdharrison@gmail.com> | 2022-11-29 23:32:10 -0500 |
---|---|---|
committer | Adam Harrison <adamdharrison@gmail.com> | 2022-11-29 23:32:10 -0500 |
commit | e038c8cc6818dab3f8ccd4d78ae8797d591cc13f (patch) | |
tree | e065f07034c112edd1cdf4dd814259f773cd8c83 | |
parent | 2516b4c8ba540df06d6d325872c860bb705a387b (diff) | |
download | lite-xl-plugin-manager-e038c8cc6818dab3f8ccd4d78ae8797d591cc13f.tar.gz lite-xl-plugin-manager-e038c8cc6818dab3f8ccd4d78ae8797d591cc13f.zip |
Added in preprocessor guard.
-rw-r--r-- | README.md | 2 | ||||
-rwxr-xr-x | build.sh | 2 | ||||
-rw-r--r-- | src/lpm.c | 6 |
3 files changed, 7 insertions, 3 deletions
@@ -86,7 +86,7 @@ lpm --help ### Linux to Windows ``` -CC=x86_64-w64-mingw32-gcc AR=x86_64-w64-mingw32-gcc-ar WINDRES=x86_64-w64-mingw32-windres CMAKE_DEFAULT_FLAGS="-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=NEVER -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_INCLUDE_PATH=/usr/share/mingw-w64/include" TAR_CONFIGURE="--host=x86_64-w64-mingw32" GIT2_CONFIGURE="-DDLLTOOL=x86_64-w64-mingw32-dlltool" ./build.sh -DLPM_VERSION='"'$VERSION-x86_64-windows-`git rev-parse --short HEAD`'"' +CC=x86_64-w64-mingw32-gcc AR=x86_64-w64-mingw32-gcc-ar WINDRES=x86_64-w64-mingw32-windres CMAKE_DEFAULT_FLAGS="-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=NEVER -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_INCLUDE_PATH=/usr/share/mingw-w64/include" GIT2_CONFIGURE="-DDLLTOOL=x86_64-w64-mingw32-dlltool" ./build.sh -DLPM_VERSION='"'$VERSION-x86_64-windows-`git rev-parse --short HEAD`'"' ``` @@ -9,7 +9,7 @@ SRCS="src/*.c" CFLAGS="$CFLAGS -Ilib/prefix/include" LDFLAGS="$LDFLAGS -lm -pthread -static-libgcc -Llib/prefix/lib" -[[ "$@" == "clean" ]] && rm -rf lib/libgit2/build lib/zlib/build lib/libtar/build lib/mbedtls-2.27.0/build lib/libarchive/build-tmp lib/libzip/build lib/prefix lua $BIN *.exe src/lpm.luac src/lpm.lua.c && exit 0 +[[ "$@" == "clean" ]] && rm -rf lib/libgit2/build lib/zlib/build lib/libzip/build lib/mbedtls-2.27.0/build lib/prefix lua $BIN *.exe src/lpm.luac src/lpm.lua.c && exit 0 # Build supporting libraries, libz, libmbedtls, libmbedcrypto, libgit2, liblzma, libarchive, liblua CMAKE_DEFAULT_FLAGS=" $CMAKE_DEFAULT_FLAGS -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=`pwd`/lib/prefix -DCMAKE_INSTALL_PREFIX=`pwd`/lib/prefix -DBUILD_SHARED_LIBS=OFF" @@ -440,7 +440,11 @@ static int mkdirp(char* path, int len) { for (int i = 0; i < len; ++i) { if (path[i] == '/') { path[i] = 0; - if (mkdir(path, S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) && errno != EEXIST) + #ifndef _WIN32 + if (mkdir(path, S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) && errno != EEXIST) + #else + if (mkdir(path) && errno != EEXIST) + #endif return -1; path[i] = '/'; } |