Skip to content

Commit

Permalink
Revert "Build specific example using -DBUILD_EXAMPLE cmake flag (rays…
Browse files Browse the repository at this point in the history
…an5#3921)"

This reverts commit c1fd985.
  • Loading branch information
benjitrosch authored Apr 19, 2024
1 parent c1fd985 commit 109ec7b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 22 deletions.
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ if(NOT TARGET uninstall)
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
endif()

if (NOT ${BUILD_EXAMPLE} STREQUAL "")
MESSAGE(STATUS "Building example '${BUILD_EXAMPLE}'")
add_subdirectory(examples)
elseif (${BUILD_EXAMPLES})
if (${BUILD_EXAMPLES})
MESSAGE(STATUS "Building examples is enabled")
add_subdirectory(examples)
endif()
Expand Down
1 change: 0 additions & 1 deletion CMakeOptions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ enum_option(OPENGL_VERSION "OFF;4.3;3.3;2.1;1.1;ES 2.0;ES 3.0" "Force a specific

# Configuration options
option(BUILD_EXAMPLES "Build the examples." ${RAYLIB_IS_MAIN})
option(BUILD_EXAMPLE "Build a specific example by filename." "")
option(CUSTOMIZE_BUILD "Show options for customizing your Raylib library build." OFF)
option(ENABLE_ASAN "Enable AddressSanitizer (ASAN) for debugging (degrades performance)" OFF)
option(ENABLE_UBSAN "Enable UndefinedBehaviorSanitizer (UBSan) for debugging" OFF)
Expand Down
20 changes: 3 additions & 17 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,10 @@ endif ()
# into a CMake variable
set(example_sources)
set(example_resources)
set(example_found FALSE)
foreach (example_dir ${example_dirs})
if (BUILD_EXAMPLE)
if (NOT example_found)
file(GLOB sources ${example_dir}/${BUILD_EXAMPLE}.c)
if (EXISTS ${sources})
list(APPEND example_sources ${sources})
set(example_found TRUE)
message("Raylib example '${BUILD_EXAMPLE}.c' found in ${example_dir}!")
else()
message("Raylib example '${BUILD_EXAMPLE}.c' not found in ${example_dir}...")
endif()
endif()
else()
# Get the .c files
file(GLOB sources ${example_dir}/*.c)
list(APPEND example_sources ${sources})
endif()
# Get the .c files
file(GLOB sources ${example_dir}/*.c)
list(APPEND example_sources ${sources})

# Any any resources
file(GLOB resources ${example_dir}/resources/*)
Expand Down

0 comments on commit 109ec7b

Please sign in to comment.