mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
cmake limiting the scope of concern to C only and detecting
the compiler from to one particular frontend since it can happen to have differents for C and C++.
This commit is contained in:
parent
7464cb7ae5
commit
ea1d491ff3
1 changed files with 5 additions and 5 deletions
|
@ -9,7 +9,7 @@ if(NOT CMAKE_BUILD_TYPE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# CMake project configuration.
|
# CMake project configuration.
|
||||||
project(yquake2)
|
project(yquake2 C)
|
||||||
|
|
||||||
# Cmake module search path.
|
# Cmake module search path.
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/stuff/cmake/modules ${CMAKE_MODULE_PATH})
|
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/stuff/cmake/modules ${CMAKE_MODULE_PATH})
|
||||||
|
@ -36,10 +36,10 @@ list(APPEND CMAKE_PREFIX_PATH /usr/local)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall -fno-strict-aliasing -fwrapv -fvisibility=hidden")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall -fno-strict-aliasing -fwrapv -fvisibility=hidden")
|
||||||
|
|
||||||
# Switch of some annoying warnings
|
# Switch of some annoying warnings
|
||||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
if (${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-missing-braces")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-missing-braces")
|
||||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
elseif (${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
|
||||||
if (CMAKE_CXX_COMPILER_VERSION GREATER 7.99)
|
if (CMAKE_C_COMPILER_VERSION GREATER 7.99)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-format-truncation -Wno-format-overflow")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-format-truncation -Wno-format-overflow")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
@ -184,7 +184,7 @@ link_directories(${yquake2LinkerDirectories})
|
||||||
# This helps the old and crappy x87 FPU to produce correct values.
|
# This helps the old and crappy x87 FPU to produce correct values.
|
||||||
# Would be nice if Clang had something comparable.
|
# Would be nice if Clang had something comparable.
|
||||||
if ("${ARCH}" STREQUAL "i386")
|
if ("${ARCH}" STREQUAL "i386")
|
||||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffloat-store")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffloat-store")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
Loading…
Reference in a new issue