Skip to content

Commit

Permalink
WIP Fix install. (google#556)
Browse files Browse the repository at this point in the history
Fix install.

Some header files were not being installed.
Split common.h into env.h and status.h.
  • Loading branch information
fjhenigman committed Jan 29, 2019
1 parent 6ff17fe commit e7a1910
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 21 deletions.
5 changes: 3 additions & 2 deletions libshaderc/include/shaderc/shaderc.h
Expand Up @@ -23,8 +23,9 @@ extern "C" {
#include <stddef.h>
#include <stdint.h>

#include "libshaderc_util/common.h"
#include "libshaderc_util/visibility.h"
#include "shaderc/env.h"
#include "shaderc/status.h"
#include "shaderc/visibility.h"

// Source language kind.
typedef enum {
Expand Down
5 changes: 3 additions & 2 deletions libshaderc_spvc/include/shaderc/spvc.h
Expand Up @@ -23,8 +23,9 @@ extern "C" {
#include <stddef.h>
#include <stdint.h>

#include "libshaderc_util/common.h"
#include "libshaderc_util/visibility.h"
#include "shaderc/env.h"
#include "shaderc/status.h"
#include "shaderc/visibility.h"

// An opaque handle to an object that manages all compiler state.
typedef struct shaderc_spvc_compiler* shaderc_spvc_compiler_t;
Expand Down
8 changes: 8 additions & 0 deletions libshaderc_util/CMakeLists.txt
Expand Up @@ -27,6 +27,14 @@ target_include_directories(shaderc_util
PUBLIC include PRIVATE ${glslang_SOURCE_DIR})

if(SHADERC_ENABLE_INSTALL)
install(
FILES
include/shaderc/env.h
include/shaderc/status.h
include/shaderc/visibility.h
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/shaderc)

install(TARGETS shaderc_util
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
Expand Down
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef LIBSHADERC_UTIL_COMMON_H_
#define LIBSHADERC_UTIL_COMMON_H_
#ifndef SHADERC_ENV_H_
#define SHADERC_ENV_H_

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -42,19 +42,8 @@ typedef enum {
shaderc_env_version_opengl_4_5 = 450,
} shaderc_env_version;

// Indicate the status of a compilation.
typedef enum {
shaderc_compilation_status_success = 0,
shaderc_compilation_status_invalid_stage, // error stage deduction
shaderc_compilation_status_compilation_error,
shaderc_compilation_status_internal_error, // unexpected failure
shaderc_compilation_status_null_result_object,
shaderc_compilation_status_invalid_assembly,
shaderc_compilation_status_validation_error,
} shaderc_compilation_status;

#ifdef __cplusplus
}
#endif // __cplusplus

#endif // LIBSHADERC_UTIL_COMMON_H_
#endif // SHADERC_ENV_H_
37 changes: 37 additions & 0 deletions libshaderc_util/include/shaderc/status.h
@@ -0,0 +1,37 @@
// Copyright 2018 The Shaderc Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef SHADERC_STATUS_H_
#define SHADERC_STATUS_H_

#ifdef __cplusplus
extern "C" {
#endif

// Indicate the status of a compilation.
typedef enum {
shaderc_compilation_status_success = 0,
shaderc_compilation_status_invalid_stage, // error stage deduction
shaderc_compilation_status_compilation_error,
shaderc_compilation_status_internal_error, // unexpected failure
shaderc_compilation_status_null_result_object,
shaderc_compilation_status_invalid_assembly,
shaderc_compilation_status_validation_error,
} shaderc_compilation_status;

#ifdef __cplusplus
}
#endif // __cplusplus

#endif // SHADERC_STATUS_H_
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef LIBSHADERC_UTIL_VISIBILITY_H_
#define LIBSHADERC_UTIL_VISIBILITY_H_
#ifndef SHADERC_VISIBILITY_H_
#define SHADERC_VISIBILITY_H_

// SHADERC_EXPORT tags symbol that will be exposed by the shared libraries.
#if defined(SHADERC_SHAREDLIB)
Expand All @@ -34,4 +34,4 @@
#define SHADERC_EXPORT
#endif

#endif // LIBSHADERC_UTIL_VISIBILITY_H_
#endif // SHADERC_VISIBILITY_H_

0 comments on commit e7a1910

Please sign in to comment.