Remove OGLCompiler and HLSL stub libraries from build
Fixes ranlib warnings complaining about empty archive libraries. Simplifie build/code.
This commit is contained in:
parent
c59b876ca0
commit
6be56e45e5
16 changed files with 17 additions and 392 deletions
|
|
@ -143,7 +143,7 @@ glslang_add_build_info_dependency(MachineIndependent)
|
|||
|
||||
glslang_pch(MachineIndependent MachineIndependent/pch.h)
|
||||
|
||||
target_link_libraries(MachineIndependent PRIVATE OGLCompiler OSDependent GenericCodeGen)
|
||||
target_link_libraries(MachineIndependent PRIVATE OSDependent GenericCodeGen)
|
||||
|
||||
################################################################################
|
||||
# glslang
|
||||
|
|
@ -174,7 +174,7 @@ set_target_properties(glslang PROPERTIES
|
|||
POSITION_INDEPENDENT_CODE ON
|
||||
VERSION "${GLSLANG_VERSION}"
|
||||
SOVERSION "${GLSLANG_VERSION_MAJOR}")
|
||||
target_link_libraries(glslang PRIVATE OGLCompiler OSDependent MachineIndependent)
|
||||
target_link_libraries(glslang PRIVATE OSDependent MachineIndependent)
|
||||
target_include_directories(glslang PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
|
||||
|
|
|
|||
|
|
@ -58,7 +58,6 @@
|
|||
#endif
|
||||
|
||||
#include "../Include/ShHandle.h"
|
||||
#include "../../OGLCompilersDLL/InitializeDll.h"
|
||||
|
||||
#include "preprocessor/PpContext.h"
|
||||
|
||||
|
|
@ -1311,9 +1310,6 @@ bool CompileDeferred(
|
|||
//
|
||||
int ShInitialize()
|
||||
{
|
||||
if (! InitProcess())
|
||||
return 0;
|
||||
|
||||
const std::lock_guard<std::mutex> lock(init_lock);
|
||||
++NumberOfClients;
|
||||
|
||||
|
|
@ -1335,9 +1331,6 @@ int ShInitialize()
|
|||
|
||||
ShHandle ShConstructCompiler(const EShLanguage language, int /*debugOptions unused*/)
|
||||
{
|
||||
if (!InitThread())
|
||||
return nullptr;
|
||||
|
||||
TShHandleBase* base = static_cast<TShHandleBase*>(ConstructCompiler(language, 0));
|
||||
|
||||
return reinterpret_cast<void*>(base);
|
||||
|
|
@ -1345,9 +1338,6 @@ ShHandle ShConstructCompiler(const EShLanguage language, int /*debugOptions unus
|
|||
|
||||
ShHandle ShConstructLinker(const EShExecutable executable, int /*debugOptions unused*/)
|
||||
{
|
||||
if (!InitThread())
|
||||
return nullptr;
|
||||
|
||||
TShHandleBase* base = static_cast<TShHandleBase*>(ConstructLinker(executable, 0));
|
||||
|
||||
return reinterpret_cast<void*>(base);
|
||||
|
|
@ -1355,9 +1345,6 @@ ShHandle ShConstructLinker(const EShExecutable executable, int /*debugOptions un
|
|||
|
||||
ShHandle ShConstructUniformMap()
|
||||
{
|
||||
if (!InitThread())
|
||||
return nullptr;
|
||||
|
||||
TShHandleBase* base = static_cast<TShHandleBase*>(ConstructUniformMap());
|
||||
|
||||
return reinterpret_cast<void*>(base);
|
||||
|
|
@ -1871,8 +1858,6 @@ void TShader::setFlattenUniformArrays(bool flatten) { intermediate->setFlatt
|
|||
bool TShader::parse(const TBuiltInResource* builtInResources, int defaultVersion, EProfile defaultProfile, bool forceDefaultVersionAndProfile,
|
||||
bool forwardCompatible, EShMessages messages, Includer& includer)
|
||||
{
|
||||
if (! InitThread())
|
||||
return false;
|
||||
SetThreadPoolAllocator(pool);
|
||||
|
||||
if (! preamble)
|
||||
|
|
@ -1897,8 +1882,6 @@ bool TShader::preprocess(const TBuiltInResource* builtInResources,
|
|||
std::string* output_string,
|
||||
Includer& includer)
|
||||
{
|
||||
if (! InitThread())
|
||||
return false;
|
||||
SetThreadPoolAllocator(pool);
|
||||
|
||||
if (! preamble)
|
||||
|
|
|
|||
|
|
@ -31,15 +31,19 @@
|
|||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
set(SOURCES ossource.cpp ../osinclude.h)
|
||||
add_library(OSDependent STATIC)
|
||||
|
||||
target_sources(OSDependent PRIVATE
|
||||
../osinclude.h
|
||||
ossource.cpp
|
||||
)
|
||||
|
||||
add_library(OSDependent STATIC ${SOURCES})
|
||||
set_property(TARGET OSDependent PROPERTY FOLDER glslang)
|
||||
set_property(TARGET OSDependent PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
# MinGW GCC complains about function pointer casts to void*.
|
||||
# Turn that off with -fpermissive.
|
||||
if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
|
||||
if(MINGW AND ${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
|
||||
target_compile_options(OSDependent PRIVATE -fpermissive)
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -1,74 +0,0 @@
|
|||
//
|
||||
// Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following
|
||||
// disclaimer in the documentation and/or other materials provided
|
||||
// with the distribution.
|
||||
//
|
||||
// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
|
||||
// contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
|
||||
#include "InitializeDll.h"
|
||||
|
||||
#define STRICT
|
||||
#define VC_EXTRALEAN 1
|
||||
#include <windows.h>
|
||||
#include <assert.h>
|
||||
|
||||
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||
{
|
||||
switch (fdwReason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
|
||||
if (! glslang::InitProcess())
|
||||
return FALSE;
|
||||
break;
|
||||
case DLL_THREAD_ATTACH:
|
||||
|
||||
if (! glslang::InitThread())
|
||||
return FALSE;
|
||||
break;
|
||||
|
||||
case DLL_THREAD_DETACH:
|
||||
|
||||
if (! glslang::DetachThread())
|
||||
return FALSE;
|
||||
break;
|
||||
|
||||
case DLL_PROCESS_DETACH:
|
||||
|
||||
glslang::DetachProcess();
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(0 && "DllMain(): Reason for calling DLL Main is unknown");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue