Skip to content
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
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
cmake_minimum_required(VERSION 3.10)

# Determine if zstd is built as a subproject (using add_subdirectory) or if it
# is the master project.
if (NOT DEFINED ZSTD_MASTER_PROJECT)
set(ZSTD_MASTER_PROJECT OFF)
# Checking project name is more reliable than checking source directories.
if (NOT DEFINED PROJECT_NAME)
set(ZSTD_MASTER_PROJECT ON)
endif()
endif()

# Thin wrapper so `cmake -S .` behaves like `cmake -S build/cmake`.
# Policy lives in build/cmake; keep parent project language-less.
project(zstd-superbuild LANGUAGES NONE)
Expand Down
2 changes: 1 addition & 1 deletion build/cmake/CMakeModules/ZstdOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ else()
endif()

# Build component options
option(ZSTD_BUILD_PROGRAMS "Build command-line programs" ON)
option(ZSTD_BUILD_PROGRAMS "Build command-line programs" ${ZSTD_MASTER_PROJECT})
option(ZSTD_BUILD_CONTRIB "Build contrib utilities" OFF)
option(ZSTD_PROGRAMS_LINK_SHARED "Link programs against shared library" OFF)

Expand Down