forked from Bananymous/banan-os
				
			
			update main #1
			
				
			
		
		
		
	| 
						 | 
					@ -23,6 +23,7 @@ set(USERSPACE_PROJECTS
 | 
				
			||||||
	sync
 | 
						sync
 | 
				
			||||||
	tee
 | 
						tee
 | 
				
			||||||
	test
 | 
						test
 | 
				
			||||||
 | 
						test-globals
 | 
				
			||||||
	touch
 | 
						touch
 | 
				
			||||||
	u8sum
 | 
						u8sum
 | 
				
			||||||
	whoami
 | 
						whoami
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,17 @@
 | 
				
			||||||
 | 
					cmake_minimum_required(VERSION 3.26)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					project(test-globals CXX)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					set(SOURCES
 | 
				
			||||||
 | 
						main.cpp
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					add_executable(test-globals ${SOURCES})
 | 
				
			||||||
 | 
					target_compile_options(test-globals PUBLIC -O2 -g)
 | 
				
			||||||
 | 
					target_link_libraries(test-globals PUBLIC libc)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					add_custom_target(test-globals-install
 | 
				
			||||||
 | 
						COMMAND sudo cp ${CMAKE_CURRENT_BINARY_DIR}/test-globals ${BANAN_BIN}/
 | 
				
			||||||
 | 
						DEPENDS test-globals
 | 
				
			||||||
 | 
						USES_TERMINAL
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,14 @@
 | 
				
			||||||
 | 
					#include <stdio.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					struct foo_t
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						foo_t() { printf("global constructor works\n"); }
 | 
				
			||||||
 | 
						~foo_t() { printf("global destructor works\n"); }
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					foo_t foo;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					int main()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Loading…
	
		Reference in New Issue