Linux compilation with gcc

This commit is contained in:
Christophe Meneboeuf 2021-02-15 00:29:11 +01:00
parent 98687b40c5
commit e8fe9565b8
3 changed files with 9 additions and 2 deletions

View File

@ -31,6 +31,7 @@ else()
find_package(ImageMagick 6.9 EXACT REQUIRED COMPONENTS Magick++ ) find_package(ImageMagick 6.9 EXACT REQUIRED COMPONENTS Magick++ )
endif(WIN32) endif(WIN32)
find_package(SDL2 REQUIRED) find_package(SDL2 REQUIRED)
find_package(Threads REQUIRED)
# directories # directories
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/bin/debug) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/bin/debug)
@ -55,9 +56,12 @@ target_include_directories(${PROJECT_NAME} PRIVATE ${ImageMagick_INCLUDE_DIRS} $
# Application Picture # Application Picture
add_executable(Picture src/App_Picture.cpp) add_executable(Picture src/App_Picture.cpp)
if(NOT WIN32)
set_target_properties(Picture PROPERTIES COMPILE_FLAGS -pthread LINK_FLAGS -pthread)
endif()
target_compile_definitions(Picture PUBLIC MAGICKCORE_QUANTUM_DEPTH=16 MAGICKCORE_HDRI_ENABLE=0) target_compile_definitions(Picture PUBLIC MAGICKCORE_QUANTUM_DEPTH=16 MAGICKCORE_HDRI_ENABLE=0)
target_include_directories(Picture PRIVATE src ${ImageMagick_INCLUDE_DIRS}) target_include_directories(Picture PRIVATE src ${ImageMagick_INCLUDE_DIRS})
target_link_libraries(Picture ${ImageMagick_LIBRARIES} ${SDL2_LIBRARIES} ${PROJECT_NAME}) target_link_libraries(Picture ${ImageMagick_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${PROJECT_NAME} ${SDL2_LIBRARIES}) # SDL2 must be at the end
set_property(TARGET Picture PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG}) set_property(TARGET Picture PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG})
# Application Tile # Application Tile

View File

@ -2,6 +2,8 @@
#include <stdexcept> #include <stdexcept>
#include <iostream> #include <iostream>
#include <chrono> #include <chrono>
#define SDL_MAIN_HANDLED
#include <SDL.h> #include <SDL.h>
#include "Picture.h" #include "Picture.h"
@ -175,7 +177,7 @@ namespace RgbToHires
//=========================================================================== //===========================================================================
// RGB videocards HGR // RGB videocards HGR
//! @details Adapted from AppleWin: https://github.com/AppleWin/AppleWin //! @details Adapted from AppleWin: https://github.com/AppleWin/AppleWin
//! A 14-dot block is used to draw a 7-pixel block (2 * 3.5-pixel blocks) //! A 14-dot block is used to draw a 7-pixel block (2 * 3.5-pixel blocks)

View File

@ -19,6 +19,7 @@
#define _DISPLAY_H_ #define _DISPLAY_H_
#include <thread> #include <thread>
#include <atomic>
#include "ImageQuantized.h" #include "ImageQuantized.h"
#include "HiRes.h" #include "HiRes.h"