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

raylib 2.0 build problem #584

Closed
jubalh opened this issue Jul 23, 2018 · 3 comments
Closed

raylib 2.0 build problem #584

jubalh opened this issue Jul 23, 2018 · 3 comments

Comments

@jubalh
Copy link
Contributor

jubalh commented Jul 23, 2018

Compiling raylib 2.0 release with:

%cmake \
     -DPLATFORM=PLATFORM_DESKTOP \                                                                                                                                                          
     -DSHARED=ON

I get:

[    6s] /home/abuild/rpmbuild/BUILD/raylib-2.0.0/src/core.c: In function 'InitGraphicsDevice':
[    6s] /home/abuild/rpmbuild/BUILD/raylib-2.0.0/src/core.c:1920:63: error: 'GLFW_TRANSPARENT_FRAMEBUFFER' undeclared (first use in this function); did you mean 'GL_READ_FRAMEBUFFER'?      
[    6s]      if (configFlags & FLAG_WINDOW_TRANSPARENT) glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE);     // Transparent framebuffer                                              
[    6s]                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                          
[    6s]                                                                GL_READ_FRAMEBUFFER

Not sure why. Is it still trying to use the system version of glfw? With 2.0-rc1 it worked.

@raysan5
Copy link
Owner

raysan5 commented Jul 23, 2018

It seems it uses system version of GLFW instead of provided one... it's weird... Is system glfw headers in your path?

@a3f
Copy link
Contributor

a3f commented Jul 23, 2018

Use -DPLATFORM=Desktop instead. If -DPLATFORM=PLATFORM_DESKTOP worked before, then it was by chance. From the wiki article:

Option Description Possible Values (first is default)
PLATFORM Platform to build for. Desktop Web Android Raspberry Pi

@a3f a3f closed this as completed Jul 23, 2018
a3f added a commit to a3f/raylib that referenced this issue Jul 23, 2018
as well as -DUSE_EXTERNAL_GLFW.

Nips issues like raysan5#584 in the bud.
a3f added a commit that referenced this issue Jul 23, 2018
as well as -DUSE_EXTERNAL_GLFW.

Nips issues like #584 in the bud.
@jubalh
Copy link
Contributor Author

jubalh commented Jul 24, 2018

Thanks @a3f, that helped.

a3f added a commit to a3f/raylib that referenced this issue Jul 29, 2018
Remove that link_libraries_to_executable() hack and defines a proper
raylib target that can be used with target_link_libraries.

The same target is also available for external (user) code by using
find_package(raylib).

This results in:

- Remove hardcoded build directories from examples and games CMakeLists.txt
- Allow rlgl_standalone and other special examples to be built easily
- Allow CMake projects to find_package(raylib instead of fiddling with pkg-config
- Makes code a little more maintainable
- Fixes raysan5#471, raysan5#606.
- Makes code less confusing by removing the double use of PLATFORM (raysan5#584).

Note that this is still not _The Right Way_(TM), because normally
raylib-config.cmake (or its includes) would be automatically generated.
I didn't manage to get that to work though, so I went the easier route
of just wrapping pkg_check_modules for consumption by find_package.
a3f added a commit to a3f/raylib that referenced this issue Jul 29, 2018
Remove that link_libraries_to_executable() hack and defines a proper
raylib target that can be used with target_link_libraries.

The same target is also available for external (user) code by using
find_package(raylib).

This results in:

- Remove hardcoded build directories from examples and games CMakeLists.txt
- Allow rlgl_standalone and other special examples to be built easily
- Allow CMake projects to find_package(raylib instead of fiddling with pkg-config
- Makes code a little more maintainable
- Fixes raysan5#471, raysan5#606.
- Makes code less confusing by removing the double use of PLATFORM (raysan5#584).

Note that this is still not _The Right Way_(TM), because normally
raylib-config.cmake (or its includes) would be automatically generated.
I didn't manage to get that to work though, so I went the easier route
of just wrapping pkg_check_modules for consumption by find_package.
a3f added a commit to a3f/raylib that referenced this issue Jul 29, 2018
Remove that link_libraries_to_executable() hack and defines a proper
raylib target that can be used with target_link_libraries.

The same target is also available for external (user) code by using
find_package(raylib).

This results in:

- Remove hardcoded build directories from examples and games CMakeLists.txt
- Allow rlgl_standalone and other special examples to be built easily
- Allow CMake projects to find_package(raylib instead of fiddling with pkg-config
- Makes code a little more maintainable
- Fixes raysan5#471, raysan5#606.
- Makes code less confusing by removing the double use of PLATFORM (raysan5#584).

Note that this is still not _The Right Way_(TM), because normally
raylib-config.cmake (or its includes) would be automatically generated.
I didn't manage to get that to work though, so I went the easier route
of just wrapping pkg_check_modules for consumption by find_package.
a3f added a commit to a3f/raylib that referenced this issue Jul 29, 2018
Remove that link_libraries_to_executable() hack and defines a proper
raylib target that can be used with target_link_libraries.

The same target is also available for external (user) code by using
find_package(raylib).

This results in:

- Remove hardcoded build directories from examples and games CMakeLists.txt
- Allow rlgl_standalone and other special examples to be built easily
- Allow CMake projects to find_package(raylib instead of fiddling with pkg-config
- Makes code a little more maintainable
- Fixes raysan5#471, raysan5#606.
- Makes code less confusing by removing the double use of PLATFORM (raysan5#584).

Note that this is still not _The Right Way_(TM), because normally
raylib-config.cmake (or its includes) would be automatically generated.
I didn't manage to get that to work though, so I went the easier route
of just wrapping pkg_check_modules for consumption by find_package.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants