mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-14 00:40:46 +00:00
Merge branch 'cmake_nasm' into 'master'
CMake: Fix nasm Linux builds When compiling under Linux with CMake and nasm/yasm enabled, the operation would fail during linking with undefined symbols related to the tmap files. This commit adds support for passing flags to the assembler and passes ```-DLINUX``` in order to compile. After this change, binaries are successfully compiled with either nasm or yasm on Linux systems. Tested on Ubuntu. See merge request !153
This commit is contained in:
commit
e7a1c81355
1 changed files with 7 additions and 0 deletions
|
@ -390,11 +390,18 @@ if(${SRB2_CONFIG_HWRENDER} AND ${SRB2_CONFIG_STATIC_OPENGL})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${SRB2_CONFIG_USEASM})
|
if(${SRB2_CONFIG_USEASM})
|
||||||
|
#SRB2_ASM_FLAGS can be used to pass flags to either nasm or yasm.
|
||||||
|
if(${CMAKE_SYSTEM} MATCHES "Linux")
|
||||||
|
set(SRB2_ASM_FLAGS "-DLINUX ${SRB2_ASM_FLAGS}")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(${SRB2_CONFIG_YASM})
|
if(${SRB2_CONFIG_YASM})
|
||||||
set(CMAKE_ASM_YASM_SOURCE_FILE_EXTENSIONS ${CMAKE_ASM_YASM_SOURCE_FILE_EXTENSIONS} nas)
|
set(CMAKE_ASM_YASM_SOURCE_FILE_EXTENSIONS ${CMAKE_ASM_YASM_SOURCE_FILE_EXTENSIONS} nas)
|
||||||
|
set(CMAKE_ASM_YASM_FLAGS "${SRB2_ASM_FLAGS}" CACHE STRING "Flags used by the assembler during all build types.")
|
||||||
enable_language(ASM_YASM)
|
enable_language(ASM_YASM)
|
||||||
else()
|
else()
|
||||||
set(CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS ${CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS} nas)
|
set(CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS ${CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS} nas)
|
||||||
|
set(CMAKE_ASM_NASM_FLAGS "${SRB2_ASM_FLAGS}" CACHE STRING "Flags used by the assembler during all build types.")
|
||||||
enable_language(ASM_NASM)
|
enable_language(ASM_NASM)
|
||||||
endif()
|
endif()
|
||||||
set(SRB2_USEASM ON)
|
set(SRB2_USEASM ON)
|
||||||
|
|
Loading…
Reference in a new issue