@@ -89,8 +89,7 @@ endmacro()
8989# version "1" is defined.
9090# GENERATOR_VERSION Which version of the SAPI generator to use. Currently, only
9191# version "1", "2", and "3" are defined. Note that if unset, this defaults to
92- # version "1" unless SAPI_ENABLE_CLANG_TOOL is set, in which case it defaults
93- # to version "2".
92+ # version "2".
9493function (add_sapi_library )
9594 set (_sapi_opts NOEMBED)
9695 set (_sapi_one_value LIBRARY LIBRARY_NAME NAMESPACE API_VERSION GENERATOR_VERSION)
@@ -99,14 +98,14 @@ function(add_sapi_library)
9998 "${_sapi_one_value} " "${_sapi_multi_value} " )
10099 set (_sapi_NAME "${ARGV0} " )
101100
102- if (_sapi_GENERATOR_VERSION AND (_sapi_GENERATOR_VERSION VERSION_LESS "1" OR _sapi_GENERATOR_VERSION VERSION_GREATER "3" ))
101+ if (_sapi_GENERATOR_VERSION AND (_sapi_GENERATOR_VERSION VERSION_LESS "1" OR _sapi_GENERATOR_VERSION VERSION_GREATER "3" ))
103102 message (FATAL_ERROR "GENERATOR_VERSION must be \" 1\" , \" 2\" or \" 3\" " )
104103 endif ()
105104
106- if (_sapi_GENERATOR_VERSION)
105+ if (_sapi_GENERATOR_VERSION)
107106 set (_sapi_use_generator_version ${_sapi_GENERATOR_VERSION} )
108107 else ()
109- if (SAPI_ENABLE_CLANG_TOOL)
108+ if (SAPI_ENABLE_CLANG_TOOL)
110109 set (_sapi_use_generator_version "2" )
111110 else ()
112111 set (_sapi_use_generator_version "1" )
@@ -123,7 +122,7 @@ function(add_sapi_library)
123122 endif ()
124123
125124 # The sandboxee client library.
126- if (_sapi_use_generator_version VERSION_EQUAL "3" )
125+ if (_sapi_use_generator_version VERSION_EQUAL "3" )
127126 set (_sapi_sandboxee_client_target "${_sapi_NAME} _sandboxee_gen" )
128127 add_library ("${_sapi_sandboxee_client_target} " STATIC
129128 "${_sapi_gen_sandboxee_src} "
@@ -139,7 +138,7 @@ function(add_sapi_library)
139138 )
140139 set (_sapi_sandboxee_client_lib "${_sapi_sandboxee_client_target} " )
141140 else ()
142- set (_sapi_sandboxee_client_lib "sapi::client_message_handler" )
141+ set (_sapi_sandboxee_client_lib "sapi::client_message_handler" )
143142 endif ()
144143
145144 # The sandboxed binary
@@ -189,8 +188,10 @@ function(add_sapi_library)
189188 "--sapi_ns=${_sapi_NAMESPACE} "
190189 )
191190 if (_sapi_use_generator_version VERSION_GREATER_EQUAL "2" )
192- list (APPEND _sapi_generator_args "--sapi_api_version=${_sapi_API_VERSION} " )
193- if (_sapi_use_generator_version VERSION_EQUAL "3" )
191+ if (_sapi_API_VERSION)
192+ list (APPEND _sapi_generator_args "--sapi_api_version=${_sapi_API_VERSION} " )
193+ endif ()
194+ if (_sapi_use_generator_version VERSION_EQUAL "3" )
194195 list (APPEND _sapi_generator_args
195196 "--sapi_sandboxee_src_out=${_sapi_gen_sandboxee_src} "
196197 )
0 commit comments