Skip to content

Commit

Permalink
Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
karwler committed Oct 23, 2021
1 parent 07c7042 commit c136daa
Show file tree
Hide file tree
Showing 34 changed files with 7,695 additions and 7,672 deletions.
57 changes: 32 additions & 25 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ project(VertiRead LANGUAGES CXX)
if(CMAKE_CONFIGURATION_TYPES)
set(CMAKE_CONFIGURATION_TYPES "Debug" "Release")
endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

# source files
set(SRC_FILES
Expand Down Expand Up @@ -50,7 +53,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(LIB_DIR "${CMAKE_SOURCE_DIR}/lib/msvc32")
endif()
endif()

link_directories(${LIB_DIR})
set(DLL_FILES
"archive.dll"
Expand All @@ -62,7 +65,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
"SDL2.dll"
"SDL2_image.dll"
"SDL2_ttf.dll"
"zlib1.dll")
"zlib1.dll")
endif()

# definitions
Expand All @@ -81,7 +84,6 @@ endif()

# set main target
add_executable(${PROJECT_NAME} ${SRC_FILES})
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17)

# include directories and link libraries
include_directories("${CMAKE_SOURCE_DIR}/src")
Expand All @@ -103,19 +105,27 @@ set_target_properties(${PROJECT_NAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${EXECUTABLE_OUTPUT_PATH})

if((${CMAKE_CXX_COMPILER_ID} MATCHES "GNU") OR (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang"))
if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -no-pie")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-covered-switch-default -Wno-exit-time-destructors -Wno-global-constructors")
endif()

if(${CMAKE_BUILD_TYPE} MATCHES "Debug")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
set(CXX_FLG_ANY "-Wall -Wextra -pedantic-errors -Wdouble-promotion -Wformat=2 -Wmissing-declarations -Wold-style-cast -Woverlength-strings -Wunreachable-code -Wno-implicit-fallthrough -Wno-parentheses -Wno-switch")
set(FLG_DEBUG "-g")
set(FLG_RELEASE "-O3")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(FLG_RELEASE "${FLG_RELEASE} -s")
set(CXX_FLG_ANY "${CXX_FLG_ANY} -Wcast-align=strict -Wduplicated-branches -Wduplicated-cond -Wlogical-op -Wuseless-cast")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -s -Wno-padded")
set(CXX_FLG_ANY "${CXX_FLG_ANY} -Wcast-align -Wnull-dereference")
endif()
elseif(MSVC)
set(FLG_DEBUG "/Od /Ob0")
set(FLG_RELEASE "/O2 /Ob2 /Oi /Ot /GL")
endif()

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-float-equal -Wno-parentheses -Wno-shadow -Wno-switch -Wno-switch-enum -Wno-unused-result")
if(CMAKE_CONFIGURATION_TYPES)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${CXX_FLG_ANY} ${FLG_DEBUG}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CXX_FLG_ANY} ${FLG_RELEASE}")
elseif(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_FLG_ANY} ${FLG_DEBUG}")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_FLG_ANY} ${FLG_RELEASE}")
endif()

if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
Expand Down Expand Up @@ -143,18 +153,15 @@ add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/rsc/icon.ico" ${EXECUTABLE_OUTPUT_PATH}
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_SOURCE_DIR}/rsc/data" ${EXECUTABLE_OUTPUT_PATH})

# filter file for ms visual studio
foreach(source IN LISTS SRC_FILES)
get_filename_component(source_dir ${source} PATH)
string(REPLACE "/" ";" dirs "${source_dir}")
list(GET dirs 0 dir0)

if(${dir0} MATCHES "rsc")
set(filter_path "Source")
# group files
foreach(FSRC IN LISTS SRC_FILES)
get_filename_component(FGRP "${FSRC}" DIRECTORY)
string(REPLACE "/" ";" FGRP "${FGRP}")
list(REMOVE_AT FGRP 0)
if(MSVC)
string(REPLACE ";" "\\" FGRP "${FGRP}")
else()
list(REMOVE_AT dirs 0)
list(INSERT dirs 0 "Source")
string(REPLACE ";" "\\" filter_path "${dirs}")
string(REPLACE ";" "/" FGRP "${FGRP}")
endif()
source_group("${filter_path}" FILES ${source})
source_group("${FGRP}" FILES "${FSRC}")
endforeach()
138 changes: 69 additions & 69 deletions lib/Copying.BrisaSans.txt

Large diffs are not rendered by default.

70 changes: 35 additions & 35 deletions rsc/data/themes.ini
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
[Gray]
background=10 10 10 255
normal=90 90 90 255
dark=60 60 60 255
light=120 120 120 255
select=105 105 105 255
text=210 210 210 255
texture=210 210 210 255

[Brown]
background=17 8 2 255
normal=102 91 79 255
dark=69 62 53 255
light=127 114 98 255
select=119 106 91 255
text=220 220 220 255
texture=220 220 220 255

[White]
background=250 250 250 255
normal=210 210 210 255
dark=180 180 180 255
light=230 230 230 255
select=220 220 220 255
text=60 60 60 255
texture=60 60 60 255

[Gay]
background=176 48 96 255
normal=255 105 180 255
dark=255 20 147 255
light=255 182 193 255
select=238 130 238 255
text=255 255 255 255
texture=255 255 255 255
[Gray]
background=10 10 10 255
normal=90 90 90 255
dark=60 60 60 255
light=120 120 120 255
select=105 105 105 255
text=210 210 210 255
texture=210 210 210 255

[Brown]
background=17 8 2 255
normal=102 91 79 255
dark=69 62 53 255
light=127 114 98 255
select=119 106 91 255
text=220 220 220 255
texture=220 220 220 255

[White]
background=250 250 250 255
normal=210 210 210 255
dark=180 180 180 255
light=230 230 230 255
select=220 220 220 255
text=60 60 60 255
texture=60 60 60 255

[Gay]
background=176 48 96 255
normal=255 105 180 255
dark=255 20 147 255
light=255 182 193 255
select=238 130 238 255
text=255 255 255 255
texture=255 255 255 255
56 changes: 28 additions & 28 deletions rsc/resource.rc
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
#include <windows.h>
MAINICON ICON "icon.ico"
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILETYPE 0x1L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904e4"
BEGIN
VALUE "FileDescription", "Manga Reader"
VALUE "FileVersion", "1.0.0.0\0"
VALUE "InternalName", "vertiread"
VALUE "OriginalFilename", "VertiRead.exe"
VALUE "ProductName", "VeriRead"
VALUE "ProductVersion", "1.0.0.0\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
END
END
#include <windows.h>

MAINICON ICON "icon.ico"

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILETYPE 0x1L

BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904e4"
BEGIN
VALUE "FileDescription", "Manga Reader"
VALUE "FileVersion", "1.0.0.0\0"
VALUE "InternalName", "vertiread"
VALUE "OriginalFilename", "VertiRead.exe"
VALUE "ProductName", "VeriRead"
VALUE "ProductVersion", "1.0.0.0\0"
END
END

BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
END
END
26 changes: 13 additions & 13 deletions rsc/vertiread.desktop
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[Desktop Entry]
Version=1.0
Name=VertiRead
Exec=
Icon=
Comment=Read Mangas and listen to music
GenericName=Manga Reader
Keywords=Manga;Music;Reader
Categories=Utility
Type=Application
Terminal=false
X-MultipleArgs=false
StartupNotify=true
[Desktop Entry]
Version=1.0
Name=VertiRead
Exec=
Icon=
Comment=Comic/Manga reader
GenericName=Manga Reader
Keywords=Manga;Reader
Categories=Utility
Type=Application
Terminal=false
X-MultipleArgs=false
StartupNotify=true
Loading

0 comments on commit c136daa

Please sign in to comment.