Migrate code to use pathlib
This commit is contained in:
parent
06981cd027
commit
63574f95cf
2 changed files with 55 additions and 52 deletions
14
make.py
14
make.py
|
|
@ -1,7 +1,7 @@
|
|||
#! python3
|
||||
|
||||
import glob
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
from umake import make
|
||||
|
||||
|
|
@ -12,10 +12,10 @@ class Config:
|
|||
IGNORE_APPS = []
|
||||
JOB_COUNT = int(os.cpu_count() * 0.8) # Concurent jobs (multi-processing)
|
||||
|
||||
BIN_DIR = 'bin' # Output directory (binaries)
|
||||
INCLUDE_DIR = 'include' # Include directory (header files)
|
||||
OBJECT_DIR = 'obj' # Temporary directory (object files)
|
||||
SOURCE_DIR = 'src' # Source directories
|
||||
BIN_DIR = Path('bin') # Output directory (binaries)
|
||||
INCLUDE_DIR = Path('include') # Include directory (header files)
|
||||
OBJECT_DIR = Path('obj') # Temporary directory (object files)
|
||||
SOURCE_DIR = Path('src') # Source directories
|
||||
|
||||
COMMON_FLAGS = '-std=c++17' # Flags used for comiling and linking
|
||||
COMMON_DEBUG_FLAGS = '-g' # Flags added in debug mode
|
||||
|
|
@ -23,8 +23,8 @@ class Config:
|
|||
COMPILE_FLAGS = f'-Wall -I{INCLUDE_DIR}' # Flags added for compiling (recommandation : `pkg-config --cflags`)
|
||||
LINK_FLAGS = '' # Flags added for linking (recommandation : `pkg-config --libs`)
|
||||
|
||||
CPP_HEADERS = glob.glob(os.path.join(INCLUDE_DIR, '**', '*.hpp'), recursive=True)
|
||||
CPP_SOURCES = glob.glob(os.path.join(SOURCE_DIR, '**', '*.cpp'), recursive=True)
|
||||
CPP_HEADERS = INCLUDE_DIR.rglob('*.hpp')
|
||||
CPP_SOURCES = SOURCE_DIR.rglob('*.cpp')
|
||||
|
||||
|
||||
def main():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue