Skip to content

Commit 0173f83

Browse files
author
Clement Champetier
committed
SWIG: add flags when compile bindings
* New flags: * fcompact - Compile in compact mode * small - Compile in virtual elimination & compact mode * O - Enable the optimization options: -fastdispatch -fvirtual * Werror - Treat warnings as errors * Fix #179
1 parent a9b634c commit 0173f83

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ if(SWIG_FOUND)
7676
set(AVTRANSCODER_BINDING_FILE "AvTranscoder/avTranscoder.i")
7777
set_source_files_properties(${AVTRANSCODER_BINDING_FILE} PROPERTIES CPLUSPLUS ON)
7878

79+
# Swig flags
80+
set(CMAKE_SWIG_FLAGS -c++ -fcompact -small -O -Werror)
81+
7982
### PYTHON BINDING
8083
if(AVTRANSCODER_DISABLE_PYTHON_BINDING)
8184
message("PYTHON binding disabled, will not build python binding.")
@@ -84,9 +87,6 @@ if(SWIG_FOUND)
8487
if(PYTHONLIBS_FOUND)
8588
include_directories(${PYTHON_INCLUDE_PATH})
8689

87-
# Swig flags
88-
set(CMAKE_SWIG_FLAGS -c++ -fcompact)
89-
9090
# Create '_avtranscoder' shared lib (python)
9191
swig_add_module(avtranscoder-py python ${AVTRANSCODER_BINDING_FILE})
9292
# For Python binding, need to compile the wrapper into a lib called "_<module_name>.so"
@@ -131,7 +131,7 @@ if(SWIG_FOUND)
131131
include_directories(${JNI_INCLUDE_DIRS})
132132

133133
# Swig flags
134-
set(CMAKE_SWIG_FLAGS -c++ -fcompact -package org.avtranscoder)
134+
set(CMAKE_SWIG_FLAGS ${CMAKE_SWIG_FLAGS} -package org.avtranscoder)
135135

136136
# Create 'avtranscoder-java' shared lib
137137
swig_add_module(avtranscoder-java java ${AVTRANSCODER_BINDING_FILE})

0 commit comments

Comments
 (0)