fix mingw compilation error
This commit is contained in:
parent
e3a82e99c0
commit
86d675fa85
6
.gitignore
vendored
6
.gitignore
vendored
@ -2,6 +2,8 @@
|
|||||||
#ignore thumbnails created by windows
|
#ignore thumbnails created by windows
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
#Ignore files build by Visual Studio
|
#Ignore files build by Visual Studio
|
||||||
|
bii/build/*
|
||||||
|
bii/cmake/*
|
||||||
*.obj
|
*.obj
|
||||||
*.exe
|
*.exe
|
||||||
*.pdb
|
*.pdb
|
||||||
@ -27,4 +29,6 @@ obj/
|
|||||||
_ReSharper*/
|
_ReSharper*/
|
||||||
[Tt]est[Rr]esult*
|
[Tt]est[Rr]esult*
|
||||||
*.suo
|
*.suo
|
||||||
*.sdf
|
*.sdf
|
||||||
|
|
||||||
|
bii/.hive.db
|
151
CMakeLists.txt
151
CMakeLists.txt
@ -2,10 +2,22 @@
|
|||||||
# Author: Andrew Kornilov(https://github.com/ierofant)
|
# Author: Andrew Kornilov(https://github.com/ierofant)
|
||||||
# Contributor:
|
# Contributor:
|
||||||
# Robert Hauck - Enable support for PNG/Freetype
|
# Robert Hauck - Enable support for PNG/Freetype
|
||||||
|
# Qiangqiang Wu - Add biicode support
|
||||||
|
|
||||||
project(nana)
|
if(NOT BIICODE)
|
||||||
cmake_minimum_required(VERSION 2.8)
|
project(nana)
|
||||||
|
cmake_minimum_required(VERSION 2.8)
|
||||||
|
else()
|
||||||
|
set(LIB_SRC ${BII_LIB_SRC})
|
||||||
|
|
||||||
|
foreach(cpp ${BII_LIB_SRC})
|
||||||
|
if(${cpp} MATCHES "(include/nana|source)/detail/[A-Za-z0-9_]+/.+$")
|
||||||
|
list(APPEND trash_files ${cpp})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
list(REMOVE_ITEM BII_LIB_SRC ${trash_files})
|
||||||
|
endif()
|
||||||
|
|
||||||
#Select platform automatically
|
#Select platform automatically
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
@ -21,12 +33,21 @@ if(WIN32)
|
|||||||
add_definitions(-DSTD_THREAD_NOT_SUPPORTED)
|
add_definitions(-DSTD_THREAD_NOT_SUPPORTED)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(BIICODE)
|
||||||
|
file(GLOB_RECURSE platform_files "*/detail/win32/*")
|
||||||
|
list(APPEND BII_LIB_SRC ${platform_files})
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
add_definitions(-DNANA_LINUX)
|
add_definitions(-DNANA_LINUX)
|
||||||
add_definitions(-DNANA_X11)
|
add_definitions(-DNANA_X11)
|
||||||
add_definitions(-DPLATFORM_SPEC_HPP=<nana/detail/linux_X11/platform_spec.hpp>)
|
add_definitions(-DPLATFORM_SPEC_HPP=<nana/detail/linux_X11/platform_spec.hpp>)
|
||||||
add_definitions(-DSTD_CODECVT_NOT_SUPPORTED)
|
add_definitions(-DSTD_CODECVT_NOT_SUPPORTED)
|
||||||
|
if(BIICODE)
|
||||||
|
file(GLOB_RECURSE platform_files "*/detail/linux_X11/*")
|
||||||
|
list(APPEND BII_LIB_SRC ${platform_files})
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
@ -55,73 +76,77 @@ if(NANA_UNICODE)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
#Find PNG
|
if(NOT BIICODE)
|
||||||
if(UNIX)
|
#Find PNG
|
||||||
find_package(Freetype)
|
if(UNIX)
|
||||||
if (FREETYPE_FOUND)
|
find_package(Freetype)
|
||||||
include_directories( ${FREETYPE_INCLUDE_DIRS})
|
if (FREETYPE_FOUND)
|
||||||
endif()
|
include_directories( ${FREETYPE_INCLUDE_DIRS})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
option(NANA_ENABLE_PNG "Enable the use of PNG" ON)
|
||||||
|
if(NANA_ENABLE_PNG)
|
||||||
|
add_definitions(-DNANA_ENABLE_PNG)
|
||||||
|
|
||||||
|
option(NANA_LIBPNG "Use the included libpng" ON)
|
||||||
|
if(NANA_LIBPNG)
|
||||||
|
add_definitions(-DNANA_LIBPNG)
|
||||||
|
else()
|
||||||
|
find_package(PNG)
|
||||||
|
if (PNG_FOUND)
|
||||||
|
include_directories( ${PNG_INCLUDE_DIRS})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
add_definitions(-DNANA_LIBPNG)
|
||||||
|
add_definitions(-DNANA_ENABLE_PNG)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
option(NANA_ENABLE_PNG "Enable the use of PNG" ON)
|
|
||||||
if(NANA_ENABLE_PNG)
|
|
||||||
add_definitions(-DNANA_ENABLE_PNG)
|
|
||||||
|
|
||||||
option(NANA_LIBPNG "Use the included libpng" ON)
|
|
||||||
if(NANA_LIBPNG)
|
|
||||||
add_definitions(-DNANA_LIBPNG)
|
|
||||||
else()
|
|
||||||
find_package(PNG)
|
|
||||||
if (PNG_FOUND)
|
|
||||||
include_directories( ${PNG_INCLUDE_DIRS})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#Copy our new config.hpp (with removed defines)
|
#Copy our new config.hpp (with removed defines)
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/build/cmake/config.hpp ${CMAKE_SOURCE_DIR}/include/nana/)
|
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.hpp ${CMAKE_CURRENT_SOURCE_DIR}/include/nana/)
|
||||||
|
|
||||||
|
|
||||||
set(NANA_SOURCE_DIR ${CMAKE_SOURCE_DIR}/source)
|
|
||||||
set(NANA_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include)
|
|
||||||
|
|
||||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
|
||||||
endif(CMAKE_COMPILER_IS_GNUCXX)
|
endif(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
|
||||||
include_directories(${NANA_INCLUDE_DIR})
|
if(BIICODE)
|
||||||
aux_source_directory(${NANA_SOURCE_DIR} NANA_SOURCE)
|
add_biicode_targets()
|
||||||
aux_source_directory(${NANA_SOURCE_DIR}/detail NANA_DETAIL_SOURCE)
|
else()
|
||||||
aux_source_directory(${NANA_SOURCE_DIR}/filesystem NANA_FILESYSTEM_SOURCE)
|
set(NANA_SOURCE_DIR ${CMAKE_SOURCE_DIR}/source)
|
||||||
aux_source_directory(${NANA_SOURCE_DIR}/audio NANA_AUDIO_SOURCE)
|
set(NANA_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include)
|
||||||
aux_source_directory(${NANA_SOURCE_DIR}/audio/detail NANA_AUDIO_DETAIL_SOURCE)
|
|
||||||
aux_source_directory(${NANA_SOURCE_DIR}/gui NANA_GUI_SOURCE)
|
|
||||||
aux_source_directory(${NANA_SOURCE_DIR}/gui/detail NANA_GUI_DETAIL_SOURCE)
|
|
||||||
aux_source_directory(${NANA_SOURCE_DIR}/gui/widgets NANA_GUI_WIDGETS_SOURCE)
|
|
||||||
aux_source_directory(${NANA_SOURCE_DIR}/gui/widgets/skeletons NANA_GUI_WIDGETS_SKELETONS_SOURCE)
|
|
||||||
aux_source_directory(${NANA_SOURCE_DIR}/paint NANA_PAINT_SOURCE)
|
|
||||||
aux_source_directory(${NANA_SOURCE_DIR}/paint/detail NANA_PAINT_DETAIL_SOURCE)
|
|
||||||
aux_source_directory(${NANA_SOURCE_DIR}/system NANA_SYSTEM_SOURCE)
|
|
||||||
aux_source_directory(${NANA_SOURCE_DIR}/threads NANA_THREADS_SOURCE)
|
|
||||||
|
|
||||||
add_library(${PROJECT_NAME} ${NANA_SOURCE}
|
include_directories(${NANA_INCLUDE_DIR})
|
||||||
${NANA_DETAIL_SOURCE}
|
aux_source_directory(${NANA_SOURCE_DIR} NANA_SOURCE)
|
||||||
${NANA_FILESYSTEM_SOURCE}
|
aux_source_directory(${NANA_SOURCE_DIR}/detail NANA_DETAIL_SOURCE)
|
||||||
${NANA_AUDIO_SOURCE}
|
aux_source_directory(${NANA_SOURCE_DIR}/filesystem NANA_FILESYSTEM_SOURCE)
|
||||||
${NANA_AUDIO_DETAIL_SOURCE}
|
aux_source_directory(${NANA_SOURCE_DIR}/audio NANA_AUDIO_SOURCE)
|
||||||
${NANA_GUI_SOURCE}
|
aux_source_directory(${NANA_SOURCE_DIR}/audio/detail NANA_AUDIO_DETAIL_SOURCE)
|
||||||
${NANA_GUI_DETAIL_SOURCE}
|
aux_source_directory(${NANA_SOURCE_DIR}/gui NANA_GUI_SOURCE)
|
||||||
${NANA_GUI_WIDGETS_SOURCE}
|
aux_source_directory(${NANA_SOURCE_DIR}/gui/detail NANA_GUI_DETAIL_SOURCE)
|
||||||
${NANA_GUI_WIDGETS_SKELETONS_SOURCE}
|
aux_source_directory(${NANA_SOURCE_DIR}/gui/widgets NANA_GUI_WIDGETS_SOURCE)
|
||||||
${NANA_PAINT_SOURCE}
|
aux_source_directory(${NANA_SOURCE_DIR}/gui/widgets/skeletons NANA_GUI_WIDGETS_SKELETONS_SOURCE)
|
||||||
${NANA_PAINT_DETAIL_SOURCE}
|
aux_source_directory(${NANA_SOURCE_DIR}/paint NANA_PAINT_SOURCE)
|
||||||
${NANA_SYSTEM_SOURCE}
|
aux_source_directory(${NANA_SOURCE_DIR}/paint/detail NANA_PAINT_DETAIL_SOURCE)
|
||||||
${NANA_THREADS_SOURCE})
|
aux_source_directory(${NANA_SOURCE_DIR}/system NANA_SYSTEM_SOURCE)
|
||||||
|
aux_source_directory(${NANA_SOURCE_DIR}/threads NANA_THREADS_SOURCE)
|
||||||
|
|
||||||
|
add_library(${PROJECT_NAME} ${NANA_SOURCE}
|
||||||
install(TARGETS ${PROJECT_NAME}
|
${NANA_DETAIL_SOURCE}
|
||||||
ARCHIVE DESTINATION lib
|
${NANA_FILESYSTEM_SOURCE}
|
||||||
LIBRARY DESTINATION lib)
|
${NANA_AUDIO_SOURCE}
|
||||||
install(DIRECTORY ${NANA_INCLUDE_DIR}/nana DESTINATION include)
|
${NANA_AUDIO_DETAIL_SOURCE}
|
||||||
|
${NANA_GUI_SOURCE}
|
||||||
|
${NANA_GUI_DETAIL_SOURCE}
|
||||||
|
${NANA_GUI_WIDGETS_SOURCE}
|
||||||
|
${NANA_GUI_WIDGETS_SKELETONS_SOURCE}
|
||||||
|
${NANA_PAINT_SOURCE}
|
||||||
|
${NANA_PAINT_DETAIL_SOURCE}
|
||||||
|
${NANA_SYSTEM_SOURCE}
|
||||||
|
${NANA_THREADS_SOURCE})
|
||||||
|
install(TARGETS ${PROJECT_NAME}
|
||||||
|
ARCHIVE DESTINATION lib
|
||||||
|
LIBRARY DESTINATION lib)
|
||||||
|
install(DIRECTORY ${NANA_INCLUDE_DIR}/nana DESTINATION include)
|
||||||
|
endif()
|
@ -1,4 +1,5 @@
|
|||||||
# Nana C++ Library
|
# Nana C++ Library
|
||||||
|
[](https://www.biicode.com/qiangwu/nana)
|
||||||
|
|
||||||
Nana is a C++ library designed to allow developers to easily create cross-platform GUI applications with modern C++11 style, currently it can work on Linux(X11) and Windows. The nana repository contains the entire source of library, you can browse the source code and submit your pull request for contributing.
|
Nana is a C++ library designed to allow developers to easily create cross-platform GUI applications with modern C++11 style, currently it can work on Linux(X11) and Windows. The nana repository contains the entire source of library, you can browse the source code and submit your pull request for contributing.
|
||||||
|
|
||||||
|
12
bii/layout.bii
Normal file
12
bii/layout.bii
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# Minimal layout, with all auxiliary folders inside "bii" and
|
||||||
|
# The binary "bin" folder as is, and enabled code edition in the project root
|
||||||
|
cmake: bii/cmake
|
||||||
|
lib: bii/lib
|
||||||
|
build: bii/build
|
||||||
|
|
||||||
|
deps: bii/deps
|
||||||
|
# Setting this to True enables directly editing in the project root
|
||||||
|
# instead of blocks/youruser/yourblock
|
||||||
|
# the block will be named as your project folder
|
||||||
|
auto-root-block: True
|
||||||
|
root-block: qiangwu/nana
|
11
bii/policies.bii
Normal file
11
bii/policies.bii
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# This file configures your finds of dependencies.
|
||||||
|
#
|
||||||
|
# It is an ordered list of rules, which will be evaluated in order, of the form:
|
||||||
|
# block_pattern: TAG
|
||||||
|
#
|
||||||
|
# For each possible block that could resolve your dependencies,
|
||||||
|
# only versions with tag >= TAG will be accepted
|
||||||
|
|
||||||
|
qiangwu/* : DEV
|
||||||
|
* : STABLE
|
||||||
|
|
2
bii/settings.bii
Normal file
2
bii/settings.bii
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
cmake: {generator: MinGW Makefiles}
|
||||||
|
os: {arch: 32bit, family: Windows, subfamily: '7', version: 6.1.7601}
|
49
biicode.conf
Normal file
49
biicode.conf
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
# Biicode configuration file
|
||||||
|
|
||||||
|
[requirements]
|
||||||
|
# Blocks and versions this block depends on e.g.
|
||||||
|
# user/depblock1: 3
|
||||||
|
# user2/depblock2(track) @tag
|
||||||
|
|
||||||
|
[parent]
|
||||||
|
# The parent version of this block. Must match folder name. E.g.
|
||||||
|
# user/block # No version number means not published yet
|
||||||
|
# You can change it to publish to a different track, and change version, e.g.
|
||||||
|
# user/block(track): 7
|
||||||
|
qiangwu/nana: 0
|
||||||
|
|
||||||
|
[paths]
|
||||||
|
# Local directories to look for headers (within block)
|
||||||
|
# /
|
||||||
|
include
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
# Manual adjust file implicit dependencies, add (+), remove (-), or overwrite (=)
|
||||||
|
# hello.h + hello_imp.cpp hello_imp2.cpp
|
||||||
|
# *.h + *.cpp
|
||||||
|
include/nana/config.hpp + build/cmake/config.hpp
|
||||||
|
|
||||||
|
[mains]
|
||||||
|
# Manual adjust of files that define an executable
|
||||||
|
# !main.cpp # Do not build executable from this file
|
||||||
|
# main2.cpp # Build it (it doesnt have a main() function, but maybe it includes it)
|
||||||
|
|
||||||
|
[tests]
|
||||||
|
# Manual adjust of files that define a CTest test
|
||||||
|
# test/* pattern to evaluate this test/ folder sources like tests
|
||||||
|
|
||||||
|
[hooks]
|
||||||
|
# These are defined equal to [dependencies],files names matching bii*stage*hook.py
|
||||||
|
# will be launched as python scripts at stage = {post_process, clean}
|
||||||
|
# CMakeLists.txt + bii/my_post_process1_hook.py bii_clean_hook.py
|
||||||
|
|
||||||
|
[includes]
|
||||||
|
# Mapping of include patterns to external blocks
|
||||||
|
# hello*.h: user3/depblock # includes will be processed as user3/depblock/hello*.h
|
||||||
|
|
||||||
|
[data]
|
||||||
|
# Manually define data files dependencies, that will be copied to bin for execution
|
||||||
|
# By default they are copied to bin/user/block/... which should be taken into account
|
||||||
|
# when loading from disk such data
|
||||||
|
# image.cpp + image.jpg # code should write open("user/block/image.jpg")
|
||||||
|
|
@ -15,6 +15,8 @@
|
|||||||
#ifndef NANA_DEPLOY_HPP
|
#ifndef NANA_DEPLOY_HPP
|
||||||
#define NANA_DEPLOY_HPP
|
#define NANA_DEPLOY_HPP
|
||||||
|
|
||||||
|
#include <stdexcept>
|
||||||
|
|
||||||
#include <nana/config.hpp>
|
#include <nana/config.hpp>
|
||||||
#include <nana/charset.hpp>
|
#include <nana/charset.hpp>
|
||||||
#if defined(NANA_LINUX)
|
#if defined(NANA_LINUX)
|
||||||
@ -22,7 +24,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Implement workarounds for MinGW
|
//Implement workarounds for MinGW
|
||||||
#if defined(NANA_MINGW)
|
#if defined(NANA_MINGW) && __GNUC_MINOR__ < 8
|
||||||
namespace std
|
namespace std
|
||||||
{
|
{
|
||||||
//Workaround for no implemenation of std::stoi in MinGW.
|
//Workaround for no implemenation of std::stoi in MinGW.
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define NANA_STD_THREAD_HPP
|
#define NANA_STD_THREAD_HPP
|
||||||
#include <nana/config.hpp>
|
#include <nana/config.hpp>
|
||||||
|
|
||||||
#if defined(NANA_MINGW)
|
#if defined(STD_THREAD_NOT_SUPPORTED)
|
||||||
#include <boost/thread.hpp>
|
#include <boost/thread.hpp>
|
||||||
namespace std
|
namespace std
|
||||||
{
|
{
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include PLATFORM_SPEC_HPP
|
#include PLATFORM_SPEC_HPP
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(NANA_MINGW)
|
#if defined(NANA_MINGW) && __GNUC_MINOR__ < 8
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
namespace std
|
namespace std
|
||||||
{
|
{
|
||||||
|
@ -19,5 +19,4 @@
|
|||||||
#include "win32/platform_spec.cpp"
|
#include "win32/platform_spec.cpp"
|
||||||
#elif defined(NANA_LINUX)
|
#elif defined(NANA_LINUX)
|
||||||
#include "linux_X11/platform_spec.cpp"
|
#include "linux_X11/platform_spec.cpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user