From 0f526069533b4b25ebccff3a032962f0ea3caa4b Mon Sep 17 00:00:00 2001 From: Tasos Sahanidis Date: Wed, 11 Jan 2017 03:16:48 +0200 Subject: [PATCH] Pass -DLINUX to n/yasm --- src/CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ba354c28..51e5333c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -390,11 +390,22 @@ if(${SRB2_CONFIG_HWRENDER} AND ${SRB2_CONFIG_STATIC_OPENGL}) endif() if(${SRB2_CONFIG_USEASM}) + #SRB2_ASM_FLAGS can be used to pass flags to either nasm or yasm. + if(NOT DEFINED SRB2_ASM_FLAGS) + set(SRB2_ASM_FLAGS "") + endif() + + if(${CMAKE_SYSTEM} MATCHES "Linux") + set(SRB2_ASM_FLAGS "-DLINUX ${SRB2_ASM_FLAGS}") + endif() + if(${SRB2_CONFIG_YASM}) set(CMAKE_ASM_YASM_SOURCE_FILE_EXTENSIONS ${CMAKE_ASM_YASM_SOURCE_FILE_EXTENSIONS} nas) + set(CMAKE_ASM_YASM_FLAGS "${SRB2_ASM_FLAGS}" CACHE STRING "") enable_language(ASM_YASM) else() set(CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS ${CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS} nas) + set(CMAKE_ASM_NASM_FLAGS "${SRB2_ASM_FLAGS}" CACHE STRING "") enable_language(ASM_NASM) endif() set(SRB2_USEASM ON)