Skip to content

Commit

Permalink
the build works with Clang as well.
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen authored and perim committed Dec 15, 2017
1 parent 924135c commit 7b022c5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -40,7 +40,7 @@ endif()

INCLUDE (CheckIncludeFiles)
CHECK_INCLUDE_FILES(alloca.h HAVE_ALLOCA_H)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
CHECK_INCLUDE_FILES(inttypes.h HAVE_INTTYPES_H)
else()
SET(HAVE_INTTYPES_H OFF)
Expand Down
2 changes: 1 addition & 1 deletion lib/ivis_opengl/CMakeLists.txt
Expand Up @@ -45,7 +45,7 @@ find_package(OpenGL REQUIRED)
find_package(GLEW REQUIRED)
find_package(Freetype REQUIRED)

if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
find_package(PkgConfig)
pkg_check_modules(HARFBUZZ harfbuzz)
else()
Expand Down
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Expand Up @@ -10,7 +10,7 @@ if("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC")
COMMAND "powershell.exe"
ARGS "-File" "${CMAKE_SOURCE_DIR}/build_tools/autorevision.ps1" "${CMAKE_CURRENT_BINARY_DIR}/autorevision.h"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/autorevision.h"
COMMAND "${CMAKE_SOURCE_DIR}/build_tools/autorevision"
Expand All @@ -35,7 +35,7 @@ if(WIN32)
target_link_libraries(warzone2100 ws2_32 iphlpapi ${SDL2MAIN_LIBRARY})
endif()

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
target_link_libraries(warzone2100 ogg vorbis vorbisfile theora)
if (${CMAKE_CROSSCOMPILING})
set_target_properties(warzone2100 PROPERTIES LINK_FLAGS "-Wl,--start-group,-subsystem,windows")
Expand Down

0 comments on commit 7b022c5

Please sign in to comment.