From 60a3cd3a06b386263dad1d21c767c3383e62cc86 Mon Sep 17 00:00:00 2001 From: LeandroSQ Date: Tue, 30 Jan 2024 03:13:35 -0300 Subject: [PATCH] removed pch from linux --- .github/workflows/ci.yml | 1 + CMakeLists.txt | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9101a09..b351e17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,6 +58,7 @@ jobs: echo "EMSDK_INCLUDE_ROOT=$EMSDK/upstream/emscripten/cache/sysroot/include" >> $env:GITHUB_ENV - name: Define compiler + if: matrix.os != 'ubuntu-latest' || matrix.target == 'desktop' shell: bash run: | if [ "$RUNNER_OS" == "Linux" ]; then diff --git a/CMakeLists.txt b/CMakeLists.txt index a074bce..e56b112 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,10 @@ cmake_minimum_required(VERSION 3.18.0) set(PROJECT_NAME sandbox) +if(UNIX AND NOT APPLE) + set(LINUX ON) +endif() + function(dump_info) message(STATUS "CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}") message(STATUS "CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}") @@ -13,7 +17,7 @@ function(dump_info) message(STATUS "OS: WIN32") elseif(APPLE) message(STATUS "OS: APPLE") - elseif(UNIX) + elseif(LINUX) message(STATUS "OS: LINUX") endif() @@ -58,7 +62,9 @@ function(define_target_properties target) target_compile_features(${target} PRIVATE cxx_std_23) # Precompiled headers - target_precompile_headers(${target} PRIVATE ${PRECOMPILED_HEADERS}) + if(NOT LINUX) + target_precompile_headers(${target} PRIVATE ${PRECOMPILED_HEADERS}) + endif() # Link dependencies target_link_libraries(${target} raylib) @@ -115,9 +121,7 @@ endif() # Source files file(GLOB_RECURSE SOURCES "src/core/*.cpp" "src/core/*.hpp") set(PRECOMPILED_HEADERS "src/core/precomp.hpp") -if(UNIX AND NOT APPLE) - set(CMAKE_PCH_INSTANTIATE_TEMPLATES OFF) -else() +if(NOT LINUX) set(CMAKE_PCH_INSTANTIATE_TEMPLATES ON) endif()