@@ -25,12 +25,12 @@ foreach(example_dir ${example_dirs})
25
25
endforeach ()
26
26
27
27
include (CheckIncludeFiles)
28
- list (REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR} /others/standard_lighting.c)
29
- list (REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR} /others/rlgl_standalone.c) # see #588
30
28
set (OUTPUT_EXT)
29
+ list (REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR} /others/rlgl_standalone.c)
31
30
32
31
if (${PLATFORM} MATCHES "Android" )
33
32
list (REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR} /others/rlgl_standalone.c)
33
+ list (REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR} /others/standard_lighting.c)
34
34
list (REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR} /core/core_3d_picking.c)
35
35
list (REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR} /core/core_vr_simulator.c)
36
36
list (REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR} /core/core_3d_camera_free.c)
@@ -49,12 +49,16 @@ if(${PLATFORM} MATCHES "Android")
49
49
list (REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR} /shaders/shaders_custom_uniform.c)
50
50
list (REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR} /shaders/shaders_model_shader.c)
51
51
list (REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR} /shaders/shaders_postprocessing.c)
52
+
52
53
elseif (${PLATFORM} MATCHES "Web" )
53
54
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 -s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1" )
54
55
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --shell-file ${CMAKE_SOURCE_DIR} /templates/web_shell/shell.html" )
55
56
set (OUTPUT_EXT ".html" )
57
+
56
58
endif ()
57
59
60
+ include_directories (BEFORE SYSTEM others/external/include )
61
+
58
62
if (NOT TARGET raylib)
59
63
find_package (raylib 2.0 REQUIRED)
60
64
endif ()
@@ -68,9 +72,22 @@ foreach(example_source ${example_sources})
68
72
# Setup the example
69
73
add_executable (${example_name} ${example_source} )
70
74
71
- # Link the libraries
72
75
target_link_libraries (${example_name} raylib)
73
76
endforeach ()
74
77
78
+ if (${PLATFORM} MATCHES "Desktop" )
79
+ # rlgl_standalone can't be linked with raylib because of duplicate rlgl symbols
80
+ foreach (example_source "others/rlgl_standalone.c" )
81
+ # Create the basename for the example
82
+ get_filename_component (example_name ${example_source} NAME )
83
+ string (REPLACE ".c" "${OUTPUT_EXT} " example_name ${example_name} )
84
+ add_executable (${example_name} ${example_source} )
85
+ add_dependencies (${example_name} raylib)
86
+ target_link_libraries (${example_name} ${raylib_LDFLAGS} )
87
+ target_include_directories (${example_name} PRIVATE ${raylib_INCLUDE_DIRS} )
88
+
89
+ endforeach ()
90
+ endif ()
91
+
75
92
# Copy all of the resource files to the destination
76
93
file (COPY ${example_resources} DESTINATION "resources/" )
0 commit comments