37 lines
828 B
CMake
37 lines
828 B
CMake
# WDC toolchain for CMake
|
|
# Copyright (C) 2021 Tentei Ltd.
|
|
# DISTRIBUTED AS PUBLIC DOMAIN. No restrictions apply.
|
|
|
|
if(NOT CMAKE_ASM_WDC_COMPILER)
|
|
SET(_COMPILER_LIST ca65)
|
|
|
|
find_program(
|
|
CMAKE_ASM_WDC_COMPILER
|
|
NAMES ${_COMPILER_LIST}
|
|
DOC "WDC assembler")
|
|
|
|
unset(_COMPILER_LIST)
|
|
|
|
if(CMAKE_ASM_WDC_COMPILER)
|
|
set(CMAKE_ASM_WDC_COMPILER_ID CA65 CACHE PATH "WDC assembler ID")
|
|
|
|
execute_process(
|
|
COMMAND ${CMAKE_ASM_WDC_COMPILER} --version
|
|
OUTPUT_VARIABLE _OUTPUT1
|
|
ERROR_VARIABLE _OUTPUT2)
|
|
|
|
if("${_OUTPUT1};${_OUTPUT2}" MATCHES ".*ca65 V([^\n]*)-.*")
|
|
set(CMAKE_ASM_WDC_COMPILER_VERSION "${CMAKE_MATCH_1}" CACHE PATH "WDC assembler version")
|
|
endif()
|
|
|
|
unset(_OUTPUT1)
|
|
unset(_OUTPUT2)
|
|
|
|
include(Compiler/WDC)
|
|
endif()
|
|
endif()
|
|
|
|
set(ASM_DIALECT "_WDC")
|
|
include(CMakeDetermineASMCompiler)
|
|
set(ASM_DIALECT)
|