Skip to content

Commit

Permalink
Merge pull request #373 from qw-ctf/system-wide-q3asm
Browse files Browse the repository at this point in the history
BUILD: Use system wide q3asm if found.
  • Loading branch information
dsvensson authored Nov 2, 2024
2 parents d2b6c5a + f1b3740 commit ccbff2c
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -181,17 +181,24 @@ else()
endif()


# Build QVM tools.
# EXCLUDE_FROM_ALL tells to not build tools if they does not required, for example if you build native library only.
add_subdirectory(tools/q3asm EXCLUDE_FROM_ALL)
# Build QVM tools if needed.
find_program(Q3ASM q3asm)
if(Q3ASM)
message(STATUS "q3asm found at ${Q3ASM}")
set(QVM_LINKER "${Q3ASM}")
else()
message(STATUS "q3asm not found, compiling bundled q3asm.")
# EXCLUDE_FROM_ALL tells to not build tools if they does not required, for example if you build native library only.
add_subdirectory(tools/q3asm EXCLUDE_FROM_ALL)
set(QVM_LINKER "q3asm")
endif()

# Set up vars for QVM library.
set(VM_DIR "vm")
add_custom_target(vmdir
COMMAND ${CMAKE_COMMAND} -E make_directory ${VM_DIR}
)
set(QVM_COMPILER "q3lcc")
set(QVM_LINKER "q3asm")
set(QVM_C_FLAGS -DQ3_VM -S -Wf-target=bytecode -Wf-g)
if(BOT_SUPPORT)
set(QVM_C_FLAGS ${QVM_C_FLAGS} -DBOT_SUPPORT=1)
Expand Down

0 comments on commit ccbff2c

Please sign in to comment.