Skip to content

Commit

Permalink
Fix build with new generator
Browse files Browse the repository at this point in the history
Lots of contrib packages did not build.

Fixes google#153
Fixes google#152
  • Loading branch information
DemiMarie committed Mar 24, 2022
1 parent 44cd37c commit cd51265
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 19 deletions.
1 change: 1 addition & 0 deletions contrib/c-blosc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ if(NOT TARGET sapi::sapi)
endif()

set(HIDE_SYMBOLS OFF CACHE BOOL "" FORCE)
set(PREFER_EXTERNAL_ZLIB ON CACHE BOOL "" FORCE) # prevent undefined symbol errors
FetchContent_Declare(
libblosc

Expand Down
2 changes: 1 addition & 1 deletion contrib/jsonnet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ FetchContent_Declare(jsonnet
GIT_REPOSITORY https://github.com/google/jsonnet.git
GIT_TAG v0.18.0 # 2021-12-21
)
option(BUILD_TESTS "" OFF) # Do not build jsonnet tests
set(BUILD_TESTS OFF CACHE BOOL "" FORCE) # Do not build jsonnet tests
FetchContent_MakeAvailable(jsonnet)
create_directory_symlink("${jsonnet_SOURCE_DIR}"
"${PROJECT_BINARY_DIR}/jsonnet")
Expand Down
2 changes: 1 addition & 1 deletion contrib/jsonnet/examples/jsonnet_base_example.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ absl::Status JsonnetMain(std::string in_file, std::string out_file) {

// Initialize sandbox.
JsonnetBaseSandbox sandbox(in_file, out_file);
SAPI_RETURN_IF_ERROR(sandbox.Init())
SAPI_RETURN_IF_ERROR(sandbox.Init());

JsonnetApi api(&sandbox);

Expand Down
2 changes: 1 addition & 1 deletion contrib/jsonnet/examples/jsonnet_formatter_example.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ absl::Status JsonnetMain(std::string in_file, std::string out_file) {

// Initialize sandbox.
JsonnetSapiSandbox sandbox(in_file, out_file);
SAPI_RETURN_IF_ERROR(sandbox.Init())
SAPI_RETURN_IF_ERROR(sandbox.Init());

JsonnetApi api(&sandbox);

Expand Down
2 changes: 1 addition & 1 deletion contrib/jsonnet/examples/jsonnet_multiple_files_example.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ absl::Status JsonnetMain(std::string in_file, std::string out_file) {

// Initialize sandbox.
JsonnetSapiSandbox sandbox(in_file, out_file);
SAPI_RETURN_IF_ERROR(sandbox.Init())
SAPI_RETURN_IF_ERROR(sandbox.Init());

JsonnetApi api(&sandbox);

Expand Down
2 changes: 1 addition & 1 deletion contrib/jsonnet/examples/jsonnet_yaml_stream_example.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ absl::Status JsonnetMain(std::string in_file, std::string out_file) {

// Initialize sandbox.
JsonnetBaseSandbox sandbox(in_file, out_file);
SAPI_RETURN_IF_ERROR(sandbox.Init())
SAPI_RETURN_IF_ERROR(sandbox.Init());

JsonnetApi api(&sandbox);

Expand Down
3 changes: 1 addition & 2 deletions contrib/libzip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ if(NOT TARGET sapi::sapi)
endif()

set(BUILD_SHARED_LIBS off)
set(LIBZIP_DO_INSTALL off)
FetchContent_Declare(libzip
GIT_REPOSITORY https://github.com/nih-at/libzip/
GIT_TAG 34b13ca4e887a5aba050015e3a179069643f4e76
Expand Down Expand Up @@ -72,8 +73,6 @@ add_sapi_library(

zip_strerror
INPUTS
"${libzip_BINARY_DIR}/zipconf.h"
"${libzip_SOURCE_DIR}/lib/zip.h"
"wrapper/wrapper_zip.h"

LIBRARY wrapper_zip
Expand Down
5 changes: 0 additions & 5 deletions contrib/libzip/sandboxed.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@

#include <memory>

// Note: This header is required because of the bug in generator. The generator
// for some reason doesn't catch the types defined by zip (for example
// zip_uint32_t).
#include <zipconf.h> // NOLINT(build/include_order)

#include "sapi_zip.sapi.h" // NOLINT(build/include)

class ZipSapiSandbox : public ZipSandbox {
Expand Down
3 changes: 0 additions & 3 deletions contrib/pffft/main_pffft_sandboxed.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
#include "absl/flags/flag.h"
#include "sandboxed_api/vars.h"

ABSL_DECLARE_FLAG(string, sandbox2_danger_danger_permit_all);
ABSL_DECLARE_FLAG(string, sandbox2_danger_danger_permit_all_and_log);

class PffftSapiSandbox : public PffftSandbox {
public:
std::unique_ptr<sandbox2::Policy> ModifyPolicy(sandbox2::PolicyBuilder*) {
Expand Down
8 changes: 8 additions & 0 deletions contrib/turbojpeg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ add_sapi_library(turbojpeg_sapi
LIBRARY turbojpeg
LIBRARY_NAME TurboJPEG
NAMESPACE "turbojpeg_sapi"
FUNCTIONS
tjDestroy
tjGetErrorStr2
tjCompress2
tjInitCompress
tjInitDecompress
tjDecompressHeader3
tjDecompress2
)
add_library(sapi_contrib::turbojpeg ALIAS turbojpeg_sapi)
target_include_directories(turbojpeg_sapi INTERFACE
Expand Down
3 changes: 0 additions & 3 deletions contrib/zopfli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ add_sapi_library(

ZopfliCompressFD
INPUTS
"${zopfli_SOURCE_DIR}/src/zopfli/deflate.h"
"${zopfli_SOURCE_DIR}/src/zopfli/gzip_container.h"
"${zopfli_SOURCE_DIR}/src/zopfli/zlib_container.h"
wrapper/wrapper_zopfli.h

LIBRARY wrapper_zopfli
Expand Down
1 change: 0 additions & 1 deletion contrib/zstd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ add_sapi_library(
ZSTD_decompress_fd
ZSTD_decompressStream_fd
INPUTS
"${libzstd_INCLUDE_DIR}/zstd.h"
wrapper/wrapper_zstd.h

LIBRARY wrapper_zstd
Expand Down

0 comments on commit cd51265

Please sign in to comment.