From c01afe4c87b683e7e7006b137bbe95cfd925a1cc Mon Sep 17 00:00:00 2001 From: TimePath Date: Sun, 28 Feb 2016 12:30:46 +1100 Subject: [PATCH] OSX: fix compile --- .travis.yml | 2 +- README.md | 8 ++++++++ contrib/bobtoolz/dialogs/dialogs-gtk.cpp | 3 +++ radiant/CMakeLists.txt | 4 ++++ radiant/mainframe.cpp | 10 +--------- tools/CMakeLists.txt | 2 +- 6 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index d1f0e1db..17246d55 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,4 +30,4 @@ before_script: script: - mkdir build && cd build - cmake .. - - cmake --build . --target radiant -- -j4 + - cmake --build . -- -j4 diff --git a/README.md b/README.md index ff836cc3..6c7df180 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,14 @@ cmake -G "MSYS Makefiles" .. -DGTK2_GLIBCONFIG_INCLUDE_DIR=/mingw64/lib/glib-2.0 cmake --build . -- -j$(nproc) ``` +## OS X: + +``` +brew install gtkglext +brew install Caskroom/cask/xquartz +brew link --force gettext +``` + More Compilation Details ------------------------ diff --git a/contrib/bobtoolz/dialogs/dialogs-gtk.cpp b/contrib/bobtoolz/dialogs/dialogs-gtk.cpp index 1b2ba6c8..10bc22d8 100644 --- a/contrib/bobtoolz/dialogs/dialogs-gtk.cpp +++ b/contrib/bobtoolz/dialogs/dialogs-gtk.cpp @@ -18,6 +18,9 @@ */ #include "dialogs-gtk.h" + +#include + #include "../funchandlers.h" #include "str.h" diff --git a/radiant/CMakeLists.txt b/radiant/CMakeLists.txt index 8b704e7b..ab40b2a0 100644 --- a/radiant/CMakeLists.txt +++ b/radiant/CMakeLists.txt @@ -5,6 +5,10 @@ find_package(OpenGL REQUIRED) include_directories("${CMAKE_SOURCE_DIR}/libs") include_directories("${CMAKE_SOURCE_DIR}/include") +string(SUBSTRING ${CMAKE_SHARED_MODULE_SUFFIX} 1 -1 _clibext) +add_definitions(-DCMAKE_SHARED_MODULE_SUFFIX="${_clibext}") +unset(_clibext) + set(RADIANTLIST autosave.cpp autosave.h diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index a8e1e22a..f6b3e125 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -514,15 +514,7 @@ void operator()( const char* name ) const { } }; -const char* const c_library_extension = -#if defined( WIN32 ) - "dll" -#elif defined ( __APPLE__ ) - "dylib" -#elif defined( __linux__ ) || defined ( __FreeBSD__ ) - "so" -#endif -; +const char* const c_library_extension = CMAKE_SHARED_MODULE_SUFFIX; void Radiant_loadModules( const char* path ){ Directory_forEach( path, MatchFileExtension( c_library_extension, CLoadModule( path ) ) ); diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index e16c7ac6..a3fee086 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -6,7 +6,7 @@ macro(radiant_tool name) add_executable(${name} ${ARGN}) if(NOT (CMAKE_EXECUTABLE_SUFFIX STREQUAL RADIANT_EXECUTABLE)) add_custom_command(TARGET ${name} POST_BUILD - COMMAND ln -f -s -T "$" "${CMAKE_BINARY_DIR}/${name}.${RADIANT_EXECUTABLE}" + COMMAND ln -f -s "$" "${CMAKE_BINARY_DIR}/${name}.${RADIANT_EXECUTABLE}" VERBATIM ) endif() -- 2.39.2