浏览代码

Building examples by default only if raylib is standalone. (#1460)

This change only modifies the default value. In cmake you can have raylib as a subdirectory (dependency) and when you have it as dependency you wouldn't probably want to use the example by default. You can still use the option to enable them though.
pull/1463/head
hristo 4 年前
committed by GitHub
父节点
当前提交
3ec8ac52f8
找不到此签名对应的密钥 GPG 密钥 ID: 4AEE18F83AFDEB23
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. +8
    -1
      CMakeLists.txt

+ 8
- 1
CMakeLists.txt 查看文件

@ -1,8 +1,14 @@
cmake_minimum_required(VERSION 3.0)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
set(RAYLIB_IS_MAIN TRUE)
else()
set(RAYLIB_IS_MAIN FALSE)
endif()
# Config options
option(BUILD_EXAMPLES "Build the examples." ON)
option(BUILD_EXAMPLES "Build the examples." o">${RAYLIB_IS_MAIN})
option(ENABLE_ASAN "Enable AddressSanitizer (ASAN) for debugging (degrades performance)" OFF)
option(ENABLE_UBSAN "Enable UndefinedBehaviorSanitizer (UBSan) for debugging" OFF)
option(ENABLE_MSAN "Enable MemorySanitizer (MSan) for debugging (not recommended to run with ASAN)" OFF)
@ -48,6 +54,7 @@ endif()
add_subdirectory(src)
if (${BUILD_EXAMPLES})
MESSAGE(STATUS "Building examples is enabled")
add_subdirectory(examples)
endif()

正在加载...
取消
保存