Skip to content

Commit

Permalink
Support real platforms with static binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
aronson committed Apr 30, 2024
1 parent e6e9679 commit 189f1d4
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "subprojects/libopenmpt"]
path = subprojects/libopenmpt
path = subprojects/openmpt
url = https://gitea.com/Apotris/libopenmpt.git
1 change: 1 addition & 0 deletions countchan.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <libopenmpt.hpp>
#include <libopenmpt_ext.hpp>
#include <memory>
#include <vector>
#include <fstream>

Expand Down
22 changes: 20 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project('countchan', 'cpp', default_options : ['cpp_std=c++17', 'buildtype=debugoptimized', 'b_lto=true', 'warning_level=1'])
project('countchan', 'cpp', default_options : ['cpp_std=c++17', 'buildtype=minsize', 'default_library=static', 'b_lto=true', 'warning_level=1'])

add_global_arguments('-fexceptions', language : ['cpp'])
add_global_arguments('-frtti', language : ['cpp'])
Expand All @@ -7,9 +7,27 @@ mpt = dependency('openmpt', static : true, fallback : ['openmpt', 'openmpt_dep']

sources = files('countchan.cpp')

if meson.get_compiler('cpp').get_id() != 'clang'
link_args = [
'-static-libgcc',
'-static-libstdc++',
]
else
link_args = []
endif

if host_machine.system() == 'windows'
link_args += '-Wl,-Bstatic,--whole-archive'
link_args += '-lwinpthread'
link_args += '-Wl,--no-whole-archive'
elif host_machine.system() == 'darwin'
link_args += '-mmacosx-version-min=10.15'
endif

executable('countchan',
dependencies : [mpt],
dependencies : [dependency('threads'), mpt],
win_subsystem : 'console',
link_args : link_args,
sources : sources
)

Submodule openmpt updated from 000000 to f8cd55

0 comments on commit 189f1d4

Please sign in to comment.