I have an app that uses multiple static libraries that use NASM as the assembler and compiles in Linux and android and all builds are done with CMake only. They all compile fine and I did conditional includes of assembly files using the NASM -P option. For example in CMAKE
if(DEFINED TARGET_OS_ANDROID)
#android/aarch64 uses clang as assembler
elseif(DEFINED TARGET_OS_WINDOWS)
enable_language(ASM_NASM)
string(APPEND CMAKE_ASM_NASM_FLAGS “-Pconfig_ffmpeg_w64.asm “)
else()
enable_language(ASM_NASM)
string(APPEND CMAKE_ASM_NASM_FLAGS “-Pconfig_ffmpeg_linux.asm “)
endif()
I want to compile using flatpak for Linux distribution but the -P no longer works (I assume flatpak overrides it for their own use).
Is there a way to conditionally include asm files like above but inside a asm file using a if defined to simulate what I did in CMAKE?
Using scripts to generate the asm file before the compile is NOT an option
repo checkout is git clone https://gitlab.com/nolimitconnectapps/nolimitapp.git
I expected it to more or less compile in flatpak because it is a Linux environment but no joy.
Tried just including all the asm defines in root CMakeList.txt using similar to
add_compile_definitions(HAVE_SYMVER_GNU_ASM=1)
but some libraries require different values so for example maybe HAVE_SYMVER_GNU_ASM should be 0 in another library and this causes many issues.
Brett Jones is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.