Skip to content
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

vendor:raylib: add options to link with raylib/raygui from system #4619

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion vendor/raylib/raygui.odin
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ package raylib
import "core:c"

RAYGUI_SHARED :: #config(RAYGUI_SHARED, false)
RAYGUI_SYSTEM :: #config(RAYGUI_SYSTEM, false)

when ODIN_OS == .Windows {
when RAYGUI_SYSTEM {
foreign import lib "system:raygui"
} else when ODIN_OS == .Windows {
foreign import lib {
"windows/rayguidll.lib" when RAYGUI_SHARED else "windows/raygui.lib",
}
Expand Down
5 changes: 4 additions & 1 deletion vendor/raylib/raylib.odin
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,11 @@ MAX_TEXT_BUFFER_LENGTH :: #config(RAYLIB_MAX_TEXT_BUFFER_LENGTH, 1024)
#assert(size_of(rune) == size_of(c.int))

RAYLIB_SHARED :: #config(RAYLIB_SHARED, false)
RAYLIB_SYSTEM :: #config(RAYLIB_SYSTEM, false)

when ODIN_OS == .Windows {
when RAYLIB_SYSTEM {
foreign import lib "system:raylib"
} else when ODIN_OS == .Windows {
@(extra_linker_flags="/NODEFAULTLIB:" + ("msvcrt" when RAYLIB_SHARED else "libcmt"))
foreign import lib {
"windows/raylibdll.lib" when RAYLIB_SHARED else "windows/raylib.lib" ,
Expand Down
5 changes: 4 additions & 1 deletion vendor/raylib/rlgl/rlgl.odin
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,16 @@ import rl "../."
VERSION :: "5.0"

RAYLIB_SHARED :: #config(RAYLIB_SHARED, false)
RAYLIB_SYSTEM :: #config(RAYLIB_SYSTEM, false)

// Note: We pull in the full raylib library. If you want a truly stand-alone rlgl, then:
// - Compile a separate rlgl library and use that in the foreign import blocks below.
// - Remove the `import rl "../."` line
// - Copy the code from raylib.odin for any types we alias from that package (see PixelFormat etc)

when ODIN_OS == .Windows {
when RAYLIB_SYSTEM {
foreign import lib "system:raylib"
} else when ODIN_OS == .Windows {
@(extra_linker_flags="/NODEFAULTLIB:" + ("msvcrt" when RAYLIB_SHARED else "libcmt"))
foreign import lib {
"../windows/raylibdll.lib" when RAYLIB_SHARED else "../windows/raylib.lib" ,
Expand Down