COMP: OPTIONAL was missing in ENABLE_LANGUAGE()
-the assembler file seems to work for Linux and FreeBSD -try to fix main() for HP-UX compiler Alex
This commit is contained in:
parent
7627b96dd1
commit
ef7b647b3b
@ -2,20 +2,19 @@ project(Assembler)
|
|||||||
|
|
||||||
set(SRCS)
|
set(SRCS)
|
||||||
|
|
||||||
message(STATUS "Testing assembler support, system: ${CMAKE_SYSTEM_NAME} processor: ${CMAKE_SYSTEM_PROCESSOR}")
|
|
||||||
|
|
||||||
# if no file has been set as source and we are on linux with an x86 processor try to use the gas/as assembler
|
# if no file has been set as source and we are on linux with an x86 processor try to use the gas/as assembler
|
||||||
if(NOT SRCS AND NOT APPLE AND CMAKE_SYSTEM_PROCESSOR MATCHES "[ix].?86$")
|
# main-linux-x86-gas.s seems to work for Linux and FreeBSD
|
||||||
# if(NOT SRCS AND CMAKE_SYSTEM_NAME MATCHES Linux AND CMAKE_SYSTEM_PROCESSOR MATCHES "[ix].?86$")
|
if(NOT SRCS AND CMAKE_SYSTEM_PROCESSOR MATCHES "[ix].?86$")
|
||||||
message(STATUS "Trying to enable ASM-ATT for Linux/x86")
|
if(CMAKE_SYSTEM MATCHES Linux or CMAKE_SYSTEM MATCHES FreeBSD)
|
||||||
enable_language(ASM-ATT)
|
message(STATUS "Trying to enable ASM-ATT for Linux or FreeBSD on x86")
|
||||||
|
enable_language(ASM-ATT OPTIONAL)
|
||||||
if(CMAKE_ASM-ATT_COMPILER_WORKS)
|
if(CMAKE_ASM-ATT_COMPILER_WORKS)
|
||||||
message(STATUS "Trying to enable ASM-ATT for Linux/x86 - succeeded")
|
message(STATUS "Trying to enable ASM-ATT for Linux/x86 - succeeded")
|
||||||
# this assembler file was created using gcc -S main.c
|
# this assembler file was created using gcc -S main.c
|
||||||
set(SRCS main-linux-x86-gas.s)
|
set(SRCS main-linux-x86-gas.s)
|
||||||
endif(CMAKE_ASM-ATT_COMPILER_WORKS)
|
endif(CMAKE_ASM-ATT_COMPILER_WORKS)
|
||||||
endif(NOT SRCS AND NOT APPLE AND CMAKE_SYSTEM_PROCESSOR MATCHES "[ix].?86$")
|
endif(CMAKE_SYSTEM MATCHES Linux or CMAKE_SYSTEM MATCHES FreeBSD)
|
||||||
# endif(NOT SRCS AND CMAKE_SYSTEM_NAME MATCHES Linux AND CMAKE_SYSTEM_PROCESSOR MATCHES "[ix].?86$")
|
endif(NOT SRCS AND CMAKE_SYSTEM_PROCESSOR MATCHES "[ix].?86$")
|
||||||
|
|
||||||
if(NOT SRCS)
|
if(NOT SRCS)
|
||||||
message(STATUS "No assembler enabled, using C")
|
message(STATUS "No assembler enabled, using C")
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
#ifdef __CLASSIC_C__
|
||||||
|
int main(){
|
||||||
|
int ac;
|
||||||
|
char*av[];
|
||||||
|
#else
|
||||||
|
int main(int ac, char*av[]){
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
printf("hello assembler world, %d arguments given\n", argc);
|
printf("hello assembler world, %d arguments given\n", argc);
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user