-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
22 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,27 @@ | ||
cmake_minimum_required(VERSION 3.7) | ||
set(project_name "nasm-test") | ||
project(${project_name} ASM_NASM) | ||
|
||
set(CMAKE_NASM_LINK_EXECUTABLE "ld <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") | ||
set(CAN_USE_ASSEMBLER TRUE) | ||
|
||
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | ||
if (APPLE) | ||
set(CMAKE_ASM_NASM_OBJECT_FORMAT macho64) | ||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -macosx_version_min 10.13") | ||
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | ||
set(CMAKE_ASM_NASM_FLAGS "-DMACOS") | ||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -macosx_version_min 10.13 -no_pie") | ||
endif (APPLE) | ||
|
||
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") | ||
if (UNIX AND NOT APPLE) | ||
set(CMAKE_ASM_NASM_OBJECT_FORMAT elf64) | ||
endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") | ||
endif (UNIX AND NOT APPLE) | ||
|
||
enable_language(ASM_NASM) | ||
project(${project_name} ASM_NASM) | ||
|
||
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | ||
set(CMAKE_ASM_NASM_FLAGS "-DMACOS") | ||
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | ||
enable_language(ASM_NASM) | ||
|
||
set(SOURCE_FILES src/asm/helloworld.asm) | ||
|
||
add_executable(${project_name} ${SOURCE_FILES}) | ||
set_target_properties(${project_name} PROPERTIES LINKER_LANGUAGE NASM) | ||
|
||
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | ||
if (APPLE) | ||
target_link_libraries(${project_name} System) | ||
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | ||
endif (APPLE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters