Skip to content

Commit

Permalink
Simplify the version update process by getting the version number fro…
Browse files Browse the repository at this point in the history
…m a single file (ihhub#5231)
  • Loading branch information
oleg-derevenetz authored Apr 14, 2022
1 parent 4e8e61d commit 643a54b
Show file tree
Hide file tree
Showing 13 changed files with 114 additions and 56 deletions.
22 changes: 21 additions & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,28 @@ jobs:
brew install ${{ matrix.config.dependencies }}
- name: Build
run: |
cmake -B build -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_STRICT_COMPILATION=ON -DENABLE_IMAGE=ON -DENABLE_TOOLS=ON ${{ matrix.config.options }}
cmake -B build -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Debug -DENABLE_STRICT_COMPILATION=ON -DENABLE_IMAGE=ON -DENABLE_TOOLS=ON ${{ matrix.config.options }}
cmake --build build -j2
- name: Install
run: |
sudo cmake --install build
build-windows:
name: CMake (Windows SDL2)
runs-on: windows-latest
timeout-minutes: 30
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
C:/vcpkg/vcpkg --triplet x64-windows install sdl2 sdl2-mixer sdl2-image zlib
- name: Build
run: |
cmake -B build -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Debug -DENABLE_STRICT_COMPILATION=ON -DENABLE_IMAGE=ON -DENABLE_TOOLS=ON -DUSE_SDL_VERSION=SDL2 \
-DCMAKE_TOOLCHAIN_FILE="C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows
cmake --build build --config Debug -j2
- name: Install
run: |
cmake --install build --config Debug
9 changes: 4 additions & 5 deletions .github/workflows/msvc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ jobs:
defaults:
run:
shell: bash
env:
APP_VERSION: 0.9.14
steps:
- uses: actions/checkout@v2
- name: Install dependencies, cygwin and zip
Expand All @@ -53,9 +51,10 @@ jobs:
choco.exe install cygwin cyg-get zip -y
cyg-get.bat make iconv gettext-devel
- uses: microsoft/setup-msbuild@v1
- name: Generate build number
- name: Generate version information
run: |
echo "fheroes2_build_version=$((GITHUB_RUN_NUMBER % 32768))" >> "$GITHUB_ENV"
echo "FHEROES2_APP_VERSION=$(cat version.txt)" >> "$GITHUB_ENV"
echo "FHEROES2_BUILD_NUMBER=$((GITHUB_RUN_ID % 32768))" >> "$GITHUB_ENV"
- name: Build
run: |
MSBuild.exe fheroes2-vs2019.vcxproj /property:Platform=${{ matrix.config.platform }} /property:Configuration=${{ matrix.config.build_config }}
Expand All @@ -71,7 +70,7 @@ jobs:
shell: cmd
- name: Create Inno Setup package
run: |
iscc.exe script\windows\fheroes2.iss /DAppVersion="%APP_VERSION%" /DBuildDir="..\..\%BUILD_DIR%" ^
iscc.exe script\windows\fheroes2.iss /DAppVersion="%FHEROES2_APP_VERSION%" /DBuildDir="..\..\%BUILD_DIR%" ^
/DPlatform=${{ matrix.config.platform }} /DDeployConfName=${{ matrix.config.deploy_config }}
shell: cmd
env:
Expand Down
26 changes: 14 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
cmake_minimum_required(VERSION 3.20)
cmake_policy(SET CMP0074 NEW)

project(fheroes2 VERSION 0.9.14 LANGUAGES C CXX)
file(STRINGS ${CMAKE_SOURCE_DIR}/version.txt FHEROES2_VERSION LIMIT_COUNT 1 REGEX "^[0-9]+\.[0-9]+\.[0-9]+$")

project(fheroes2 VERSION ${FHEROES2_VERSION} LANGUAGES C CXX)

set(CMAKE_CXX_STANDARD 11)

Expand All @@ -45,7 +47,7 @@ cmake_dependent_option(MACOS_APP_BUNDLE "Create a Mac app bundle" OFF "APPLE" OF
cmake_dependent_option(GET_HOMM2_DEMO "Fetch and install the HoMM II demo data" OFF "NOT MACOS_APP_BUNDLE" OFF)

set(USE_SDL_VERSION SDL2 CACHE STRING "Version of the SDL library used")
set(FHEROES2_DATA "${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}" CACHE STRING "Path to the fheroes2 data directory (relative to CMAKE_INSTALL_PREFIX)")
set(FHEROES2_DATA ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME} CACHE STRING "Path to the fheroes2 data directory (relative to CMAKE_INSTALL_PREFIX)")

# For ComboBox in CMake GUI
set_property(CACHE USE_SDL_VERSION PROPERTY STRINGS SDL SDL2)
Expand Down Expand Up @@ -103,32 +105,32 @@ if(MACOS_APP_BUNDLE)
add_custom_target(
app_bundle_h2d_files
ALL
COMMAND mkdir -p "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_NAME}.app/Contents/Resources/h2d"
COMMAND cp *.h2d "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_NAME}.app/Contents/Resources/h2d"
COMMAND mkdir -p ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_NAME}.app/Contents/Resources/h2d
COMMAND cp *.h2d ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_NAME}.app/Contents/Resources/h2d
DEPENDS fheroes2
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/files/data"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/files/data
)
add_custom_target(
app_bundle_key_file
ALL
COMMAND cp fheroes2.key "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_NAME}.app/Contents/Resources"
COMMAND cp fheroes2.key ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_NAME}.app/Contents/Resources
DEPENDS fheroes2
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
add_custom_target(
app_bundle_translations
ALL
COMMAND mkdir -p "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_NAME}.app/Contents/Resources/translations"
COMMAND cp *.mo "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_NAME}.app/Contents/Resources/translations"
COMMAND mkdir -p ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_NAME}.app/Contents/Resources/translations
COMMAND cp *.mo ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_NAME}.app/Contents/Resources/translations
DEPENDS translations
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/files/lang"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/files/lang
)
add_custom_target(
run_dylibbundler
ALL
COMMAND dylibbundler -od -b -x "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_NAME}.app/Contents/MacOS/${PROJECT_NAME}" -d "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_NAME}.app/Contents/libs"
COMMAND dylibbundler -od -b -x ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_NAME}.app/Contents/MacOS/${PROJECT_NAME} -d ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_NAME}.app/Contents/libs
DEPENDS fheroes2 app_bundle_h2d_files app_bundle_key_file app_bundle_translations
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
endif(MACOS_APP_BUNDLE)

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# FHEROES2_DATA: set the built-in path to the fheroes2 data directory (e.g. /usr/share/fheroes2)

TARGET := fheroes2
PROJECT_VERSION := 0.9.14
PROJECT_VERSION := $(file < version.txt)

.PHONY: all bundle clean

Expand Down
2 changes: 1 addition & 1 deletion Makefile.switch
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ MAKE := make

PROJECT_TITLE := fheroes2
PROJECT_AUTHOR := fheroes2 resurrection team
PROJECT_VERSION := 0.9.14
PROJECT_VERSION := $(file < version.txt)

PATH := $(PATH):/opt/devkitpro/portlibs/switch/bin/:/opt/devkitpro/tools/bin/

Expand Down
4 changes: 2 additions & 2 deletions VisualStudio/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)..\src\engine;$(MSBuildThisFileDirectory)..\src\fheroes2\gui;$(MSBuildThisFileDirectory)..\src\fheroes2\maps;$(MSBuildThisFileDirectory)..\src\fheroes2\kingdom;$(MSBuildThisFileDirectory)..\src\fheroes2\campaign;$(MSBuildThisFileDirectory)..\src\fheroes2\game;$(MSBuildThisFileDirectory)..\src\fheroes2\dialog;$(MSBuildThisFileDirectory)..\src\fheroes2\system;$(MSBuildThisFileDirectory)..\src\fheroes2\spell;$(MSBuildThisFileDirectory)..\src\fheroes2\monster;$(MSBuildThisFileDirectory)..\src\fheroes2\castle;$(MSBuildThisFileDirectory)..\src\fheroes2\agg;$(MSBuildThisFileDirectory)..\src\fheroes2\heroes;$(MSBuildThisFileDirectory)..\src\fheroes2\resource;$(MSBuildThisFileDirectory)..\src\fheroes2\ai;$(MSBuildThisFileDirectory)..\src\fheroes2\army;$(MSBuildThisFileDirectory)..\src\fheroes2\battle;$(MSBuildThisFileDirectory)..\src\fheroes2\h2d;$(MSBuildThisFileDirectory)..\src\fheroes2\objects;$(MSBuildThisFileDirectory)..\src\fheroes2\world;$(MSBuildThisFileDirectory)..\src\fheroes2\image;$(MSBuildThisFileDirectory)..\src\thirdparty\libsmacker;$(MSBuildThisFileDirectory)packages\installed\zlib\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(fheroes2_build_version)'!=''">BUILD_VERSION=$(fheroes2_build_version);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(FHEROES2_BUILD_NUMBER)'!=''">BUILD_VERSION=$(FHEROES2_BUILD_NUMBER);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<TreatSpecificWarningsAsErrors>4018;4028;4100;4114;4189;4245;4267;4309;4319;4389;4552;4456;4458;4554;4457;4592;4702;4706;4715;4800;4834</TreatSpecificWarningsAsErrors>
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)..\src\fheroes2\system;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(fheroes2_build_version)'!=''">BUILD_VERSION=$(fheroes2_build_version);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(FHEROES2_BUILD_NUMBER)'!=''">BUILD_VERSION=$(FHEROES2_BUILD_NUMBER);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)packages\installed\zlib\lib\$(PlatformTarget);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
Expand Down
36 changes: 16 additions & 20 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,25 @@
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #
###########################################################################

if (MSVC)
add_compile_options(/W4)
else()
add_compile_options(
-pedantic -Wall -Wextra -Wctor-dtor-privacy -Wdouble-promotion -Wfloat-conversion
-Wfloat-equal -Winit-self -Woverloaded-virtual -Wredundant-decls -Wshadow -Wundef
-Wuninitialized -Wunused
)
endif()

if(ENABLE_STRICT_COMPILATION)
if (MSVC)
add_compile_options(/WX)
else()
add_compile_options(-Werror)
endif()
endif()

add_compile_definitions($<$<CONFIG:Debug>:WITH_DEBUG>)
set(
GNU_CC_WARN_OPTS
-pedantic -Wall -Wextra -Wdouble-promotion -Wfloat-conversion -Wfloat-equal -Winit-self
-Wredundant-decls -Wshadow -Wundef -Wuninitialized -Wunused
)
set(
GNU_CXX_WARN_OPTS
${GNU_CC_WARN_OPTS} -Wctor-dtor-privacy -Woverloaded-virtual
)
set(
MSVC_CC_WARN_OPTS
/W4
/wd4244 # Suppress C4244 - possible data loss during conversion
/wd4267 # Suppress C4267 - possible data loss during conversion from size_t
)

add_subdirectory(thirdparty)
add_subdirectory(engine)
add_subdirectory(fheroes2)
if(ENABLE_TOOLS)
add_subdirectory(tools)
endif()
endif(ENABLE_TOOLS)
6 changes: 4 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,10 @@ endif

# TODO: Add -Wconversion -Wsign-conversion -Wextra-semi flags once we fix all the corresponding code smells
# TODO: Add -Wswitch-default -Wold-style-cast flags once SDL headers can be compiled with them
CCFLAGS := $(CCFLAGS) -pedantic -Wall -Wextra -Wcast-align -Wctor-dtor-privacy -Wdouble-promotion -Wfloat-conversion -Wfloat-equal \
-Winit-self -Woverloaded-virtual -Wredundant-decls -Wshadow -Wundef -Wuninitialized -Wunused
CCWARNOPTS := -pedantic -Wall -Wextra -Wcast-align -Wdouble-promotion -Wfloat-conversion -Wfloat-equal -Winit-self \
-Wredundant-decls -Wshadow -Wundef -Wuninitialized -Wunused
CFLAGS := $(CFLAGS) $(CCWARNOPTS)
CXXFLAGS := $(CXXFLAGS) $(CCWARNOPTS) -Wctor-dtor-privacy -Woverloaded-virtual

ifdef FHEROES2_STRICT_COMPILATION
CCFLAGS := $(CCFLAGS) -Werror
Expand Down
12 changes: 12 additions & 0 deletions src/engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,21 @@

file(GLOB_RECURSE LIBENGINE_SOURCES CONFIGURE_DEPENDS *.cpp)

add_compile_options("$<$<COMPILE_LANG_AND_ID:C,AppleClang,Clang,GNU>:${GNU_CC_WARN_OPTS}>")
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,AppleClang,Clang,GNU>:${GNU_CXX_WARN_OPTS}>")
add_compile_options("$<$<OR:$<COMPILE_LANG_AND_ID:C,MSVC>,$<COMPILE_LANG_AND_ID:CXX,MSVC>>:${MSVC_CC_WARN_OPTS}>")

if(ENABLE_STRICT_COMPILATION)
add_compile_options($<$<OR:$<COMPILE_LANG_AND_ID:C,AppleClang,Clang,GNU>,$<COMPILE_LANG_AND_ID:CXX,AppleClang,Clang,GNU>>:-Werror>)
add_compile_options($<$<OR:$<COMPILE_LANG_AND_ID:C,MSVC>,$<COMPILE_LANG_AND_ID:CXX,MSVC>>:/WX>)
endif(ENABLE_STRICT_COMPILATION)

add_library(engine STATIC ${LIBENGINE_SOURCES})

target_compile_definitions(engine PRIVATE
# MSVC: suppress deprecation warnings
$<$<OR:$<COMPILE_LANG_AND_ID:C,MSVC>,$<COMPILE_LANG_AND_ID:CXX,MSVC>>:_CRT_SECURE_NO_WARNINGS>
$<$<CONFIG:Debug>:WITH_DEBUG>
$<$<BOOL:${ENABLE_IMAGE}>:WITH_IMAGE>
$<$<BOOL:${MACOS_APP_BUNDLE}>:MACOS_APP_BUNDLE>
)
Expand Down
35 changes: 24 additions & 11 deletions src/fheroes2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,40 @@

file(GLOB_RECURSE FHEROES2_SOURCES CONFIGURE_DEPENDS *.cpp)

add_compile_options("$<$<COMPILE_LANG_AND_ID:C,AppleClang,Clang,GNU>:${GNU_CC_WARN_OPTS}>")
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,AppleClang,Clang,GNU>:${GNU_CXX_WARN_OPTS}>")
add_compile_options("$<$<OR:$<COMPILE_LANG_AND_ID:C,MSVC>,$<COMPILE_LANG_AND_ID:CXX,MSVC>>:${MSVC_CC_WARN_OPTS}>")

if(ENABLE_STRICT_COMPILATION)
add_compile_options($<$<OR:$<COMPILE_LANG_AND_ID:C,AppleClang,Clang,GNU>,$<COMPILE_LANG_AND_ID:CXX,AppleClang,Clang,GNU>>:-Werror>)
add_compile_options($<$<OR:$<COMPILE_LANG_AND_ID:C,MSVC>,$<COMPILE_LANG_AND_ID:CXX,MSVC>>:/WX>)
endif(ENABLE_STRICT_COMPILATION)

if(MINGW)
set(MINGW_LIBRARIES mingw32 winmm)
endif(MINGW)

if(MACOS_APP_BUNDLE)
set(fheroes2Icon "${CMAKE_CURRENT_SOURCE_DIR}/../resources/fheroes2.icns")
set_source_files_properties(${fheroes2Icon} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
set(FHEROES2_ICON ${CMAKE_CURRENT_SOURCE_DIR}/../resources/fheroes2.icns)
set_source_files_properties(${FHEROES2_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)

add_executable(fheroes2 MACOSX_BUNDLE ${fheroes2Icon} ${FHEROES2_SOURCES} ${TRANSLATION_DATA})
add_executable(fheroes2 MACOSX_BUNDLE ${FHEROES2_ICON} ${FHEROES2_SOURCES} ${TRANSLATION_DATA})

target_compile_definitions(fheroes2 PRIVATE
$<$<CONFIG:Debug>:WITH_DEBUG>
$<$<BOOL:${MACOS_APP_BUNDLE}>:MACOS_APP_BUNDLE>
)

target_link_libraries(fheroes2 "-framework CoreFoundation")

set_target_properties(fheroes2 PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "${CMAKE_PROJECT_NAME}")
set_target_properties(fheroes2 PROPERTIES MACOSX_BUNDLE_EXECUTABLE_NAME "${MACOSX_BUNDLE_BUNDLE_NAME}")
set_target_properties(fheroes2 PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/../resources/Info.plist.in")
set_target_properties(fheroes2 PROPERTIES MACOSX_BUNDLE_ICON_FILE "fheroes2.icns")
set_target_properties(fheroes2 PROPERTIES MACOSX_BUNDLE_GUI_IDENTIFIER "com.fheroes2.${CMAKE_PROJECT_NAME}")
set_target_properties(fheroes2 PROPERTIES MACOSX_BUNDLE_SHORT_VERSION_STRING "${CMAKE_PROJECT_VERSION}")
set_target_properties(fheroes2 PROPERTIES MACOSX_BUNDLE_BUNDLE_VERSION "${CMAKE_PROJECT_VERSION}")
set_target_properties(fheroes2 PROPERTIES OUTPUT_NAME "${CMAKE_PROJECT_NAME}")
set_target_properties(fheroes2 PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME ${CMAKE_PROJECT_NAME})
set_target_properties(fheroes2 PROPERTIES MACOSX_BUNDLE_EXECUTABLE_NAME ${CMAKE_PROJECT_NAME})
set_target_properties(fheroes2 PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/../resources/Info.plist.in)
set_target_properties(fheroes2 PROPERTIES MACOSX_BUNDLE_ICON_FILE fheroes2.icns)
set_target_properties(fheroes2 PROPERTIES MACOSX_BUNDLE_GUI_IDENTIFIER com.fheroes2.${CMAKE_PROJECT_NAME})
set_target_properties(fheroes2 PROPERTIES MACOSX_BUNDLE_SHORT_VERSION_STRING ${CMAKE_PROJECT_VERSION})
set_target_properties(fheroes2 PROPERTIES MACOSX_BUNDLE_BUNDLE_VERSION ${CMAKE_PROJECT_VERSION})
set_target_properties(fheroes2 PROPERTIES OUTPUT_NAME ${CMAKE_PROJECT_NAME})
else(MACOS_APP_BUNDLE)
cmake_path(ABSOLUTE_PATH FHEROES2_DATA
BASE_DIRECTORY ${CMAKE_INSTALL_PREFIX}
Expand All @@ -54,6 +64,9 @@ else(MACOS_APP_BUNDLE)
add_executable(fheroes2 ${FHEROES2_SOURCES})

target_compile_definitions(fheroes2 PRIVATE
# MSVC: suppress deprecation warnings
$<$<OR:$<COMPILE_LANG_AND_ID:C,MSVC>,$<COMPILE_LANG_AND_ID:CXX,MSVC>>:_CRT_SECURE_NO_WARNINGS>
$<$<CONFIG:Debug>:WITH_DEBUG>
FHEROES2_DATA=${FHEROES2_DATA_ABSOLUTE}
)

Expand Down
2 changes: 1 addition & 1 deletion src/thirdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if(USE_SYSTEM_LIBSMACKER)
include(FindPkgConfig)

pkg_check_modules(smacker REQUIRED smacker)
else()
else(USE_SYSTEM_LIBSMACKER)
set(LIBSMACKER_SOURCES
libsmacker/smacker.c
libsmacker/smk_bitstream.c
Expand Down
13 changes: 13 additions & 0 deletions src/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #
###########################################################################

add_compile_options("$<$<COMPILE_LANG_AND_ID:C,AppleClang,Clang,GNU>:${GNU_CC_WARN_OPTS}>")
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,AppleClang,Clang,GNU>:${GNU_CXX_WARN_OPTS}>")
add_compile_options("$<$<OR:$<COMPILE_LANG_AND_ID:C,MSVC>,$<COMPILE_LANG_AND_ID:CXX,MSVC>>:${MSVC_CC_WARN_OPTS}>")

if(ENABLE_STRICT_COMPILATION)
add_compile_options($<$<OR:$<COMPILE_LANG_AND_ID:C,AppleClang,Clang,GNU>,$<COMPILE_LANG_AND_ID:CXX,AppleClang,Clang,GNU>>:-Werror>)
add_compile_options($<$<OR:$<COMPILE_LANG_AND_ID:C,MSVC>,$<COMPILE_LANG_AND_ID:CXX,MSVC>>:/WX>)
endif(ENABLE_STRICT_COMPILATION)

# MSVC: suppress deprecation warnings
add_compile_definitions($<$<OR:$<COMPILE_LANG_AND_ID:C,MSVC>,$<COMPILE_LANG_AND_ID:CXX,MSVC>>:_CRT_SECURE_NO_WARNINGS>)
add_compile_definitions($<$<CONFIG:Debug>:WITH_DEBUG>)

add_executable(82m2wav 82m2wav.cpp)
add_executable(bin2txt bin2txt.cpp)
add_executable(extractor extractor.cpp)
Expand Down
1 change: 1 addition & 0 deletions version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.9.14

0 comments on commit 643a54b

Please sign in to comment.