From 12213a3dab374a0d5a38fa46ad52163602d5fa9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Valor=20Mart=C3=ADnez?= Date: Tue, 5 Nov 2024 17:54:23 +0100 Subject: [PATCH] =?UTF-8?q?Toooooornem=20a=20commitaaaar,=20aci=20vinga=20?= =?UTF-8?q?jugar=20al=20ping=20pong=20entre=20windows=20i=20macos=20i=20el?= =?UTF-8?q?=20puto=20copilot.=20Apanye=20aci=20i=20trenque=20all=C3=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c789086..4117b6a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,11 +15,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED True) # Configuración global de flags de compilación set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") - -# Flags específicas para Debug -set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g") - -# Flags específicas para Release set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Os -ffunction-sections -fdata-sections") # Define el directorio de los archivos fuente @@ -70,7 +65,21 @@ elseif(APPLE) set(LIBS ${LIBS} "-framework OpenGL") target_compile_definitions(${PROJECT_NAME} PRIVATE MACOS_BUILD) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") + # Configurar compilación para Apple Silicon + set(CMAKE_OSX_ARCHITECTURES "arm64") elseif(UNIX AND NOT APPLE) set(LIBS ${LIBS} GL) target_compile_definitions(${PROJECT_NAME} PRIVATE LINUX_BUILD) -endif() \ No newline at end of file + target_link_libraries(${PROJECT_NAME} ${LIBS}) +endif() + +# Añadir OpenGL a las bibliotecas enlazadas +if(NOT WIN32) + find_package(OpenGL REQUIRED) + if(OPENGL_FOUND) + message(STATUS "OpenGL encontrado: ${OPENGL_LIBRARIES}") + target_link_libraries(${PROJECT_NAME} ${OPENGL_LIBRARIES}) + else() + message(FATAL_ERROR "OpenGL no encontrado") + endif() +endif()