Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wasm-watermarker
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nagayama15
wasm-watermarker
Commits
9cf35632
Commit
9cf35632
authored
Mar 13, 2019
by
nagayama15
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
📥
Add fmt
parent
93c8247b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
4 deletions
+33
-4
CMakeLists.txt
CMakeLists.txt
+1
-0
fmt.cmake
cmake/fmt.cmake
+25
-0
CMakeLists.txt
src/CMakeLists.txt
+1
-0
kyut.cpp
src/kyut.cpp
+6
-4
No files found.
CMakeLists.txt
View file @
9cf35632
...
@@ -14,6 +14,7 @@ endif (NOT CMAKE_BUILD_TYPE)
...
@@ -14,6 +14,7 @@ endif (NOT CMAKE_BUILD_TYPE)
include
(
ExternalProject
)
include
(
ExternalProject
)
include
(
cmake/binaryen.cmake
)
include
(
cmake/binaryen.cmake
)
include
(
cmake/fmt.cmake
)
include_directories
(
include_directories
(
src
src
...
...
cmake/fmt.cmake
0 → 100644
View file @
9cf35632
ExternalProject_Add
(
fmt
URL https://github.com/fmtlib/fmt/archive/5.3.0.zip
PREFIX fmt
INSTALL_COMMAND
""
TEST_COMMAND
""
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=Release
-DFMT_DOC=OFF
-DFMT_TEST=OFF
)
ExternalProject_Get_Property
(
fmt source_dir
)
ExternalProject_Get_Property
(
fmt binary_dir
)
file
(
MAKE_DIRECTORY
${
source_dir
}
/include
)
add_library
(
libfmt STATIC IMPORTED
)
add_dependencies
(
libfmt fmt
)
set_target_properties
(
libfmt
PROPERTIES
IMPORTED_LOCATION
${
binary_dir
}
/libfmt.a
INTERFACE_INCLUDE_DIRECTORIES
${
source_dir
}
/include
)
src/CMakeLists.txt
View file @
9cf35632
...
@@ -4,6 +4,7 @@ add_executable(kyut
...
@@ -4,6 +4,7 @@ add_executable(kyut
target_link_libraries
(
kyut
target_link_libraries
(
kyut
libbinaryen
libbinaryen
libfmt
)
)
if
(
WIN32
)
if
(
WIN32
)
...
...
src/kyut.cpp
View file @
9cf35632
#include <
iostream
>
#include <
cstdio
>
#include <fmt/format.h>
#include <wasm-io.h>
#include <wasm-io.h>
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
try
{
try
{
if
(
argc
!=
3
)
{
if
(
argc
!=
3
)
{
std
::
cerr
<<
"WebAssembly digital watermarker."
<<
std
::
endl
;
fmt
::
print
(
stderr
,
std
::
cerr
<<
"usage: kyut <input file> <watermark>"
<<
std
::
endl
;
"WebAssembly digital watermarker.
\n
"
"usage: kyut <input file> <watermark>
\n
"
);
return
1
;
return
1
;
}
}
...
@@ -14,7 +16,7 @@ int main(int argc, char *argv[]) {
...
@@ -14,7 +16,7 @@ int main(int argc, char *argv[]) {
wasm
::
Module
module
;
wasm
::
Module
module
;
wasm
::
ModuleReader
{}.
readBinary
(
argv
[
1
],
module
);
wasm
::
ModuleReader
{}.
readBinary
(
argv
[
1
],
module
);
}
catch
(
const
std
::
exception
&
e
)
{
}
catch
(
const
std
::
exception
&
e
)
{
std
::
cerr
<<
e
.
what
()
<<
'\n'
;
fmt
::
print
(
stderr
,
"error: {}
\n
"
,
e
.
what
())
;
return
1
;
return
1
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment