mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-25 05:31:00 +00:00
1a3ac9d0b3
Introduce the variable 'ZD_CMAKE_COMPILER_IS_GNUC(XX)_COMPATIBLE' and replace any occurrence of '"${CMAKE_C(XX)_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_C(XX)_COMPILER_ID}" STREQUAL "Clang"' with it. This makes it possible to add more GCC compatible compilers in just one place.
32 lines
1.4 KiB
CMake
32 lines
1.4 KiB
CMake
cmake_minimum_required( VERSION 2.4 )
|
|
|
|
if( WIN32 )
|
|
if( ZD_CMAKE_COMPILER_IS_GNUC_COMPATIBLE OR ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE )
|
|
add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/trustinfo.o
|
|
COMMAND windres -o ${CMAKE_CURRENT_BINARY_DIR}/trustinfo.o -i ${CMAKE_CURRENT_SOURCE_DIR}/trustinfo.rc
|
|
DEPENDS trustinfo.rc )
|
|
set( TRUSTINFO trustinfo.o )
|
|
else( ZD_CMAKE_COMPILER_IS_GNUC_COMPATIBLE OR ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE )
|
|
if( MSVC_VERSION GREATER 1399 )
|
|
# VC 8+ adds a manifest automatically to the executable. We need to
|
|
# merge ours with it.
|
|
set( MT_MERGE ON )
|
|
else( MSVC_VERSION GREATER 1399 )
|
|
set( TRUSTINFO trustinfo.rc )
|
|
endif( MSVC_VERSION GREATER 1399 )
|
|
endif( ZD_CMAKE_COMPILER_IS_GNUC_COMPATIBLE OR ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE )
|
|
else( WIN32 )
|
|
set( TRUSTINFO "" )
|
|
endif( WIN32 )
|
|
|
|
if( NOT CMAKE_CROSSCOMPILING )
|
|
add_executable( updaterevision updaterevision.c ${TRUSTINFO} )
|
|
set( CROSS_EXPORTS ${CROSS_EXPORTS} updaterevision PARENT_SCOPE )
|
|
endif( NOT CMAKE_CROSSCOMPILING )
|
|
|
|
if( MT_MERGE )
|
|
get_target_property( UPDATEREVISION_EXE updaterevision LOCATION )
|
|
add_custom_command(TARGET updaterevision POST_BUILD
|
|
COMMAND mt -inputresource:${UPDATEREVISION_EXE} -manifest ${CMAKE_CURRENT_SOURCE_DIR}/trustinfo.txt -outputresource:${UPDATEREVISION_EXE} -nologo
|
|
COMMENT "Embedding trustinfo into updaterevision" )
|
|
endif( MT_MERGE )
|