From 3e51197ae420168a4880f3df40ab611a5332dbbc Mon Sep 17 00:00:00 2001 From: "Enrico Fraccaroli (Galfurian)" Date: Thu, 30 Nov 2023 13:16:09 -0500 Subject: [PATCH] Try to fix compilation under MacOS --- CMakeLists.txt | 14 ++++++-------- mentos/CMakeLists.txt | 5 ++++- programs/CMakeLists.txt | 4 +++- programs/tests/CMakeLists.txt | 4 +++- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f34e349..90c6b3c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,12 @@ cmake_minimum_required(VERSION 3.1...3.22) # Initialize the project. -project(mentos C ASM) +project(mentos) + +enable_language(C) +enable_language(ASM) + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -nostdlib") # ============================================================================= # BUILD TYPE (Debug/Release) @@ -61,13 +66,6 @@ else() # set(CMAKE_LINKER ld) endif() -if(NOT DEFINED HAVE_FLAG_SEARCH_PATHS_FIRST) - set(HAVE_FLAG_SEARCH_PATHS_FIRST 0) - if("${DARWIN_MAJOR_VERSION}" GREATER 6) - set(HAVE_FLAG_SEARCH_PATHS_FIRST 1) - endif() -endif() - # ============================================================================= # COMPILATION # ============================================================================= diff --git a/mentos/CMakeLists.txt b/mentos/CMakeLists.txt index 2d014ea..bcf3be4 100644 --- a/mentos/CMakeLists.txt +++ b/mentos/CMakeLists.txt @@ -6,7 +6,10 @@ cmake_minimum_required(VERSION 3.1...3.22) # Initialize the project. -project(kernel C ASM) +project(kernel) + +enable_language(C) +enable_language(ASM) # ============================================================================= # Set the main file names. diff --git a/programs/CMakeLists.txt b/programs/CMakeLists.txt index 384c03c..a997faa 100644 --- a/programs/CMakeLists.txt +++ b/programs/CMakeLists.txt @@ -6,7 +6,9 @@ cmake_minimum_required(VERSION 3.1...3.22) # Initialize the project. -project(programs C) +project(programs) + +enable_language(C) # ============================================================================= # List of programs. diff --git a/programs/tests/CMakeLists.txt b/programs/tests/CMakeLists.txt index 9cd4dc0..3632a3a 100644 --- a/programs/tests/CMakeLists.txt +++ b/programs/tests/CMakeLists.txt @@ -6,7 +6,9 @@ cmake_minimum_required(VERSION 3.1...3.22) # Initialize the project. -project(tests C) +project(tests) + +enable_language(C) # ============================================================================= # List of programs.