Skip to content

Commit

Permalink
dont statically link raylib on windows, but do statically link vcruntime
Browse files Browse the repository at this point in the history
  • Loading branch information
electronstudio committed Apr 14, 2020
1 parent 477d61c commit c166b63
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
6 changes: 3 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ cp -R lib/* gen/
cp raylib.h gen/com/raylib
cd gen
echo "STEP 2 - compile Raylib.java"
java -jar ../javacpp.jar -nodelete com/raylib/Raylib.java
java -jar ../javacpp.jar -Dplatform.compiler.foo='// /Oi /O2 /EHsc /Gy /GL /MT /LD' -nodelete com/raylib/Raylib.java
# /Oi /O2 /MD /LD /link /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /NODEFAULTLIB:MSVCRTD'
cd ..
echo "STEP 3 - move compilation results from gen folder to build folder"
mkdir -p build/com/raylib
Expand All @@ -19,7 +20,7 @@ mkdir -p build/com/raylib/macosx-x86_64
mkdir -p build/com/raylib/linux-x86_64
# rm gen/com/raylib/Raylib.java
mv -f gen/com/raylib/*.class build/com/raylib/
mv -f gen/com/raylib/windows-x86_64/* build/com/raylib/windows-x86_64/
mv -f gen/com/raylib/windows-x86_64/*.dll build/com/raylib/windows-x86_64/
mv -f gen/com/raylib/macosx-x86_64/* build/com/raylib/macosx-x86_64/
mv -f gen/com/raylib/linux-x86_64/* build/com/raylib/linux-x86_64/
echo "STEP 4 - unzip javacpp.jar"
Expand All @@ -33,4 +34,3 @@ javac -cp ../build com/raylib/*.java -d ../build
cd ..
echo "STEP 6 - uber jar archive"
jar cf jaylib.jar -C build .
#sleep 100
Binary file modified build/com/raylib/windows-x86_64/jniRaylib.dll
Binary file not shown.
9 changes: 3 additions & 6 deletions src/com/raylib/RaylibConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,22 @@
@Platform(
value = {"windows-x86_64"},
linkpath = {"C:\\Users\\Richard\\jaylib\\lib\\windows"},
//link = {"winmm", "OpenGL32","user32","shell32","gdi32","raylib_static"},
link = {"raylib"},
//preloadpath={"..\\lib\\windows"},
//resource = {"jniRaylib.dll"},
preloadpath = {"C:\\Users\\Richard\\jaylib\\lib\\windows"},
includepath = {"C:\\Users\\Richard\\jaylib"},
include = {"raylib.h"},
preload={"raylib"}
preload={"raylib"},
compiler = {"!default","foo"}
),
@Platform(
value = {"macosx-x86_64"},
linkpath = {"/Users/richard/IdeaProjects/jaylib/lib/mac"},
link = {"raylib"},
includepath = {"/Users/richard/IdeaProjects/jaylib"},
//preloadpath = {"/path/to/deps/"},
include = {"raylib.h"}
//preload = {"DependentLib"},
),


@Platform(
value = {"linux-x86_64"},
linkpath = {"/home/richard/jaylib/lib/linux", "/usr/lib/x86_64-linux-gnu"},
Expand Down

0 comments on commit c166b63

Please sign in to comment.