libraries/libnx/CMakeLists.txt

25 lines
878 B
CMake

cmake_minimum_required(VERSION 3.00)
project(libnx)
set(C 99)
set(CMAKE_NASM_COMPILE_OBJECT "nasm <INCLUDES> <FLAGS> -o <OBJECT> <SOURCE>")
add_library(libnx)
add_library(libnx_asm OBJECT)
target_include_directories(libnx PRIVATE inc)
file(GLOB_RECURSE libnx_src_c "src/**.c")
file(GLOB_RECURSE libnx_inc "inc/**.h")
file(GLOB_RECURSE libnx_src_asm "src/**.asm")
target_compile_options(libnx PRIVATE -g -fno-stack-protector -fno-stack-check -ffreestanding -m64 -march=x86-64 -mabi=sysv)
target_link_options(libnx PRIVATE -Bsymbolic -nostdlib -shared -fno-stack-protector)
enable_language(ASM_NASM)
set(CAN_USE_ASSEMBLER TRUE)
set_target_properties(libnx PROPERTIES PREFIX "")
set_target_properties(libnx PROPERTIES SUFFIX ".so")
target_sources(libnx_asm PRIVATE ${libnx_src_asm})
target_sources(libnx PRIVATE ${libnx_src_c} ${libnx_inc} $<TARGET_OBJECTS:libnx_asm>)