Skip to content

Commit df008bc

Browse files
committed
Add header paths for system libraries as SYSTEM
This ensures correct include ordering and hides warnings coming from unrelated code. Specifically, it fixes build on FreeBSD, which otherwise fails due to to problem in lcms code: In file included from .../stratagus-3.3.1/src/action/action_defend.cpp:45: In file included from .../stratagus/work/stratagus-3.3.1/src/include/ui.h:56: In file included from .../stratagus-3.3.1/src/include/viewport.h:34: In file included from .../stratagus-3.3.1/src/include/fow.h:39: In file included from .../stratagus-3.3.1/src/include/video.h:228: In file included from /usr/local/include/libmng.h:385: In file included from /usr/local/include/libmng_types.h:181: /usr/local/include/lcms.h:1238:29: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister] typedef int (* _cmsSAMPLER)(register WORD In[], ^~~~~~~~~
1 parent 44ddc09 commit df008bc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ endif()
816816
# Stratagus definitions
817817

818818
add_definitions(-DUSE_ZLIB -DPIXMAPS=\"${PIXMAPSDIRABS}\")
819-
include_directories(${LUA_INCLUDE_DIR} ${SDL2_INCLUDE_DIR} ${SDL2_MIXER_INCLUDE_DIRS} ${SDL2_IMAGE_INCLUDE_DIRS} ${TOLUA++_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ${PNG_INCLUDE_DIR})
819+
include_directories(SYSTEM ${LUA_INCLUDE_DIR} ${SDL2_INCLUDE_DIR} ${SDL2_MIXER_INCLUDE_DIRS} ${SDL2_IMAGE_INCLUDE_DIRS} ${TOLUA++_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ${PNG_INCLUDE_DIR})
820820
set(stratagus_LIBS ${stratagus_LIBS} ${LUA_LIBRARIES} ${SDL2_LIBRARY} ${SDL2_MIXER_LIBRARIES} ${SDL2_IMAGE_LIBRARIES} ${TOLUA++_LIBRARY} ${ZLIB_LIBRARIES} ${PNG_LIBRARY})
821821

822822
if(WIN32 AND NOT ENABLE_STDIO_REDIRECT)
@@ -825,26 +825,26 @@ endif()
825825

826826
if(WITH_BZIP2 AND BZIP2_FOUND)
827827
add_definitions(-DUSE_BZ2LIB ${BZIP2_DEFINITIONS})
828-
include_directories(${BZIP2_INCLUDE_DIR})
828+
include_directories(SYSTEM ${BZIP2_INCLUDE_DIR})
829829
set(stratagus_LIBS ${stratagus_LIBS} ${BZIP2_LIBRARIES})
830830
endif()
831831

832832
if(WITH_MNG AND MNG_FOUND)
833833
add_definitions(-DUSE_MNG)
834-
include_directories(${MNG_INCLUDE_DIR})
834+
include_directories(SYSTEM ${MNG_INCLUDE_DIR})
835835
add_definitions(${MNG_DEFINITIONS})
836836
set(stratagus_LIBS ${stratagus_LIBS} ${MNG_LIBRARY})
837837
endif()
838838

839839
if(WITH_OGGVORBIS AND OGGVORBIS_FOUND)
840840
add_definitions(-DUSE_VORBIS)
841-
include_directories(${OGGVORBIS_INCLUDE_DIR})
841+
include_directories(SYSTEM ${OGGVORBIS_INCLUDE_DIR})
842842
set(stratagus_LIBS ${stratagus_LIBS} ${OGG_LIBRARY} ${VORBIS_LIBRARY})
843843
endif()
844844

845845
if(WITH_THEORA AND THEORA_FOUND)
846846
add_definitions(-DUSE_THEORA)
847-
include_directories(${THEORA_INCLUDE_DIR})
847+
include_directories(SYSTEM ${THEORA_INCLUDE_DIR})
848848
set(stratagus_LIBS ${stratagus_LIBS} ${THEORA_LIBRARY})
849849
endif()
850850

0 commit comments

Comments
 (0)