cmake: Remove "conditions" from endif

See https://cmake.org/cmake/help/latest/command/endif.html and
https://cmake.org/cmake/help/latest/command/if.html.

If the else/endif condition does not match the if condition verbatim,
an error is produced on some versions of cmake. This change removes
these "legacy conditions."
This commit is contained in:
Nathaniel Cesario 2021-09-28 17:01:21 -06:00
parent 581897f462
commit c8ef4f8a9f
9 changed files with 34 additions and 34 deletions

View file

@ -35,14 +35,14 @@ if(WIN32)
add_subdirectory(OSDependent/Windows)
elseif(UNIX OR "${CMAKE_SYSTEM_NAME}" STREQUAL "Fuchsia")
add_subdirectory(OSDependent/Unix)
else(WIN32)
else()
message("unknown platform")
endif(WIN32)
endif()
if(EMSCRIPTEN OR ENABLE_GLSLANG_JS)
# May be enabled on non-Emscripten builds for binary-size testing.
add_subdirectory(OSDependent/Web)
endif(EMSCRIPTEN OR ENABLE_GLSLANG_JS)
endif()
################################################################################
# GenericCodeGen
@ -129,7 +129,7 @@ if(ENABLE_HLSL)
HLSL/hlslTokenStream.h
HLSL/hlslGrammar.h
HLSL/hlslParseables.h)
endif(ENABLE_HLSL)
endif()
add_library(MachineIndependent STATIC ${MACHINEINDEPENDENT_SOURCES} ${MACHINEINDEPENDENT_HEADERS})
set_property(TARGET MachineIndependent PROPERTY POSITION_INDEPENDENT_CODE ON)
@ -194,7 +194,7 @@ if(WIN32)
source_group("MachineIndependent\\Preprocessor" REGULAR_EXPRESSION "MachineIndependent/preprocessor/*")
source_group("HLSL" REGULAR_EXPRESSION "HLSL/*")
source_group("CInterface" REGULAR_EXPRESSION "CInterface/*")
endif(WIN32)
endif()
################################################################################
# install
@ -225,4 +225,4 @@ if(ENABLE_GLSLANG_INSTALL)
install(FILES ${GLSLANG_BUILD_INFO_H} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/glslang)
endif(ENABLE_GLSLANG_INSTALL)
endif()

View file

@ -56,4 +56,4 @@ if(ENABLE_GLSLANG_INSTALL)
install(TARGETS OSDependent EXPORT OSDependentTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(EXPORT OSDependentTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
endif(ENABLE_GLSLANG_INSTALL)
endif()

View file

@ -55,7 +55,7 @@ if(ENABLE_GLSLANG_JS)
if(ENABLE_EMSCRIPTEN_SINGLE_FILE)
target_link_libraries(glslang.js "-s SINGLE_FILE=1")
endif(ENABLE_EMSCRIPTEN_SINGLE_FILE)
endif()
if(ENABLE_EMSCRIPTEN_ENVIRONMENT_NODE)
target_link_libraries(glslang.js "-s ENVIRONMENT=node -s BINARYEN_ASYNC_COMPILATION=0")
@ -67,5 +67,5 @@ if(ENABLE_GLSLANG_JS)
add_custom_command(TARGET glslang.js POST_BUILD
COMMAND cat ${CMAKE_CURRENT_SOURCE_DIR}/glslang.after.js >> ${CMAKE_CURRENT_BINARY_DIR}/glslang.js)
endif()
endif(EMSCRIPTEN)
endif(ENABLE_GLSLANG_JS)
endif()
endif()

View file

@ -45,10 +45,10 @@ endif()
if(WIN32)
source_group("Source" FILES ${SOURCES})
endif(WIN32)
endif()
if(ENABLE_GLSLANG_INSTALL)
install(TARGETS OSDependent EXPORT OSDependentTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(EXPORT OSDependentTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
endif(ENABLE_GLSLANG_INSTALL)
endif()