Skip to content

Commit

Permalink
Add ability to exclude challenges from building
Browse files Browse the repository at this point in the history
  • Loading branch information
krx committed Jul 13, 2017
1 parent 3f63405 commit 9d93ace
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
16 changes: 15 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,25 @@ if(WIN32)
)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MACHINE:X86")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MACHINE:X86")

# Read in challenges to exclude from build
file(STRINGS "exclude/win.txt" cb_exclude)
else(WIN32)
# Generic ASM can be enabled on other OSs
enable_language(ASM)

if(UNIX AND NOT APPLE)
set(LINUX TRUE)
add_definitions(-DLINUX)

# Read in challenges to exclude from build
file(STRINGS "exclude/linux.txt" cb_exclude)
endif()
if(APPLE)
add_definitions(-DAPPLE)

# Read in challenges to exclude from build
file(STRINGS "exclude/osx.txt" cb_exclude)
endif()

# Default flags for everything
Expand Down Expand Up @@ -183,6 +192,11 @@ foreach(cb_path ${challenge_binaries})
if(IS_DIRECTORY ${cb_path} AND EXISTS ${cb_path}/CMakeLists.txt)
# Get filename
get_filename_component(cb_id ${cb_path} NAME)
add_subdirectory(${cb_path})

# Skip the challenge if it's in the exclude list
list(FIND cb_exclude ${cb_id} idx)
if(${idx} EQUAL -1)
add_subdirectory(${cb_path})
endif()
endif()
endforeach()
3 changes: 3 additions & 0 deletions exclude/linux.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
adventure_game
CAT
SBTP
3 changes: 3 additions & 0 deletions exclude/osx.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
adventure_game
CAT
SBTP
1 change: 1 addition & 0 deletions exclude/win.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BIRC

0 comments on commit 9d93ace

Please sign in to comment.