cmake: Rename build options to follow Abseil naming
`BUILD_TESTING` is a CMake provided option and we should use similar naming,
just like how Abseil does it.
- `SAPI_ENABLE_TESTS` -> `SAPI_BUILD_TESTING`
- `SAPI_ENABLE_CONTRIB_TESTS` -> `SAPI_CONTRIB_BUILD_TESTING`
- `SAPI_ENABLE_EXAMPLES` -> `SAPI_BUILD_EXAMPLES`
Drive-by:
- Fix option name in GitHub action
PiperOrigin-RevId: 443305932
Change-Id: Ice2b42be1229a0f9ae7c2ceda9ce87187baf22c4
diff --git a/.github/workflows/ubuntu-cmake-contrib.yml b/.github/workflows/ubuntu-cmake-contrib.yml
index a224d1f..039b535 100644
--- a/.github/workflows/ubuntu-cmake-contrib.yml
+++ b/.github/workflows/ubuntu-cmake-contrib.yml
@@ -68,8 +68,8 @@
-B $GITHUB_WORKSPACE/build \
-G Ninja \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
- -DSAPI_ENABLE_TEST=ON \
- -DSAPI_ENABLE_EXAMPLES=ON
+ -DSAPI_BUILD_TESTING=ON \
+ -DSAPI_BUILD_EXAMPLES=ON
- name: Build
run: |
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b039339..0738046 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -149,7 +149,7 @@
sapi::base
)
-if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
+if(BUILD_TESTING AND SAPI_BUILD_TESTING)
include(GoogleTest)
# Setup tests to work like with Bazel
create_directory_symlink("${SAPI_BINARY_DIR}" com_google_sandboxed_api)
@@ -158,6 +158,6 @@
add_subdirectory(sandboxed_api)
-if(BUILD_TESTING AND SAPI_ENABLE_TESTS AND SAPI_ENABLE_CONTRIB_TESTS)
+if(BUILD_TESTING AND SAPI_BUILD_TESTING AND SAPI_CONTRIB_BUILD_TESTING)
add_subdirectory(contrib)
endif()
diff --git a/cmake/SapiDeps.cmake b/cmake/SapiDeps.cmake
index 2e00f9b..4774bcc 100644
--- a/cmake/SapiDeps.cmake
+++ b/cmake/SapiDeps.cmake
@@ -41,7 +41,7 @@
set(_sapi_saved_BUILD_TESTING ${BUILD_TESTING})
set(BUILD_TESTING OFF) # No need to build test code of our deps
-if(SAPI_ENABLE_TESTS)
+if(SAPI_BUILD_TESTING)
if(SAPI_DOWNLOAD_GOOGLETEST)
include(cmake/googletest.cmake)
endif()
@@ -99,7 +99,7 @@
endif()
find_package(Protobuf REQUIRED)
-if(SAPI_ENABLE_EXAMPLES)
+if(SAPI_BUILD_EXAMPLES)
if(SAPI_DOWNLOAD_ZLIB)
include(cmake/zlib.cmake)
sapi_check_target(ZLIB::ZLIB)
diff --git a/cmake/SapiOptions.cmake b/cmake/SapiOptions.cmake
index 5979e2f..26b74fd 100644
--- a/cmake/SapiOptions.cmake
+++ b/cmake/SapiOptions.cmake
@@ -38,19 +38,20 @@
option(SAPI_DOWNLOAD_LIBFFI "Download libffi at config time" ON)
# Options for building examples
-option(SAPI_ENABLE_EXAMPLES
- "Build example code" ${_sapi_enable_tests_examples_default}
+option(SAPI_BUILD_EXAMPLES
+ "If ON, build example code" ${_sapi_enable_tests_examples_default}
)
option(SAPI_DOWNLOAD_ZLIB
- "Download zlib at config time (only if SAPI_ENABLE_EXAMPLES is set)"
+ "Download zlib at config time (only if SAPI_BUILD_EXAMPLES is set)"
${_sapi_enable_tests_examples_default}
)
-option(SAPI_ENABLE_TESTS
- "Build unit tests" ${_sapi_enable_tests_examples_default}
+option(SAPI_BUILD_TESTING
+ "If ON, this will build all of Sandboxed API's own tests"
+ ${_sapi_enable_tests_examples_default}
)
# Disabled by default, as this will download a lot of extra content.
-option(SAPI_ENABLE_CONTRIB_TESTS "Build tests for sandboxes in 'contrib'" OFF)
+option(SAPI_CONTRIB_BUILD_TESTING "Build tests for sandboxes in 'contrib'" OFF)
option(SAPI_ENABLE_GENERATOR
"Build Clang based code generator from source" OFF
diff --git a/contrib/brotli/CMakeLists.txt b/contrib/brotli/CMakeLists.txt
index e0fa866..95f0e40 100644
--- a/contrib/brotli/CMakeLists.txt
+++ b/contrib/brotli/CMakeLists.txt
@@ -72,10 +72,10 @@
"${SAPI_SOURCE_DIR}"
)
-if(SAPI_ENABLE_EXAMPLES)
+if(SAPI_BUILD_EXAMPLES)
add_subdirectory(example)
endif()
-if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
+if(BUILD_TESTING AND SAPI_BUILD_TESTING)
add_subdirectory(test)
endif()
diff --git a/contrib/c-blosc/CMakeLists.txt b/contrib/c-blosc/CMakeLists.txt
index 02f2fa1..0d4ef67 100644
--- a/contrib/c-blosc/CMakeLists.txt
+++ b/contrib/c-blosc/CMakeLists.txt
@@ -81,10 +81,10 @@
"${PROJECT_BINARY_DIR}"
)
-if (SAPI_ENABLE_EXAMPLES)
+if (SAPI_BUILD_EXAMPLES)
add_subdirectory(example)
endif()
-if (BUILD_TESTING AND SAPI_ENABLE_TESTS)
+if (BUILD_TESTING AND SAPI_BUILD_TESTING)
add_subdirectory(test)
endif()
diff --git a/contrib/hunspell/CMakeLists.txt b/contrib/hunspell/CMakeLists.txt
index fc57770..b475fd4 100644
--- a/contrib/hunspell/CMakeLists.txt
+++ b/contrib/hunspell/CMakeLists.txt
@@ -133,10 +133,10 @@
"${PROJECT_BINARY_DIR}"
)
-if(SAPI_ENABLE_EXAMPLES)
+if(SAPI_BUILD_EXAMPLES)
add_subdirectory(example)
endif()
-if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
+if(BUILD_TESTING AND SAPI_BUILD_TESTING)
add_subdirectory(test)
endif()
diff --git a/contrib/jsonnet/CMakeLists.txt b/contrib/jsonnet/CMakeLists.txt
index 3517f0c..4d2f491 100644
--- a/contrib/jsonnet/CMakeLists.txt
+++ b/contrib/jsonnet/CMakeLists.txt
@@ -89,11 +89,11 @@
sapi_contrib::jsonnet_helper
)
-if(SAPI_ENABLE_EXAMPLES)
+if(SAPI_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
-if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
+if(BUILD_TESTING AND SAPI_BUILD_TESTING)
# Create directories so the tests will be able to access them
file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/tests_input"
"${PROJECT_BINARY_DIR}/tests_output"
diff --git a/contrib/jsonnet/README.md b/contrib/jsonnet/README.md
index 5c3eefb..d5549e1 100644
--- a/contrib/jsonnet/README.md
+++ b/contrib/jsonnet/README.md
@@ -53,7 +53,7 @@
```
mkdir -p build && cd build
-cmake .. -G Ninja -Wno-dev -DSAPI_ENABLE_TESTS=ON
+cmake .. -G Ninja -Wno-dev -DSAPI_BUILD_TESTING=ON
ninja
```
diff --git a/contrib/libidn2/CMakeLists.txt b/contrib/libidn2/CMakeLists.txt
index 1c504f3..f92fa8b 100644
--- a/contrib/libidn2/CMakeLists.txt
+++ b/contrib/libidn2/CMakeLists.txt
@@ -58,6 +58,6 @@
PRIVATE idn2
)
-if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
+if(BUILD_TESTING AND SAPI_BUILD_TESTING)
add_subdirectory(tests)
endif()
diff --git a/contrib/libzip/CMakeLists.txt b/contrib/libzip/CMakeLists.txt
index a8b939e..f9059d6 100644
--- a/contrib/libzip/CMakeLists.txt
+++ b/contrib/libzip/CMakeLists.txt
@@ -87,10 +87,10 @@
"${SAPI_SOURCE_DIR}"
)
-if(SAPI_ENABLE_EXAMPLES)
+if(SAPI_BUILD_EXAMPLES)
add_subdirectory(example)
endif()
-if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
+if(BUILD_TESTING AND SAPI_BUILD_TESTING)
add_subdirectory(test)
endif()
diff --git a/contrib/turbojpeg/CMakeLists.txt b/contrib/turbojpeg/CMakeLists.txt
index 5efca34..b098f01 100644
--- a/contrib/turbojpeg/CMakeLists.txt
+++ b/contrib/turbojpeg/CMakeLists.txt
@@ -41,6 +41,6 @@
"${PROJECT_BINARY_DIR}"
)
-if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
+if(BUILD_TESTING AND SAPI_BUILD_TESTING)
add_subdirectory(tests)
endif()
diff --git a/contrib/uriparser/CMakeLists.txt b/contrib/uriparser/CMakeLists.txt
index c8286f0..9c5b217 100644
--- a/contrib/uriparser/CMakeLists.txt
+++ b/contrib/uriparser/CMakeLists.txt
@@ -73,10 +73,10 @@
"${SAPI_SOURCE_DIR}"
)
-if(SAPI_ENABLE_EXAMPLES)
+if(SAPI_BUILD_EXAMPLES)
add_subdirectory(example)
endif()
-if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
+if(BUILD_TESTING AND SAPI_BUILD_TESTING)
add_subdirectory(test)
endif()
diff --git a/contrib/woff2/CMakeLists.txt b/contrib/woff2/CMakeLists.txt
index 360e2db..36607e8 100644
--- a/contrib/woff2/CMakeLists.txt
+++ b/contrib/woff2/CMakeLists.txt
@@ -61,7 +61,7 @@
"${SAPI_SOURCE_DIR}"
)
-if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
+if(BUILD_TESTING AND SAPI_BUILD_TESTING)
enable_testing()
add_executable(woff2_sapi_test
woff2_sapi_test.cc
diff --git a/contrib/zopfli/CMakeLists.txt b/contrib/zopfli/CMakeLists.txt
index f4876d2..2e62399 100644
--- a/contrib/zopfli/CMakeLists.txt
+++ b/contrib/zopfli/CMakeLists.txt
@@ -64,10 +64,10 @@
"${SAPI_SOURCE_DIR}"
)
-if(SAPI_ENABLE_EXAMPLES)
+if(SAPI_BUILD_EXAMPLES)
add_subdirectory(example)
endif()
-if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
+if(BUILD_TESTING AND SAPI_BUILD_TESTING)
add_subdirectory(test)
endif()
diff --git a/contrib/zstd/CMakeLists.txt b/contrib/zstd/CMakeLists.txt
index f2b8421..d396500 100644
--- a/contrib/zstd/CMakeLists.txt
+++ b/contrib/zstd/CMakeLists.txt
@@ -92,10 +92,10 @@
"${SAPI_SOURCE_DIR}"
)
-if(SAPI_ENABLE_EXAMPLES)
+if(SAPI_BUILD_EXAMPLES)
add_subdirectory(example)
endif()
-if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
+if(BUILD_TESTING AND SAPI_BUILD_TESTING)
add_subdirectory(test)
endif()
diff --git a/oss-internship-2020/curl/CMakeLists.txt b/oss-internship-2020/curl/CMakeLists.txt
index ece9fb1..184e1c7 100644
--- a/oss-internship-2020/curl/CMakeLists.txt
+++ b/oss-internship-2020/curl/CMakeLists.txt
@@ -35,8 +35,8 @@
# Setup Sandboxed API
set(SAPI_ROOT "../.." CACHE PATH "Path to the Sandboxed API source tree")
-set(SAPI_ENABLE_EXAMPLES ${SAPI_CURL_ENABLE_EXAMPLES} CACHE BOOL "" FORCE)
-set(SAPI_ENABLE_TESTS ${SAPI_CURL_ENABLE_TESTS} CACHE BOOL "" FORCE)
+set(SAPI_BUILD_EXAMPLES ${SAPI_CURL_ENABLE_EXAMPLES} CACHE BOOL "" FORCE)
+set(SAPI_BUILD_TESTING ${SAPI_CURL_ENABLE_TESTS} CACHE BOOL "" FORCE)
add_subdirectory(
"${SAPI_ROOT}"
"${CMAKE_BINARY_DIR}/sandboxed-api-build"
diff --git a/oss-internship-2020/curl/README.md b/oss-internship-2020/curl/README.md
index b1c0e15..1eeebb3 100644
--- a/oss-internship-2020/curl/README.md
+++ b/oss-internship-2020/curl/README.md
@@ -99,7 +99,7 @@
[README](examples/README.md).
To build these examples when building the library, the cmake variable
-`CURL_SAPI_ENABLE_EXAMPLES` must be set to `ON`. This enables Sandboxed API
+`CURL_SAPI_BUILD_EXAMPLES` must be set to `ON`. This enables Sandboxed API
examples as well.
## Policy
@@ -117,7 +117,7 @@
including the setup of a mock local server on which test requests are performed.
To build these tests when building the library, the cmake variable
-`CURL_SAPI_ENABLE_TESTS` must be set to `ON`. This enables Sandboxed API tests
+`CURL_SAPI_BUILD_TESTING` must be set to `ON`. This enables Sandboxed API tests
as well.
## Callbacks
diff --git a/oss-internship-2020/gdal/CMakeLists.txt b/oss-internship-2020/gdal/CMakeLists.txt
index 8e1f2e8..a498fd7 100644
--- a/oss-internship-2020/gdal/CMakeLists.txt
+++ b/oss-internship-2020/gdal/CMakeLists.txt
@@ -27,8 +27,8 @@
set(SAPI_ROOT "${PROJECT_SOURCE_DIR}/../.." CACHE PATH "Path to the Sandboxed API source tree")
# cmake .. -G Ninja -DSAPI_ROOT=$HOME/sapi_root
-set(SAPI_ENABLE_EXAMPLES OFF CACHE BOOL "")
-set(SAPI_ENABLE_TESTS OFF CACHE BOOL "")
+set(SAPI_BUILD_EXAMPLES OFF CACHE BOOL "")
+set(SAPI_BUILD_TESTING OFF CACHE BOOL "")
add_subdirectory("${SAPI_ROOT}"
"${CMAKE_BINARY_DIR}/sandboxed-api-build"
# Omit this to have the full Sandboxed API in IDE
diff --git a/oss-internship-2020/libpng/CMakeLists.txt b/oss-internship-2020/libpng/CMakeLists.txt
index d399d0e..5e8f517 100644
--- a/oss-internship-2020/libpng/CMakeLists.txt
+++ b/oss-internship-2020/libpng/CMakeLists.txt
@@ -27,11 +27,11 @@
# mkdir -p build && cd build
# cmake .. -G Ninja -DSAPI_ROOT=/path/to/sapi_root
-option(LIBPNG_SAPI_ENABLE_EXAMPLES "" OFF)
-option(LIBPNG_SAPI_ENABLE_TESTS "" OFF)
+option(LIBPNG_SAPI_BUILD_EXAMPLES "" OFF)
+option(LIBPNG_SAPI_BUILD_TESTING "" OFF)
-set(SAPI_ENABLE_EXAMPLES ${LIBPNG_SAPI_ENABLE_EXAMPLES} CACHE BOOL "" FORCE)
-set(SAPI_ENABLE_TESTS ${LIBPNG_SAPI_ENABLE_TESTS} CACHE BOOL "" FORCE)
+set(SAPI_BUILD_EXAMPLES ${LIBPNG_SAPI_BUILD_EXAMPLES} CACHE BOOL "" FORCE)
+set(SAPI_BUILD_TESTING ${LIBPNG_SAPI_BUILD_TESTING} CACHE BOOL "" FORCE)
set (CMAKE_FIND_LIBRARY_SUFFIXES .a $ {CMAKE_FIND_LIBRARY_SUFFIXES})
find_package(PNG REQUIRED)
@@ -102,11 +102,11 @@
"${PROJECT_BINARY_DIR}" # To find the generated SAPI header
)
-if (LIBPNG_SAPI_ENABLE_EXAMPLES)
+if (LIBPNG_SAPI_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
-if (LIBPNG_SAPI_ENABLE_TESTS)
+if (LIBPNG_SAPI_BUILD_TESTING)
add_subdirectory(tests)
endif()
diff --git a/oss-internship-2020/libpng/README.md b/oss-internship-2020/libpng/README.md
index 9315ef6..f491a13 100644
--- a/oss-internship-2020/libpng/README.md
+++ b/oss-internship-2020/libpng/README.md
@@ -16,7 +16,7 @@
```
#### Example:
-You should add `-DLIBPNG_SAPI_ENABLE_EXAMPLES=ON` to use the example.\
+You should add `-DLIBPNG_SAPI_BUILD_EXAMPLES=ON` to use the example.\
run PNG to PNG:
```
./examples/pngtopng /absolute/path/to/input/image.png /absolute/path/to/output/image.png
@@ -38,7 +38,7 @@
#### Tests:
-You should add `-DLIBPNG_SAPI_ENABLE_TESTS=ON` to use tests and do:
+You should add `-DLIBPNG_SAPI_BUILD_TESTING=ON` to use tests and do:
```
cd tests
ctest .
diff --git a/oss-internship-2020/libtiff/CMakeLists.txt b/oss-internship-2020/libtiff/CMakeLists.txt
index 3e26e3c..7490f5f 100644
--- a/oss-internship-2020/libtiff/CMakeLists.txt
+++ b/oss-internship-2020/libtiff/CMakeLists.txt
@@ -27,11 +27,11 @@
# mkdir -p build && cd build
# cmake .. -G Ninja -DSAPI_ROOT=$HOME/sapi_root
-option(TIFF_SAPI_ENABLE_EXAMPLES "" ON)
-option(TIFF_SAPI_ENABLE_TESTS "" ON)
+option(TIFF_SAPI_BUILD_EXAMPLES "" ON)
+option(TIFF_SAPI_BUILD_TESTING "" ON)
-set(SAPI_ENABLE_EXAMPLES ${TIFF_SAPI_ENABLE_EXAMPLES} CACHE BOOL "" FORCE)
-set(SAPI_ENABLE_TESTS ${TIFF_SAPI_ENABLE_TESTS} CACHE BOOL "" FORCE)
+set(SAPI_BUILD_EXAMPLES ${TIFF_SAPI_BUILD_EXAMPLES} CACHE BOOL "" FORCE)
+set(SAPI_BUILD_TESTING ${TIFF_SAPI_BUILD_TESTING} CACHE BOOL "" FORCE)
add_subdirectory(wrapper)
@@ -121,10 +121,10 @@
"${PROJECT_BINARY_DIR}" # To find the generated SAPI header
)
-if (TIFF_SAPI_ENABLE_EXAMPLES)
+if (TIFF_SAPI_BUILD_EXAMPLES)
add_subdirectory(example)
endif()
-if (TIFF_SAPI_ENABLE_TESTS)
+if (TIFF_SAPI_BUILD_TESTING)
add_subdirectory(test)
endif()
diff --git a/oss-internship-2020/libuv/CMakeLists.txt b/oss-internship-2020/libuv/CMakeLists.txt
index fed6f07..c00de3c 100644
--- a/oss-internship-2020/libuv/CMakeLists.txt
+++ b/oss-internship-2020/libuv/CMakeLists.txt
@@ -72,8 +72,8 @@
# Setup Sandboxed API
set(SAPI_ROOT "" CACHE PATH "Path to the Sandboxed API source tree")
-set(SAPI_ENABLE_EXAMPLES ${SAPI_UV_ENABLE_EXAMPLES} CACHE BOOL "" FORCE)
-set(SAPI_ENABLE_TESTS ${SAPI_UV_ENABLE_TESTS} CACHE BOOL "" FORCE)
+set(SAPI_BUILD_EXAMPLES ${SAPI_UV_ENABLE_EXAMPLES} CACHE BOOL "" FORCE)
+set(SAPI_BUILD_TESTING ${SAPI_UV_ENABLE_TESTS} CACHE BOOL "" FORCE)
# Generate SAPI header
add_sapi_library(uv_sapi
diff --git a/oss-internship-2020/openjpeg/CMakeLists.txt b/oss-internship-2020/openjpeg/CMakeLists.txt
index 2243056..0d9ad01 100644
--- a/oss-internship-2020/openjpeg/CMakeLists.txt
+++ b/oss-internship-2020/openjpeg/CMakeLists.txt
@@ -24,8 +24,8 @@
add_subdirectory(openjpeg)
set(SAPI_ROOT "../.." CACHE PATH "Path to the Sandboxed API source tree")
-set(SAPI_ENABLE_EXAMPLES OFF CACHE BOOL "")
-set(SAPI_ENABLE_TESTS OFF CACHE BOOL "")
+set(SAPI_BUILD_EXAMPLES OFF CACHE BOOL "")
+set(SAPI_BUILD_TESTING OFF CACHE BOOL "")
set(EXECUTABLE_OUTPUT_PATH "" CACHE PATH "" FORCE)
add_subdirectory("${SAPI_ROOT}"
"${CMAKE_BINARY_DIR}/sandboxed-api-build"
diff --git a/sandboxed_api/CMakeLists.txt b/sandboxed_api/CMakeLists.txt
index 7af38b4..892c9b1 100644
--- a/sandboxed_api/CMakeLists.txt
+++ b/sandboxed_api/CMakeLists.txt
@@ -190,7 +190,7 @@
PUBLIC glog::glog
)
-if(BUILD_TESTING AND SAPI_ENABLE_TESTS AND NOT CMAKE_CROSSCOMPILING)
+if(BUILD_TESTING AND SAPI_BUILD_TESTING AND NOT CMAKE_CROSSCOMPILING)
# sandboxed_api:testing
add_library(sapi_testing ${SAPI_LIB_TYPE}
testing.cc
diff --git a/sandboxed_api/examples/CMakeLists.txt b/sandboxed_api/examples/CMakeLists.txt
index f79da11..6ac3ca0 100644
--- a/sandboxed_api/examples/CMakeLists.txt
+++ b/sandboxed_api/examples/CMakeLists.txt
@@ -12,12 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-if((SAPI_ENABLE_EXAMPLES OR SAPI_ENABLE_TESTS) AND NOT CMAKE_CROSSCOMPILING)
+if((SAPI_BUILD_EXAMPLES OR SAPI_BUILD_TESTING) AND NOT CMAKE_CROSSCOMPILING)
# TODO(cblichmann): These are depended on by sapi::sapi_test
add_subdirectory(stringop)
add_subdirectory(sum)
endif()
-if(SAPI_ENABLE_EXAMPLES AND SAPI_DOWNLOAD_ZLIB)
+if(SAPI_BUILD_EXAMPLES AND SAPI_DOWNLOAD_ZLIB)
add_subdirectory(zlib)
endif()
diff --git a/sandboxed_api/examples/hello_sapi/CMakeLists.txt b/sandboxed_api/examples/hello_sapi/CMakeLists.txt
index 2ff0342..a058b15 100644
--- a/sandboxed_api/examples/hello_sapi/CMakeLists.txt
+++ b/sandboxed_api/examples/hello_sapi/CMakeLists.txt
@@ -28,8 +28,8 @@
CACHE PATH "Path to the Sandboxed API source tree")
# Configure options and include Sandboxed API as a sub-directory.
-set(SAPI_ENABLE_EXAMPLES OFF CACHE BOOL "")
-set(SAPI_ENABLE_TESTS OFF CACHE BOOL "")
+set(SAPI_BUILD_EXAMPLES OFF CACHE BOOL "")
+set(SAPI_BUILD_TESTING OFF CACHE BOOL "")
add_subdirectory("${SAPI_ROOT}"
"${CMAKE_BINARY_DIR}/sandboxed-api-build" EXCLUDE_FROM_ALL)
diff --git a/sandboxed_api/examples/stringop/CMakeLists.txt b/sandboxed_api/examples/stringop/CMakeLists.txt
index 1bbb6d2..4969651 100644
--- a/sandboxed_api/examples/stringop/CMakeLists.txt
+++ b/sandboxed_api/examples/stringop/CMakeLists.txt
@@ -65,7 +65,7 @@
sapi::base
)
-if(SAPI_ENABLE_TESTS)
+if(SAPI_BUILD_TESTING)
# sandboxed_api/examples/stringop:main_stringop
add_executable(sapi_main_stringop
main_stringop.cc
diff --git a/sandboxed_api/sandbox2/CMakeLists.txt b/sandboxed_api/sandbox2/CMakeLists.txt
index 4326cf8..e3ab21d 100644
--- a/sandboxed_api/sandbox2/CMakeLists.txt
+++ b/sandboxed_api/sandbox2/CMakeLists.txt
@@ -617,7 +617,7 @@
sapi::base
)
-if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
+if(BUILD_TESTING AND SAPI_BUILD_TESTING)
add_subdirectory(testcases)
# sandboxed_api/sandbox2:regs_test
diff --git a/sandboxed_api/sandbox2/examples/CMakeLists.txt b/sandboxed_api/sandbox2/examples/CMakeLists.txt
index e24a25c..9a8efb2 100644
--- a/sandboxed_api/sandbox2/examples/CMakeLists.txt
+++ b/sandboxed_api/sandbox2/examples/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-if(SAPI_ENABLE_EXAMPLES)
+if(SAPI_BUILD_EXAMPLES)
add_subdirectory(crc4)
add_subdirectory(custom_fork)
add_subdirectory(network)
diff --git a/sandboxed_api/sandbox2/network_proxy/CMakeLists.txt b/sandboxed_api/sandbox2/network_proxy/CMakeLists.txt
index e234811..342262a 100644
--- a/sandboxed_api/sandbox2/network_proxy/CMakeLists.txt
+++ b/sandboxed_api/sandbox2/network_proxy/CMakeLists.txt
@@ -61,7 +61,7 @@
sapi::status
)
-if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
+if(BUILD_TESTING AND SAPI_BUILD_TESTING)
# sandboxed_api/sandbox2/network_proxy:filtering_test
add_executable(sandbox2_filtering_test
filtering_test.cc
diff --git a/sandboxed_api/sandbox2/util/CMakeLists.txt b/sandboxed_api/sandbox2/util/CMakeLists.txt
index ebbc479..0bbc072 100644
--- a/sandboxed_api/sandbox2/util/CMakeLists.txt
+++ b/sandboxed_api/sandbox2/util/CMakeLists.txt
@@ -50,7 +50,7 @@
PUBLIC absl::statusor
)
-if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
+if(BUILD_TESTING AND SAPI_BUILD_TESTING)
# sandboxed_api/sandbox2/util:minielf_test
add_executable(sandbox2_minielf_test
minielf_test.cc
diff --git a/sandboxed_api/tools/clang_generator/CMakeLists.txt b/sandboxed_api/tools/clang_generator/CMakeLists.txt
index c5440df..723bcd0 100644
--- a/sandboxed_api/tools/clang_generator/CMakeLists.txt
+++ b/sandboxed_api/tools/clang_generator/CMakeLists.txt
@@ -67,7 +67,7 @@
sapi::generator
)
-if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
+if(BUILD_TESTING AND SAPI_BUILD_TESTING)
add_executable(sapi_generator_test
frontend_action_test_util.cc
frontend_action_test_util.h
diff --git a/sandboxed_api/tools/filewrapper/CMakeLists.txt b/sandboxed_api/tools/filewrapper/CMakeLists.txt
index 24af98f..a8723e5 100644
--- a/sandboxed_api/tools/filewrapper/CMakeLists.txt
+++ b/sandboxed_api/tools/filewrapper/CMakeLists.txt
@@ -30,7 +30,7 @@
SOURCES testdata/filewrapper_embedded.bin
)
-if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
+if(BUILD_TESTING AND SAPI_BUILD_TESTING)
# sandboxed_api/tools/filewrapper:filewrapper_test
add_executable(sapi_filewrapper_test
filewrapper_test.cc
diff --git a/sandboxed_api/util/CMakeLists.txt b/sandboxed_api/util/CMakeLists.txt
index 1c1d913..eacb5e4 100644
--- a/sandboxed_api/util/CMakeLists.txt
+++ b/sandboxed_api/util/CMakeLists.txt
@@ -148,7 +148,7 @@
absl::statusor
)
-if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
+if(BUILD_TESTING AND SAPI_BUILD_TESTING)
# sandboxed_api/util:file_base_test
add_executable(sapi_file_base_test
path_test.cc