
##############################################################################
#                                                                            #
#                  IMPINJ CONFIDENTIAL AND PROPRIETARY                       #
#                                                                            #
# This source code is the sole property of Impinj, Inc.  Reproduction or     #
# utilization of this source code in whole or in part is forbidden without   #
# the prior written consent of Impinj, Inc.                                  #
#                                                                            #
# (c) Copyright Impinj, Inc. 2009. All rights reserved.                      #
#                                                                            #
##############################################################################


##############################################################################
#
# $Id: SConscript 60276 2009-10-19 18:21:43Z dshaheen $
# 
#  Description: Build script that builds the rfid library unit tests
#      
#
##############################################################################


Import("env", "buildos", "installdir")

# Make a copy of the environment
localEnv = env.Clone()

sources = [ "sample_list.c",
            "sample_stack.c",
            "sample_utility.c",
            buildos+"/mapfile.c",
            "print_packet.c" ]

# Add project-specific, platform-independent include directories, libraries,
# and library paths
localEnv["CPPPATH"] += [ "../include",
                         "../../include",
                         "../../include/"+buildos,
                         "../../../include/"+buildos ]

# Linux-specific build flags
if "linux" == buildos:
    #
    # Add Linux-specific preprocessor defines
    localEnv["CPPDEFINES"].update({ "_GNU_SOURCE" : 1 })
    #
    # MontaVista-specific build flags
    if env["mv"]:
        #
        # Add MV-specific preprocessor defines
        localEnv["CPPDEFINES"].update({ "COMPILE_BIG_ENDIAN" : 1 })
#
# Windows-specific build flags
elif "windows" == buildos:
    #
    # Add Windows-specific preprocessor defines
    localEnv["CPPDEFINES"].update({ "BUILD_SHARED_LIBRARY" : 1,
                                    "_CRT_SECURE_NO_DEPRECATE" : 1 })
    #
    # Add DLL-specific preprocessor defines
    localEnv["CPPDEFINES"].update(localEnv["COMMONDLLDEFS"])
    #
    # If debug build, add program database for debug symbols
    if env["debug"]:
        localEnv["PDB"] = "sample_shared.pdb"
    else:
        localEnv["PDB"] = ""
    #
    # If we are compiling for CE, then set the entry point
    if env["ce"]:
        localEnv["LINKFLAGS"] += env["cedllentry"]

#localEnv.VariantDir("build", ".")
localEnv.StaticLibrary("sample_shared", sources)
