mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-30 22:21:12 +00:00
Add compiler flags for C++11 so we can start using it
This commit is contained in:
parent
877fe94746
commit
f62356d410
@ -3,16 +3,20 @@
|
||||
|
||||
add_definitions(-DHAVE_CONFIG_H)
|
||||
|
||||
######################################################################
|
||||
# Compiler-specific flags
|
||||
|
||||
if(MSVC)
|
||||
# Do not link with libcmt.lib (to avoid duplicated symbols with msvcrtd.lib)
|
||||
if(CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:LIBCMT")
|
||||
endif()
|
||||
|
||||
# Add support for Windows XP
|
||||
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
# 64 bits
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MACHINE:X64")
|
||||
else()
|
||||
# Add support for Windows XP with 5.01 subsystem
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MACHINE:X86 /SUBSYSTEM:WINDOWS,5.01")
|
||||
endif()
|
||||
endif(MSVC)
|
||||
@ -166,6 +170,13 @@ else()
|
||||
set(libs3rdparty ${libs3rdparty} allegro)
|
||||
endif()
|
||||
|
||||
######################################################################
|
||||
# Add C++11 support only for our code (avoid Allegro)
|
||||
|
||||
if(UNIX)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=gnu++11")
|
||||
endif()
|
||||
|
||||
######################################################################
|
||||
# Aseprite Libraries (in preferred order to be built)
|
||||
|
||||
|
@ -215,22 +215,19 @@ int App::run()
|
||||
{
|
||||
UIContext* context = UIContext::instance();
|
||||
Console console;
|
||||
for (FileList::iterator
|
||||
it = m_files.begin(),
|
||||
end = m_files.end();
|
||||
it != end; ++it) {
|
||||
for (const std::string& filename : m_files) {
|
||||
// Load the sprite
|
||||
Document* document = load_document(context, it->c_str());
|
||||
Document* document = load_document(context, filename.c_str());
|
||||
if (!document) {
|
||||
if (!isGui())
|
||||
console.printf("Error loading file \"%s\"\n", it->c_str());
|
||||
console.printf("Error loading file \"%s\"\n", filename.c_str());
|
||||
}
|
||||
else {
|
||||
// Add the given file in the argument as a "recent file" only
|
||||
// if we are running in GUI mode. If the program is executed
|
||||
// in batch mode this is not desirable.
|
||||
if (isGui())
|
||||
getRecentFiles()->addRecentFile(it->c_str());
|
||||
getRecentFiles()->addRecentFile(filename.c_str());
|
||||
|
||||
// Add the document to the exporter.
|
||||
if (m_exporter != NULL)
|
||||
|
Loading…
x
Reference in New Issue
Block a user