Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUILD: Use system wide q3asm if found. #373

Merged
merged 1 commit into from
Nov 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading