File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -181,17 +181,24 @@ else()
181
181
endif ()
182
182
183
183
184
- # Build QVM tools.
185
- # EXCLUDE_FROM_ALL tells to not build tools if they does not required, for example if you build native library only.
186
- add_subdirectory (tools/q3asm EXCLUDE_FROM_ALL )
184
+ # Build QVM tools if needed.
185
+ find_program (Q3ASM q3asm )
186
+ if (Q3ASM )
187
+ message (STATUS "q3asm found at ${Q3ASM} " )
188
+ set (QVM_LINKER "${Q3ASM} " )
189
+ else ()
190
+ message (STATUS "q3asm not found, compiling bundled q3asm." )
191
+ # EXCLUDE_FROM_ALL tells to not build tools if they does not required, for example if you build native library only.
192
+ add_subdirectory (tools/q3asm EXCLUDE_FROM_ALL )
193
+ set (QVM_LINKER "q3asm" )
194
+ endif ()
187
195
188
196
# Set up vars for QVM library.
189
197
set (VM_DIR "vm" )
190
198
add_custom_target (vmdir
191
199
COMMAND ${CMAKE_COMMAND} -E make_directory ${VM_DIR}
192
200
)
193
201
set (QVM_COMPILER "q3lcc" )
194
- set (QVM_LINKER "q3asm" )
195
202
set (QVM_C_FLAGS -DQ3_VM -S -Wf-target=bytecode -Wf-g )
196
203
if (BOT_SUPPORT )
197
204
set (QVM_C_FLAGS ${QVM_C_FLAGS} -DBOT_SUPPORT=1 )
You can’t perform that action at this time.
0 commit comments