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
ea02a066
Commit
ea02a066
authored
Mar 13, 2019
by
nagayama15
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cmake.
parent
7df9d048
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
10 deletions
+27
-10
CMakeLists.txt
CMakeLists.txt
+1
-1
binaryen.cmake
cmake/binaryen.cmake
+15
-6
CMakeLists.txt
src/CMakeLists.txt
+1
-1
kyut.cpp
src/kyut.cpp
+10
-2
No files found.
CMakeLists.txt
View file @
ea02a066
...
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0.0)
...
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0.0)
project
(
wasm-watermarker VERSION 0.1.0 LANGUAGES CXX
)
project
(
wasm-watermarker VERSION 0.1.0 LANGUAGES CXX
)
set
(
CMAKE_CXX_FLAGS
"-std=c++
2a
-Wall -Wextra -Werror -pedantic -fconcepts"
)
set
(
CMAKE_CXX_FLAGS
"-std=c++
17
-Wall -Wextra -Werror -pedantic -fconcepts"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"-g3 -O0 -pg"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"-g3 -O0 -pg"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"-O2 -DNDEBUG -march=native"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"-O2 -DNDEBUG -march=native"
)
set
(
CMAKE_CXX_FLAGS_RELWITHDEBINFO
"-g3 -Og -pg"
)
set
(
CMAKE_CXX_FLAGS_RELWITHDEBINFO
"-g3 -Og -pg"
)
...
...
cmake/binaryen.cmake
View file @
ea02a066
...
@@ -4,18 +4,27 @@ ExternalProject_Add(
...
@@ -4,18 +4,27 @@ ExternalProject_Add(
PREFIX binaryen
PREFIX binaryen
INSTALL_COMMAND
""
INSTALL_COMMAND
""
TEST_COMMAND
""
TEST_COMMAND
""
LOG_DOWNLOAD ON
CMAKE_ARGS
CMAKE_ARGS -DBUILD_STATIC_LIB=1
-DBUILD_STATIC_LIB=ON
-DCMAKE_BUILD_TYPE=Release
)
)
ExternalProject_Get_Property
(
binaryen source_dir
)
ExternalProject_Get_Property
(
binaryen source_dir
)
ExternalProject_Get_Property
(
binaryen binary_dir
)
ExternalProject_Get_Property
(
binaryen binary_dir
)
add_library
(
binaryen_wasm STATIC IMPORTED
)
file
(
MAKE_DIRECTORY
${
source_dir
}
/src
)
add_dependencies
(
binaryen_wasm binaryen
)
set_target_properties
(
binaryen_wasm
add_library
(
libbinaryen STATIC IMPORTED
)
add_dependencies
(
libbinaryen binaryen
)
set_target_properties
(
libbinaryen
PROPERTIES
PROPERTIES
IMPORTED_LOCATION
${
binary_dir
}
/lib/lib
wasm
.a
IMPORTED_LOCATION
${
binary_dir
}
/lib/lib
binaryen
.a
INTERFACE_INCLUDE_DIRECTORIES
${
source_dir
}
/src
INTERFACE_INCLUDE_DIRECTORIES
${
source_dir
}
/src
INTERFACE_LINK_LIBRARIES
${
binary_dir
}
/lib/libwasm.a
INTERFACE_LINK_LIBRARIES
${
binary_dir
}
/lib/libir.a
INTERFACE_LINK_LIBRARIES
${
binary_dir
}
/lib/libcfg.a
INTERFACE_LINK_LIBRARIES
${
binary_dir
}
/lib/libpasses.a
INTERFACE_LINK_LIBRARIES
${
binary_dir
}
/lib/libsupport.a
INTERFACE_LINK_LIBRARIES
${
binary_dir
}
/lib/libasmjs.a
)
)
src/CMakeLists.txt
View file @
ea02a066
...
@@ -3,5 +3,5 @@ add_executable(kyut
...
@@ -3,5 +3,5 @@ add_executable(kyut
)
)
target_link_libraries
(
kyut
target_link_libraries
(
kyut
binaryen_wasm
libbinaryen
)
)
src/kyut.cpp
View file @
ea02a066
#include <iostream>
#include <iostream>
#include <wasm-io.h>
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
try
{
try
{
for
(
int
i
=
0
;
i
<
argc
;
i
++
)
{
if
(
argc
!=
3
)
{
std
::
cout
<<
argv
[
i
]
<<
std
::
endl
;
std
::
cerr
<<
"WebAssembly digital watermarker."
<<
std
::
endl
;
std
::
cerr
<<
"usage: kyut <input file> <watermark>"
<<
std
::
endl
;
return
1
;
}
}
wasm
::
Module
module
;
wasm
::
ModuleReader
{}.
readBinary
(
argv
[
1
],
module
);
}
catch
(
const
std
::
exception
&
e
)
{
}
catch
(
const
std
::
exception
&
e
)
{
std
::
cerr
<<
e
.
what
()
<<
'\n'
;
std
::
cerr
<<
e
.
what
()
<<
'\n'
;
...
...
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