From: TimePath Date: Sun, 16 Jul 2017 10:00:19 +0000 (+1000) Subject: Fix the build on my system X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f2f726281efd2c18e56402de58cddba77d393524;p=xonotic%2Fnetradiant.git Fix the build on my system --- diff --git a/CMakeLists.txt b/CMakeLists.txt index dda42c76..78efba94 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,6 +63,7 @@ endif () set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing -fno-exceptions -fno-rtti") set(CMAKE_POSITION_INDEPENDENT_CODE 1) +set(GTK_NS "GTK2" CACHE STRING "GTK variable prefix") #----------------------------------------------------------------------- # Defs diff --git a/libs/gtkutil/CMakeLists.txt b/libs/gtkutil/CMakeLists.txt index fea03d80..bc5d772c 100644 --- a/libs/gtkutil/CMakeLists.txt +++ b/libs/gtkutil/CMakeLists.txt @@ -27,8 +27,8 @@ add_library(gtkutil target_include_directories(gtkutil PRIVATE uilib) target_link_libraries(gtkutil PRIVATE uilib) -target_include_directories(gtkutil PRIVATE ${GTK2_PANGO_INCLUDE_DIR}) -target_link_libraries(gtkutil PRIVATE ${GTK2_PANGO_LIBRARY}) +target_include_directories(gtkutil PRIVATE ${${GTK_NS}_INCLUDE_DIRS}) +target_link_libraries(gtkutil PRIVATE ${${GTK_NS}_LIBRARIES}) find_package(GtkGLExt REQUIRED) target_include_directories(gtkutil PRIVATE ${GTKGL_INCLUDE_DIRS}) diff --git a/libs/l_net/l_net.c b/libs/l_net/l_net.c index caf6c422..7f50d054 100644 --- a/libs/l_net/l_net.c +++ b/libs/l_net/l_net.c @@ -51,7 +51,7 @@ void WinPrint( const char *str, ... ){ vsprintf( text, str, argptr ); va_end( argptr ); - printf( text ); + printf( "%s", text ); } #else void WinPrint( const char *str, ... ){ diff --git a/libs/uilib/CMakeLists.txt b/libs/uilib/CMakeLists.txt index c664d9c0..f10ee3ad 100644 --- a/libs/uilib/CMakeLists.txt +++ b/libs/uilib/CMakeLists.txt @@ -3,8 +3,8 @@ add_library(uilib ) find_package(GTK2 REQUIRED) -target_include_directories(uilib PUBLIC ${GTK2_INCLUDE_DIRS}) -target_link_libraries(uilib PUBLIC ${GTK2_LIBRARIES}) +target_include_directories(uilib PUBLIC ${${GTK_NS}_INCLUDE_DIRS}) +target_link_libraries(uilib PUBLIC ${${GTK_NS}_LIBRARIES}) target_include_directories(uilib PUBLIC gtkutil) target_link_libraries(uilib PUBLIC gtkutil) diff --git a/radiant/CMakeLists.txt b/radiant/CMakeLists.txt index a882ffe2..958384cc 100644 --- a/radiant/CMakeLists.txt +++ b/radiant/CMakeLists.txt @@ -99,6 +99,7 @@ target_link_libraries(radiant ${CMAKE_DL_LIBS} ${LIBXML2_LIBRARIES} ${OPENGL_gl_LIBRARY} + ${${GTK_NS}_LIBRARIES} ${GTKGL_LIBRARIES} includes cmdlib diff --git a/radiant/main.cpp b/radiant/main.cpp index c669aba4..196297ed 100644 --- a/radiant/main.cpp +++ b/radiant/main.cpp @@ -208,11 +208,9 @@ void error_redirect( const gchar *domain, GLogLevelFlags log_level, const gchar // spam it... globalErrorStream() << buf << "\n"; - // FIXME why are warnings is_fatal? -#ifndef _DEBUG - if ( is_fatal ) -#endif - ERROR_MESSAGE( "GTK+ error: " << buf ); + if (is_fatal) { + ERROR_MESSAGE( "GTK+ error: " << buf ); + } } #if defined ( _DEBUG ) && defined ( WIN32 ) && defined ( _MSC_VER )