Skip to content

Commit

Permalink
Remove pushing / popping -fPIC for glslang
Browse files Browse the repository at this point in the history
All glslang targets are now have the `POSITION_INDEPENDENT_CODE` property.

This reverts "Glslang third party build needs -fPIC (google#1093)"
  • Loading branch information
ben-clayton committed Jul 7, 2020
1 parent 6cee9e5 commit 3d96a7f
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions third_party/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,7 @@ endif()

if (NOT TARGET glslang)
if (IS_DIRECTORY ${SHADERC_GLSLANG_DIR})
# Add -fPIC to glslang build, if supported
if (COMPILER_SUPPORTS_PIC)
set(CXX_BACK ${CMAKE_CXX_FLAGS})
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-fPIC")
# cmake inserts a semicolon, change it to a space.
string(REGEX REPLACE ";" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
add_subdirectory(${SHADERC_GLSLANG_DIR} glslang)
set(CMAKE_CXX_FLAGS ${CXX_BACK})
else()
add_subdirectory(${SHADERC_GLSLANG_DIR} glslang)
endif()
add_subdirectory(${SHADERC_GLSLANG_DIR} glslang)
endif()
if (NOT TARGET glslang)
message(FATAL_ERROR "glslang was not found - required for compilation")
Expand Down

0 comments on commit 3d96a7f

Please sign in to comment.