mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
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
This commit is contained in:
parent
c0cfeed925
commit
839914d6dd
4
.github/workflows/ubuntu-cmake-contrib.yml
vendored
4
.github/workflows/ubuntu-cmake-contrib.yml
vendored
|
@ -68,8 +68,8 @@ jobs:
|
||||||
-B $GITHUB_WORKSPACE/build \
|
-B $GITHUB_WORKSPACE/build \
|
||||||
-G Ninja \
|
-G Ninja \
|
||||||
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
||||||
-DSAPI_ENABLE_TEST=ON \
|
-DSAPI_BUILD_TESTING=ON \
|
||||||
-DSAPI_ENABLE_EXAMPLES=ON
|
-DSAPI_BUILD_EXAMPLES=ON
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -149,7 +149,7 @@ target_link_libraries(sapi_test_main INTERFACE
|
||||||
sapi::base
|
sapi::base
|
||||||
)
|
)
|
||||||
|
|
||||||
if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
|
if(BUILD_TESTING AND SAPI_BUILD_TESTING)
|
||||||
include(GoogleTest)
|
include(GoogleTest)
|
||||||
# Setup tests to work like with Bazel
|
# Setup tests to work like with Bazel
|
||||||
create_directory_symlink("${SAPI_BINARY_DIR}" com_google_sandboxed_api)
|
create_directory_symlink("${SAPI_BINARY_DIR}" com_google_sandboxed_api)
|
||||||
|
@ -158,6 +158,6 @@ endif()
|
||||||
|
|
||||||
add_subdirectory(sandboxed_api)
|
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)
|
add_subdirectory(contrib)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -41,7 +41,7 @@ endif()
|
||||||
set(_sapi_saved_BUILD_TESTING ${BUILD_TESTING})
|
set(_sapi_saved_BUILD_TESTING ${BUILD_TESTING})
|
||||||
set(BUILD_TESTING OFF) # No need to build test code of our deps
|
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)
|
if(SAPI_DOWNLOAD_GOOGLETEST)
|
||||||
include(cmake/googletest.cmake)
|
include(cmake/googletest.cmake)
|
||||||
endif()
|
endif()
|
||||||
|
@ -99,7 +99,7 @@ if(SAPI_DOWNLOAD_PROTOBUF)
|
||||||
endif()
|
endif()
|
||||||
find_package(Protobuf REQUIRED)
|
find_package(Protobuf REQUIRED)
|
||||||
|
|
||||||
if(SAPI_ENABLE_EXAMPLES)
|
if(SAPI_BUILD_EXAMPLES)
|
||||||
if(SAPI_DOWNLOAD_ZLIB)
|
if(SAPI_DOWNLOAD_ZLIB)
|
||||||
include(cmake/zlib.cmake)
|
include(cmake/zlib.cmake)
|
||||||
sapi_check_target(ZLIB::ZLIB)
|
sapi_check_target(ZLIB::ZLIB)
|
||||||
|
|
|
@ -38,19 +38,20 @@ option(SAPI_DOWNLOAD_LIBCAP "Download libcap at config time" ON)
|
||||||
option(SAPI_DOWNLOAD_LIBFFI "Download libffi at config time" ON)
|
option(SAPI_DOWNLOAD_LIBFFI "Download libffi at config time" ON)
|
||||||
|
|
||||||
# Options for building examples
|
# Options for building examples
|
||||||
option(SAPI_ENABLE_EXAMPLES
|
option(SAPI_BUILD_EXAMPLES
|
||||||
"Build example code" ${_sapi_enable_tests_examples_default}
|
"If ON, build example code" ${_sapi_enable_tests_examples_default}
|
||||||
)
|
)
|
||||||
option(SAPI_DOWNLOAD_ZLIB
|
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}
|
${_sapi_enable_tests_examples_default}
|
||||||
)
|
)
|
||||||
|
|
||||||
option(SAPI_ENABLE_TESTS
|
option(SAPI_BUILD_TESTING
|
||||||
"Build unit tests" ${_sapi_enable_tests_examples_default}
|
"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.
|
# 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
|
option(SAPI_ENABLE_GENERATOR
|
||||||
"Build Clang based code generator from source" OFF
|
"Build Clang based code generator from source" OFF
|
||||||
|
|
|
@ -72,10 +72,10 @@ target_include_directories(sapi_brotli INTERFACE
|
||||||
"${SAPI_SOURCE_DIR}"
|
"${SAPI_SOURCE_DIR}"
|
||||||
)
|
)
|
||||||
|
|
||||||
if(SAPI_ENABLE_EXAMPLES)
|
if(SAPI_BUILD_EXAMPLES)
|
||||||
add_subdirectory(example)
|
add_subdirectory(example)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
|
if(BUILD_TESTING AND SAPI_BUILD_TESTING)
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -81,10 +81,10 @@ target_include_directories(sapi_blosc INTERFACE
|
||||||
"${PROJECT_BINARY_DIR}"
|
"${PROJECT_BINARY_DIR}"
|
||||||
)
|
)
|
||||||
|
|
||||||
if (SAPI_ENABLE_EXAMPLES)
|
if (SAPI_BUILD_EXAMPLES)
|
||||||
add_subdirectory(example)
|
add_subdirectory(example)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (BUILD_TESTING AND SAPI_ENABLE_TESTS)
|
if (BUILD_TESTING AND SAPI_BUILD_TESTING)
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -133,10 +133,10 @@ target_include_directories(sapi_hunspell INTERFACE
|
||||||
"${PROJECT_BINARY_DIR}"
|
"${PROJECT_BINARY_DIR}"
|
||||||
)
|
)
|
||||||
|
|
||||||
if(SAPI_ENABLE_EXAMPLES)
|
if(SAPI_BUILD_EXAMPLES)
|
||||||
add_subdirectory(example)
|
add_subdirectory(example)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
|
if(BUILD_TESTING AND SAPI_BUILD_TESTING)
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -89,11 +89,11 @@ target_link_libraries(jsonnet_sapi PUBLIC
|
||||||
sapi_contrib::jsonnet_helper
|
sapi_contrib::jsonnet_helper
|
||||||
)
|
)
|
||||||
|
|
||||||
if(SAPI_ENABLE_EXAMPLES)
|
if(SAPI_BUILD_EXAMPLES)
|
||||||
add_subdirectory(examples)
|
add_subdirectory(examples)
|
||||||
endif()
|
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
|
# Create directories so the tests will be able to access them
|
||||||
file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/tests_input"
|
file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/tests_input"
|
||||||
"${PROJECT_BINARY_DIR}/tests_output"
|
"${PROJECT_BINARY_DIR}/tests_output"
|
||||||
|
|
|
@ -53,7 +53,7 @@ in the `contrib/jsonnet` directory:
|
||||||
|
|
||||||
```
|
```
|
||||||
mkdir -p build && cd build
|
mkdir -p build && cd build
|
||||||
cmake .. -G Ninja -Wno-dev -DSAPI_ENABLE_TESTS=ON
|
cmake .. -G Ninja -Wno-dev -DSAPI_BUILD_TESTING=ON
|
||||||
ninja
|
ninja
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,6 @@ target_link_libraries(libidn2_sapi_wrapper
|
||||||
PRIVATE idn2
|
PRIVATE idn2
|
||||||
)
|
)
|
||||||
|
|
||||||
if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
|
if(BUILD_TESTING AND SAPI_BUILD_TESTING)
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -87,10 +87,10 @@ target_include_directories(sapi_zip INTERFACE
|
||||||
"${SAPI_SOURCE_DIR}"
|
"${SAPI_SOURCE_DIR}"
|
||||||
)
|
)
|
||||||
|
|
||||||
if(SAPI_ENABLE_EXAMPLES)
|
if(SAPI_BUILD_EXAMPLES)
|
||||||
add_subdirectory(example)
|
add_subdirectory(example)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
|
if(BUILD_TESTING AND SAPI_BUILD_TESTING)
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -41,6 +41,6 @@ target_include_directories(turbojpeg_sapi INTERFACE
|
||||||
"${PROJECT_BINARY_DIR}"
|
"${PROJECT_BINARY_DIR}"
|
||||||
)
|
)
|
||||||
|
|
||||||
if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
|
if(BUILD_TESTING AND SAPI_BUILD_TESTING)
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -73,10 +73,10 @@ target_include_directories(sapi_uriparser INTERFACE
|
||||||
"${SAPI_SOURCE_DIR}"
|
"${SAPI_SOURCE_DIR}"
|
||||||
)
|
)
|
||||||
|
|
||||||
if(SAPI_ENABLE_EXAMPLES)
|
if(SAPI_BUILD_EXAMPLES)
|
||||||
add_subdirectory(example)
|
add_subdirectory(example)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
|
if(BUILD_TESTING AND SAPI_BUILD_TESTING)
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -61,7 +61,7 @@ target_include_directories(woff2_sapi INTERFACE
|
||||||
"${SAPI_SOURCE_DIR}"
|
"${SAPI_SOURCE_DIR}"
|
||||||
)
|
)
|
||||||
|
|
||||||
if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
|
if(BUILD_TESTING AND SAPI_BUILD_TESTING)
|
||||||
enable_testing()
|
enable_testing()
|
||||||
add_executable(woff2_sapi_test
|
add_executable(woff2_sapi_test
|
||||||
woff2_sapi_test.cc
|
woff2_sapi_test.cc
|
||||||
|
|
|
@ -64,10 +64,10 @@ target_include_directories(sapi_zopfli INTERFACE
|
||||||
"${SAPI_SOURCE_DIR}"
|
"${SAPI_SOURCE_DIR}"
|
||||||
)
|
)
|
||||||
|
|
||||||
if(SAPI_ENABLE_EXAMPLES)
|
if(SAPI_BUILD_EXAMPLES)
|
||||||
add_subdirectory(example)
|
add_subdirectory(example)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
|
if(BUILD_TESTING AND SAPI_BUILD_TESTING)
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -92,10 +92,10 @@ target_include_directories(sapi_zstd INTERFACE
|
||||||
"${SAPI_SOURCE_DIR}"
|
"${SAPI_SOURCE_DIR}"
|
||||||
)
|
)
|
||||||
|
|
||||||
if(SAPI_ENABLE_EXAMPLES)
|
if(SAPI_BUILD_EXAMPLES)
|
||||||
add_subdirectory(example)
|
add_subdirectory(example)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
|
if(BUILD_TESTING AND SAPI_BUILD_TESTING)
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -35,8 +35,8 @@ add_subdirectory(curl_wrapper)
|
||||||
|
|
||||||
# Setup Sandboxed API
|
# Setup Sandboxed API
|
||||||
set(SAPI_ROOT "../.." CACHE PATH "Path to the Sandboxed API source tree")
|
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_BUILD_EXAMPLES ${SAPI_CURL_ENABLE_EXAMPLES} CACHE BOOL "" FORCE)
|
||||||
set(SAPI_ENABLE_TESTS ${SAPI_CURL_ENABLE_TESTS} CACHE BOOL "" FORCE)
|
set(SAPI_BUILD_TESTING ${SAPI_CURL_ENABLE_TESTS} CACHE BOOL "" FORCE)
|
||||||
add_subdirectory(
|
add_subdirectory(
|
||||||
"${SAPI_ROOT}"
|
"${SAPI_ROOT}"
|
||||||
"${CMAKE_BINARY_DIR}/sandboxed-api-build"
|
"${CMAKE_BINARY_DIR}/sandboxed-api-build"
|
||||||
|
|
|
@ -99,7 +99,7 @@ website. More information about each example can be found in the examples'
|
||||||
[README](examples/README.md).
|
[README](examples/README.md).
|
||||||
|
|
||||||
To build these examples when building the library, the cmake variable
|
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.
|
examples as well.
|
||||||
|
|
||||||
## Policy
|
## Policy
|
||||||
|
@ -117,7 +117,7 @@ The `tests` folder contains some test cases created using Google Test. The class
|
||||||
including the setup of a mock local server on which test requests are performed.
|
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
|
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.
|
as well.
|
||||||
|
|
||||||
## Callbacks
|
## Callbacks
|
||||||
|
|
|
@ -27,8 +27,8 @@ pkg_check_modules(proj REQUIRED IMPORTED_TARGET proj)
|
||||||
set(SAPI_ROOT "${PROJECT_SOURCE_DIR}/../.." CACHE PATH "Path to the Sandboxed API source tree")
|
set(SAPI_ROOT "${PROJECT_SOURCE_DIR}/../.." CACHE PATH "Path to the Sandboxed API source tree")
|
||||||
# cmake .. -G Ninja -DSAPI_ROOT=$HOME/sapi_root
|
# cmake .. -G Ninja -DSAPI_ROOT=$HOME/sapi_root
|
||||||
|
|
||||||
set(SAPI_ENABLE_EXAMPLES OFF CACHE BOOL "")
|
set(SAPI_BUILD_EXAMPLES OFF CACHE BOOL "")
|
||||||
set(SAPI_ENABLE_TESTS OFF CACHE BOOL "")
|
set(SAPI_BUILD_TESTING OFF CACHE BOOL "")
|
||||||
add_subdirectory("${SAPI_ROOT}"
|
add_subdirectory("${SAPI_ROOT}"
|
||||||
"${CMAKE_BINARY_DIR}/sandboxed-api-build"
|
"${CMAKE_BINARY_DIR}/sandboxed-api-build"
|
||||||
# Omit this to have the full Sandboxed API in IDE
|
# Omit this to have the full Sandboxed API in IDE
|
||||||
|
|
|
@ -27,11 +27,11 @@ set(SAPI_ROOT "" CACHE PATH "Path to the Sandboxed API source tree")
|
||||||
# mkdir -p build && cd build
|
# mkdir -p build && cd build
|
||||||
# cmake .. -G Ninja -DSAPI_ROOT=/path/to/sapi_root
|
# cmake .. -G Ninja -DSAPI_ROOT=/path/to/sapi_root
|
||||||
|
|
||||||
option(LIBPNG_SAPI_ENABLE_EXAMPLES "" OFF)
|
option(LIBPNG_SAPI_BUILD_EXAMPLES "" OFF)
|
||||||
option(LIBPNG_SAPI_ENABLE_TESTS "" OFF)
|
option(LIBPNG_SAPI_BUILD_TESTING "" OFF)
|
||||||
|
|
||||||
set(SAPI_ENABLE_EXAMPLES ${LIBPNG_SAPI_ENABLE_EXAMPLES} CACHE BOOL "" FORCE)
|
set(SAPI_BUILD_EXAMPLES ${LIBPNG_SAPI_BUILD_EXAMPLES} CACHE BOOL "" FORCE)
|
||||||
set(SAPI_ENABLE_TESTS ${LIBPNG_SAPI_ENABLE_TESTS} CACHE BOOL "" FORCE)
|
set(SAPI_BUILD_TESTING ${LIBPNG_SAPI_BUILD_TESTING} CACHE BOOL "" FORCE)
|
||||||
|
|
||||||
set (CMAKE_FIND_LIBRARY_SUFFIXES .a $ {CMAKE_FIND_LIBRARY_SUFFIXES})
|
set (CMAKE_FIND_LIBRARY_SUFFIXES .a $ {CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||||
find_package(PNG REQUIRED)
|
find_package(PNG REQUIRED)
|
||||||
|
@ -102,11 +102,11 @@ target_include_directories(libpng_sapi INTERFACE
|
||||||
"${PROJECT_BINARY_DIR}" # To find the generated SAPI header
|
"${PROJECT_BINARY_DIR}" # To find the generated SAPI header
|
||||||
)
|
)
|
||||||
|
|
||||||
if (LIBPNG_SAPI_ENABLE_EXAMPLES)
|
if (LIBPNG_SAPI_BUILD_EXAMPLES)
|
||||||
add_subdirectory(examples)
|
add_subdirectory(examples)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (LIBPNG_SAPI_ENABLE_TESTS)
|
if (LIBPNG_SAPI_BUILD_TESTING)
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ make -j8
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Example:
|
#### 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:
|
run PNG to PNG:
|
||||||
```
|
```
|
||||||
./examples/pngtopng /absolute/path/to/input/image.png /absolute/path/to/output/image.png
|
./examples/pngtopng /absolute/path/to/input/image.png /absolute/path/to/output/image.png
|
||||||
|
@ -38,7 +38,7 @@ output: `images/rgbtobgr_red_ball.png`
|
||||||
|
|
||||||
|
|
||||||
#### Tests:
|
#### 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
|
cd tests
|
||||||
ctest .
|
ctest .
|
||||||
|
|
|
@ -27,11 +27,11 @@ set(SAPI_ROOT "" CACHE PATH "Path to the Sandboxed API source tree")
|
||||||
# mkdir -p build && cd build
|
# mkdir -p build && cd build
|
||||||
# cmake .. -G Ninja -DSAPI_ROOT=$HOME/sapi_root
|
# cmake .. -G Ninja -DSAPI_ROOT=$HOME/sapi_root
|
||||||
|
|
||||||
option(TIFF_SAPI_ENABLE_EXAMPLES "" ON)
|
option(TIFF_SAPI_BUILD_EXAMPLES "" ON)
|
||||||
option(TIFF_SAPI_ENABLE_TESTS "" ON)
|
option(TIFF_SAPI_BUILD_TESTING "" ON)
|
||||||
|
|
||||||
set(SAPI_ENABLE_EXAMPLES ${TIFF_SAPI_ENABLE_EXAMPLES} CACHE BOOL "" FORCE)
|
set(SAPI_BUILD_EXAMPLES ${TIFF_SAPI_BUILD_EXAMPLES} CACHE BOOL "" FORCE)
|
||||||
set(SAPI_ENABLE_TESTS ${TIFF_SAPI_ENABLE_TESTS} CACHE BOOL "" FORCE)
|
set(SAPI_BUILD_TESTING ${TIFF_SAPI_BUILD_TESTING} CACHE BOOL "" FORCE)
|
||||||
|
|
||||||
add_subdirectory(wrapper)
|
add_subdirectory(wrapper)
|
||||||
|
|
||||||
|
@ -121,10 +121,10 @@ target_include_directories(tiff_sapi INTERFACE
|
||||||
"${PROJECT_BINARY_DIR}" # To find the generated SAPI header
|
"${PROJECT_BINARY_DIR}" # To find the generated SAPI header
|
||||||
)
|
)
|
||||||
|
|
||||||
if (TIFF_SAPI_ENABLE_EXAMPLES)
|
if (TIFF_SAPI_BUILD_EXAMPLES)
|
||||||
add_subdirectory(example)
|
add_subdirectory(example)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (TIFF_SAPI_ENABLE_TESTS)
|
if (TIFF_SAPI_BUILD_TESTING)
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -72,8 +72,8 @@ target_link_libraries(uv_wrapper_and_callbacks uv_a)
|
||||||
|
|
||||||
# Setup Sandboxed API
|
# Setup Sandboxed API
|
||||||
set(SAPI_ROOT "" CACHE PATH "Path to the Sandboxed API source tree")
|
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_BUILD_EXAMPLES ${SAPI_UV_ENABLE_EXAMPLES} CACHE BOOL "" FORCE)
|
||||||
set(SAPI_ENABLE_TESTS ${SAPI_UV_ENABLE_TESTS} CACHE BOOL "" FORCE)
|
set(SAPI_BUILD_TESTING ${SAPI_UV_ENABLE_TESTS} CACHE BOOL "" FORCE)
|
||||||
|
|
||||||
# Generate SAPI header
|
# Generate SAPI header
|
||||||
add_sapi_library(uv_sapi
|
add_sapi_library(uv_sapi
|
||||||
|
|
|
@ -24,8 +24,8 @@ set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build OpenJPEG shared library and link exe
|
||||||
add_subdirectory(openjpeg)
|
add_subdirectory(openjpeg)
|
||||||
|
|
||||||
set(SAPI_ROOT "../.." CACHE PATH "Path to the Sandboxed API source tree")
|
set(SAPI_ROOT "../.." CACHE PATH "Path to the Sandboxed API source tree")
|
||||||
set(SAPI_ENABLE_EXAMPLES OFF CACHE BOOL "")
|
set(SAPI_BUILD_EXAMPLES OFF CACHE BOOL "")
|
||||||
set(SAPI_ENABLE_TESTS OFF CACHE BOOL "")
|
set(SAPI_BUILD_TESTING OFF CACHE BOOL "")
|
||||||
set(EXECUTABLE_OUTPUT_PATH "" CACHE PATH "" FORCE)
|
set(EXECUTABLE_OUTPUT_PATH "" CACHE PATH "" FORCE)
|
||||||
add_subdirectory("${SAPI_ROOT}"
|
add_subdirectory("${SAPI_ROOT}"
|
||||||
"${CMAKE_BINARY_DIR}/sandboxed-api-build"
|
"${CMAKE_BINARY_DIR}/sandboxed-api-build"
|
||||||
|
|
|
@ -190,7 +190,7 @@ target_link_libraries(sapi_client
|
||||||
PUBLIC glog::glog
|
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
|
# sandboxed_api:testing
|
||||||
add_library(sapi_testing ${SAPI_LIB_TYPE}
|
add_library(sapi_testing ${SAPI_LIB_TYPE}
|
||||||
testing.cc
|
testing.cc
|
||||||
|
|
|
@ -12,12 +12,12 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# 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
|
# TODO(cblichmann): These are depended on by sapi::sapi_test
|
||||||
add_subdirectory(stringop)
|
add_subdirectory(stringop)
|
||||||
add_subdirectory(sum)
|
add_subdirectory(sum)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(SAPI_ENABLE_EXAMPLES AND SAPI_DOWNLOAD_ZLIB)
|
if(SAPI_BUILD_EXAMPLES AND SAPI_DOWNLOAD_ZLIB)
|
||||||
add_subdirectory(zlib)
|
add_subdirectory(zlib)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -28,8 +28,8 @@ set(SAPI_ROOT "${PROJECT_SOURCE_DIR}/../../.."
|
||||||
CACHE PATH "Path to the Sandboxed API source tree")
|
CACHE PATH "Path to the Sandboxed API source tree")
|
||||||
|
|
||||||
# Configure options and include Sandboxed API as a sub-directory.
|
# Configure options and include Sandboxed API as a sub-directory.
|
||||||
set(SAPI_ENABLE_EXAMPLES OFF CACHE BOOL "")
|
set(SAPI_BUILD_EXAMPLES OFF CACHE BOOL "")
|
||||||
set(SAPI_ENABLE_TESTS OFF CACHE BOOL "")
|
set(SAPI_BUILD_TESTING OFF CACHE BOOL "")
|
||||||
add_subdirectory("${SAPI_ROOT}"
|
add_subdirectory("${SAPI_ROOT}"
|
||||||
"${CMAKE_BINARY_DIR}/sandboxed-api-build" EXCLUDE_FROM_ALL)
|
"${CMAKE_BINARY_DIR}/sandboxed-api-build" EXCLUDE_FROM_ALL)
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ target_link_libraries(stringop-sapi PRIVATE
|
||||||
sapi::base
|
sapi::base
|
||||||
)
|
)
|
||||||
|
|
||||||
if(SAPI_ENABLE_TESTS)
|
if(SAPI_BUILD_TESTING)
|
||||||
# sandboxed_api/examples/stringop:main_stringop
|
# sandboxed_api/examples/stringop:main_stringop
|
||||||
add_executable(sapi_main_stringop
|
add_executable(sapi_main_stringop
|
||||||
main_stringop.cc
|
main_stringop.cc
|
||||||
|
|
|
@ -617,7 +617,7 @@ target_link_libraries(sandbox2_violation_proto PRIVATE
|
||||||
sapi::base
|
sapi::base
|
||||||
)
|
)
|
||||||
|
|
||||||
if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
|
if(BUILD_TESTING AND SAPI_BUILD_TESTING)
|
||||||
add_subdirectory(testcases)
|
add_subdirectory(testcases)
|
||||||
|
|
||||||
# sandboxed_api/sandbox2:regs_test
|
# sandboxed_api/sandbox2:regs_test
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
if(SAPI_ENABLE_EXAMPLES)
|
if(SAPI_BUILD_EXAMPLES)
|
||||||
add_subdirectory(crc4)
|
add_subdirectory(crc4)
|
||||||
add_subdirectory(custom_fork)
|
add_subdirectory(custom_fork)
|
||||||
add_subdirectory(network)
|
add_subdirectory(network)
|
||||||
|
|
|
@ -61,7 +61,7 @@ target_link_libraries(sandbox2_network_proxy_client PRIVATE
|
||||||
sapi::status
|
sapi::status
|
||||||
)
|
)
|
||||||
|
|
||||||
if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
|
if(BUILD_TESTING AND SAPI_BUILD_TESTING)
|
||||||
# sandboxed_api/sandbox2/network_proxy:filtering_test
|
# sandboxed_api/sandbox2/network_proxy:filtering_test
|
||||||
add_executable(sandbox2_filtering_test
|
add_executable(sandbox2_filtering_test
|
||||||
filtering_test.cc
|
filtering_test.cc
|
||||||
|
|
|
@ -50,7 +50,7 @@ target_link_libraries(sandbox2_util_maps_parser
|
||||||
PUBLIC absl::statusor
|
PUBLIC absl::statusor
|
||||||
)
|
)
|
||||||
|
|
||||||
if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
|
if(BUILD_TESTING AND SAPI_BUILD_TESTING)
|
||||||
# sandboxed_api/sandbox2/util:minielf_test
|
# sandboxed_api/sandbox2/util:minielf_test
|
||||||
add_executable(sandbox2_minielf_test
|
add_executable(sandbox2_minielf_test
|
||||||
minielf_test.cc
|
minielf_test.cc
|
||||||
|
|
|
@ -67,7 +67,7 @@ target_link_libraries(sapi_generator_tool PRIVATE
|
||||||
sapi::generator
|
sapi::generator
|
||||||
)
|
)
|
||||||
|
|
||||||
if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
|
if(BUILD_TESTING AND SAPI_BUILD_TESTING)
|
||||||
add_executable(sapi_generator_test
|
add_executable(sapi_generator_test
|
||||||
frontend_action_test_util.cc
|
frontend_action_test_util.cc
|
||||||
frontend_action_test_util.h
|
frontend_action_test_util.h
|
||||||
|
|
|
@ -30,7 +30,7 @@ sapi_cc_embed_data(NAME filewrapper_embedded
|
||||||
SOURCES testdata/filewrapper_embedded.bin
|
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
|
# sandboxed_api/tools/filewrapper:filewrapper_test
|
||||||
add_executable(sapi_filewrapper_test
|
add_executable(sapi_filewrapper_test
|
||||||
filewrapper_test.cc
|
filewrapper_test.cc
|
||||||
|
|
|
@ -148,7 +148,7 @@ target_link_libraries(sapi_util_temp_file
|
||||||
absl::statusor
|
absl::statusor
|
||||||
)
|
)
|
||||||
|
|
||||||
if(BUILD_TESTING AND SAPI_ENABLE_TESTS)
|
if(BUILD_TESTING AND SAPI_BUILD_TESTING)
|
||||||
# sandboxed_api/util:file_base_test
|
# sandboxed_api/util:file_base_test
|
||||||
add_executable(sapi_file_base_test
|
add_executable(sapi_file_base_test
|
||||||
path_test.cc
|
path_test.cc
|
||||||
|
|
Loading…
Reference in New Issue
Block a user